Accessing and Processing L3 Data in Python with netCDF4
-
- Posts: 6
- Joined: Thu Oct 19, 2023 1:28 pm America/New_York
Accessing and Processing L3 Data in Python with netCDF4
I am very new to netCDF4 and ocean color data in general, but I am having trouble simply viewing L3 data from MODIS using netCDF4 in python. I am specifically trying to view the RRS data over the whole available spectrum. What part of the dataset are the rrs data stored, group, attribute, variable, and how do you navigate to that part of the dataset to convert the data into a numpy array?
Filters:
-
- Subject Matter Expert
- Posts: 110
- Joined: Fri Jun 03, 2022 10:54 am America/New_York
- Location: NASA GSFC
- Been thanked: 8 times
- Contact:
Re: Accessing and Processing L3 Data in Python with netCDF4
Hello,
We are working on sample python scripts for such purposes. These scripts will be available very soon, but here is an example to get you started:
L3 data is stored as variables, and you can use xarray to read them:
We are working on sample python scripts for such purposes. These scripts will be available very soon, but here is an example to get you started:
L3 data is stored as variables, and you can use xarray to read them:
Code: Select all
import xarray as xr
# use the following file as an example
filename = 'AQUA_MODIS.20201001_20201031.L3m.MO.RRS.Rrs_412.4km.nc'
# Load attributes
ds = xr.open_dataset(filename)
# read Rrs, latitude, and longitude data
lat = ds.Rrs_412.lat
lon = ds.Rrs_412.lon
Rrs_412 = ds.Rrs_412.values
Re: Accessing and Processing L3 Data in Python with netCDF4
Hi, @eric.r.enloe!
HTIC (HDF-EOS Tools & Information Center) added a new Python example today:
http://hdfeos.org/zoo/OBPG/AQUA_MODIS.20221001_20221031.L3m.MO.RRS.Rrs_412.4km.nc.py
I hope it helps your research!
HTIC (HDF-EOS Tools & Information Center) added a new Python example today:
http://hdfeos.org/zoo/OBPG/AQUA_MODIS.20221001_20221031.L3m.MO.RRS.Rrs_412.4km.nc.py
I hope it helps your research!
- Attachments
-
- AQUA_MODIS.20221001_20221031.L3m.MO.RRS.Rrs_412.4km.nc.py.png (171.44 KiB) Not viewed yet