how to retrieve chlorophyll data from the downloaded files?
how to retrieve chlorophyll data from the downloaded files?
Hi,
I try using Python to retrieve chlorophyll data but I cannot itentify any variables after using netCDF4 package:
the code is:
from netCDF4 import Dataset
data = Dataset('filename.nc')
print(data.variables.keys())
then the variables are empty.
I also open the data file in SeaDAS and could see the chlorophyll data. so What should I do?
I appreciate your help!
I try using Python to retrieve chlorophyll data but I cannot itentify any variables after using netCDF4 package:
the code is:
from netCDF4 import Dataset
data = Dataset('filename.nc')
print(data.variables.keys())
then the variables are empty.
I also open the data file in SeaDAS and could see the chlorophyll data. so What should I do?
I appreciate your help!
Filters:
-
- Subject Matter Expert
- Posts: 269
- Joined: Thu Mar 05, 2009 10:25 am America/New_York
- Been thanked: 2 times
how to retrieve chlorophyll data from the downloaded files?
the variables are in the group "geophysical_data", so try this:
don
from netCDF4 import Dataset
data = Dataset('filename.nc')
print(data.groups['geophysical_data'].variables.keys())
don
how to retrieve chlorophyll data from the downloaded files?
that works! now I can read the attributes of the variable chlorophyll.but how can get the values of the variable?
and there is another question: where is the latitude and longitude variables? I need to match the chlorophyll and the position.
thanks so much!
best,
yunyi
and there is another question: where is the latitude and longitude variables? I need to match the chlorophyll and the position.
thanks so much!
best,
yunyi
-
- Posts: 1519
- Joined: Wed Sep 18, 2019 6:15 pm America/New_York
- Been thanked: 9 times
how to retrieve chlorophyll data from the downloaded files?
Those would be in the
Sean
navigation_data
group:print(data.groups.keys())
odict_keys(['sensor_band_parameters', 'scan_line_attributes', 'geophysical_data', 'navigation_data', 'processing_control'])
print(data['navigation_data'].variables.keys())
odict_keys(['longitude', 'latitude', 'cntl_pt_cols', 'cntl_pt_rows', 'tilt'])
Sean
how to retrieve chlorophyll data from the downloaded files?
Hi Sean,
I found them. Thanks so much for your help!
Best,
Yunyi
I found them. Thanks so much for your help!
Best,
Yunyi
how to retrieve chlorophyll data from the downloaded files?
Hi Sean,
I notice the variable latitude is a matrix with 922 rows and 265 columns. but I don't find the rules behind the values.
for example,
print(latitude)
[[17.824507 17.822117 17.81972 ... 16.696947 16.688335 16.679647]
[17.83543 17.833052 17.830666 ... 16.714483 16.705923 16.697289]
[17.82531 17.822823 17.820326 ... 16.64324 16.634192 16.625063]
...
[25.942488 25.939787 25.937078 ... 24.631378 24.621128 24.610785]
[25.953365 25.950676 25.947979 ... 24.64875 24.638552 24.628262]
[25.964241 25.961565 25.958881 ... 24.66612 24.655975 24.645737]]
It seems there are overlapped ranges between rows and columns. could you explain how the structure is formed?
Thanks!
Yunyi
I notice the variable latitude is a matrix with 922 rows and 265 columns. but I don't find the rules behind the values.
for example,
print(latitude)
[[17.824507 17.822117 17.81972 ... 16.696947 16.688335 16.679647]
[17.83543 17.833052 17.830666 ... 16.714483 16.705923 16.697289]
[17.82531 17.822823 17.820326 ... 16.64324 16.634192 16.625063]
...
[25.942488 25.939787 25.937078 ... 24.631378 24.621128 24.610785]
[25.953365 25.950676 25.947979 ... 24.64875 24.638552 24.628262]
[25.964241 25.961565 25.958881 ... 24.66612 24.655975 24.645737]]
It seems there are overlapped ranges between rows and columns. could you explain how the structure is formed?
Thanks!
Yunyi
-
- Posts: 1519
- Joined: Wed Sep 18, 2019 6:15 pm America/New_York
- Been thanked: 9 times
how to retrieve chlorophyll data from the downloaded files?
The navigation array should be a pixel for pixel match for the geophysical data array unless the data were processed with a control point increment different than 1 (something we have not done in a LONG time - long before we started writing the data in netCDF).
The locations defined in the latitude and longitude arrays are the geolocated position for the data.
Level 1 and 2 data are not mapped, so in the case of MODIS and VIIRS there will be a "bow-tie" effect
at the edge of the scan.
Sean
The locations defined in the latitude and longitude arrays are the geolocated position for the data.
Level 1 and 2 data are not mapped, so in the case of MODIS and VIIRS there will be a "bow-tie" effect
at the edge of the scan.
Sean