Python API to search, slice and download VIIRS (or MODIS or ...) L2 OC data by query bounding_box and timestamp?

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
juancho.gossn
Posts: 10
Joined: Tue May 26, 2015 6:34 am America/New_York
Answers: 0

Python API to search, slice and download VIIRS (or MODIS or ...) L2 OC data by query bounding_box and timestamp?

by juancho.gossn » Fri Feb 02, 2024 10:22 am America/New_York

Dear NASA colleagues,

I have been looking at the /https://github.com/nsidc/earthaccess module hoping that it would fit the purpose. I used the following commands to retrieve data from SeaHawk's dataset (https://catalog.data.gov/dataset/seahawk-hawkeye-regional-ocean-color-oc-data-version-2018-0-b9ff8):

Code: Select all

from earthaccess import Auth, Store, DataCollections, DataGranules, open
import pandas as pd

auth = Auth()
auth.login(strategy="netrc")
print(auth.authenticated)

Query_collections = DataCollections()
Query_granules = DataGranules()

Query_collections.concept_id('C2124738174-OB_DAAC').temporal("2023-02-06","2023-02-07")
However, I cannot find the "concept_id" for OC L2 data of missions such as Aqua/MODIS or Suomi-NPP/VIIRS, at least when browsing in the https://catalog.data.gov/dataset/. Where can I find these collection_ids? Or maybe there is still no DOIs assigned to these collections from these missions?

In case these still don't have assigned DOIs, is there any Python API to download data from these missions provided a given:

1) mission
2) bounding_box [would it slice the data before downloading as can be done in the traditional OBPG Level 2 download tool]
3) temporal range?

Thank you so much!! Juan

Tags:

OB ODPS - towens
Subject Matter Expert
Subject Matter Expert
Posts: 378
Joined: Fri Feb 05, 2021 9:17 am America/New_York
Answers: 0
Been thanked: 4 times

Re: Python API to search, slice and download VIIRS (or MODIS or ...) L2 OC data by query bounding_box and timestamp?

by OB ODPS - towens » Tue Feb 06, 2024 4:12 pm America/New_York

To get the concept_id, run this query;
curl -i "https://cmr.earthdata.nasa.gov/search/collections.json?provider=OB_DAAC&page_size=2000&pretty=true"

The concept_id is labeled "id"
e.g.:
"dataset_id" : "Terra MODIS Regional Inherent Optical Properties (IOP) Data, version R2022.0",
"version_id" : "R2022.0"
"id" : "C1228529910-OB_DAAC",

Tommy

Post Reply