Ocean 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.
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
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
Mariana,
My suspicion is that the L1 file is lying to you. Well,not you specifically
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...
Sean
My suspicion is that the L1 file is lying to you. Well,not you specifically

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...

Sean
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
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
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
SeaDAS may flip the L2 array so north is at the top - but might not get it right for the L1.
Sean
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
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
Yes. The geolocation is correct (well, consistent anyway) in both.
Sean
Sean
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill