reading HICO.nc L1 files in python

Please enter here to ask a question about any NASA Science related topics!
Post Reply
msoppa
Posts: 7
Joined: Thu Nov 29, 2018 7:20 am America/New_York

reading HICO.nc L1 files in python

by msoppa » Thu Feb 14, 2019 7:25 am America/New_York

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

Tags:

OB.DAAC - SeanBailey
User Services
User Services
Posts: 1171
Joined: Wed Sep 18, 2019 6:15 pm America/New_York

reading HICO.nc L1 files in python

by OB.DAAC - SeanBailey » Thu Feb 14, 2019 8:11 am America/New_York

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

msoppa
Posts: 7
Joined: Thu Nov 29, 2018 7:20 am America/New_York

reading HICO.nc L1 files in python

by msoppa » Fri Feb 15, 2019 7:53 am America/New_York

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

OB.DAAC - SeanBailey
User Services
User Services
Posts: 1171
Joined: Wed Sep 18, 2019 6:15 pm America/New_York

reading HICO.nc L1 files in python

by OB.DAAC - SeanBailey » Fri Feb 15, 2019 8:14 am America/New_York

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

msoppa
Posts: 7
Joined: Thu Nov 29, 2018 7:20 am America/New_York

reading HICO.nc L1 files in python

by msoppa » Mon Feb 18, 2019 3:55 am America/New_York

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

OB.DAAC - SeanBailey
User Services
User Services
Posts: 1171
Joined: Wed Sep 18, 2019 6:15 pm America/New_York

reading HICO.nc L1 files in python

by OB.DAAC - SeanBailey » Mon Feb 18, 2019 3:35 pm America/New_York

Yes.  The geolocation is correct (well, consistent anyway) in both.
Sean

Post Reply