Opening downloaded .nc files

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
shrinidhin9
Posts: 6
Joined: Tue Jun 25, 2024 1:33 pm America/New_York
Answers: 0

Opening downloaded .nc files

by shrinidhin9 » Tue Jul 30, 2024 7:19 pm America/New_York

I'm currently (7/30/2024 16:00:00 PST) trying to download both normal and subsetted TEMPO NO2 L3 data from EarthData search, and I'm downloading the files straight from the database. I'm opening the files in python using xarray in VScode in python, and the only variables that come up are weight and latitude and longitude. I don't know what I'm doing wrong and downloading by script isn't working either. Is there an extra step I'm supposed to do when downloading files straight from EarthData Search? I tried using Harmony to subset the data with the variables I want and those still do not show up properly when I open the file using xarray. Any help in getting these files to work would be appreciated!
Attachments
Screenshot 2024-07-30 at 4.18.27 PM.png
Screenshot 2024-07-30 at 4.18.27 PM.png (273.6 KiB) Not viewed yet

Filters:

ASDC - cheyenne.e.land
Subject Matter Expert
Subject Matter Expert
Posts: 168
Joined: Mon Mar 22, 2021 3:55 pm America/New_York
Answers: 1
Has thanked: 1 time
Been thanked: 10 times

Re: Opening downloaded .nc files

by ASDC - cheyenne.e.land » Wed Jul 31, 2024 12:34 pm America/New_York

Hello,

We have contacted a Subject Matter Expert for TEMPO and they have stated that since TEMPO files are netCDF4 with groups, you need to specify the
group= parameter for the xr.open_dataset() function when wanting to access variables outside of the root group.

Thanks,
ASDC

shrinidhin9
Posts: 6
Joined: Tue Jun 25, 2024 1:33 pm America/New_York
Answers: 0

Re: Opening downloaded .nc files

by shrinidhin9 » Thu Aug 08, 2024 11:09 am America/New_York

When I tried to use group = "parameter" it gave me the error "OSError: [Errno group not found: parameter] 'parameter'", but I found from a different source that specifying group = "product" helped me access the data. Maybe it had to do with my machine being a Mac, but unsure. Thank you for your reply!

ASDC - cheyenne.e.land
Subject Matter Expert
Subject Matter Expert
Posts: 168
Joined: Mon Mar 22, 2021 3:55 pm America/New_York
Answers: 1
Has thanked: 1 time
Been thanked: 10 times

Re: Opening downloaded .nc files

by ASDC - cheyenne.e.land » Thu Aug 08, 2024 12:42 pm America/New_York

Hello,

Apologies if there was any confusion, but I did not mean to say that group = "parameter". I meant to say that because netCDF organizes its variables, dimensions, and attributes in hierarchical groups, you can open it using xarray if you know the specific groups/path and use 'group =' .

Example:

Code: Select all

import xarray as xr

fn = 'TEMPO_NO2_L3_V03_20240808T005451Z_S018.nc'
product_dataset = xr.open_dataset(fn, group='product')
Glad you figured it out.

Thanks,
ASDC

Post Reply