Not logged inOcean Color Forum

The forum is locked.

The Ocean Color Forum has transitioned over to the Earthdata Forum (https://forum.earthdata.nasa.gov/). The information existing below will be retained for historical reference. Please sign into the Earthdata Forum for active user support.

Up Topic Special Topics / HICO / reading HICO.nc L1 files in python
- By msoppa Date 2019-02-14 12:25
Hi,

I am new to python and I am struggling to read HICO L1 .nc files properly. Im using python3 on Linux.

For some reason I cannot read solar_azimuth and sensor_azimuth data in python, but if I try with seadas it is ok. So the data is there.

Here are the comand lines I use:

#----------------------------------
from netCDF4 import Dataset
nc = Dataset('H2014045025457.L1B_ISS.nc','r')
sza = nc.groups['navigation']['solar_zenith'][1,1]
vza = nc.groups['navigation']['sensor_zenith'][1,1]
saa = nc.groups['navigation']['solar_azimuth'][1,1]
vaa = nc.groups['navigation']['sensor_azimuth'][1,1]
print(sza)
print(vza)
print(saa)
print(vaa)
#----------------------------------

And the output I get is:
58.751854
18.975159
--
--

Can anyone help? Thanks,
Mariana
- By seanbailey Date 2019-02-14 13:11
Mariana,

My suspicion is that the L1 file is lying to you.  Well,not you specifically :wink:
The valid_min/max attributes for the azimuth angles listed in the file are -180 to 180 degrees, but the values in the array seem to be 0 to 360.
If the python reader is honoring the valid_min/max attributes, then it will treat the values above 180 as not valid. 

...we may need to regenerate the files to correct this...:cry:

Sean
- By msoppa Date 2019-02-15 12:53
Sean,

it seams to be related to python/modules/linux version I am using. Today I am working with another computer and works.

But another question now. I looked at the X and Y values for a specific coordinate in both L1 and L2 .nc files and they report different values. Same lat/lon, different X/Y.

Were the L2.nc files not generated from the L1 files that are available to download?

Best,
Mariana
- By seanbailey Date 2019-02-15 13:14
In SeaDAS or python? 
SeaDAS may flip the L2 array so north is at the top - but might not get it right for the L1.

Sean
- By msoppa Date 2019-02-18 08:55
SeaDAS,

I wanted to extract Ltoa and Rrs spectra for a specific sites (AERONET).

So if I use the lat/lon info I will be fine right?

Cheers,
Mariana
- By seanbailey Date 2019-02-18 20:35
Yes.  The geolocation is correct (well, consistent anyway) in both.
Sean
Up Topic Special Topics / HICO / reading HICO.nc L1 files in python

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill