Subsetting MODIS-AQUA download by lat/lon with wget?

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
anthcook
Posts: 20
Joined: Thu Feb 02, 2023 1:11 pm America/New_York
Answers: 0

Subsetting MODIS-AQUA download by lat/lon with wget?

by anthcook » Mon Feb 06, 2023 2:12 pm America/New_York

Hello all,
In the past, I have done a manual extraction(subset) of MODIS-AQUA data using the online Level3 browser with manual inputs.

I would now like to do the same type of download, except in an automated fashion with wget via Windows.

Is there a way to build a wget command to do a download of MODIS-AQUA data, where the download is limited to a specific lat and lon range?

Thank you,
Anthony

Tags:

NSIDC - greckase
User Services
User Services
Posts: 12
Joined: Tue Jan 25, 2022 11:32 am America/New_York
Answers: 0

Re: Subsetting MODIS-AQUA download by lat/lon with wget?

by NSIDC - greckase » Mon Feb 06, 2023 6:01 pm America/New_York

Hi Anthony,

If you are attempting to download MODIS data from the NSIDC, I suggest you browse this programmatic data access guide: https://nsidc.org/data/user-resources/help-center/programmatic-data-access-guide.
Of particular interest may be the NSIDC DAAC's data access and service API.

Kind Regards,
Gail

anthcook
Posts: 20
Joined: Thu Feb 02, 2023 1:11 pm America/New_York
Answers: 0

Re: Subsetting MODIS-AQUA download by lat/lon with wget?

by anthcook » Mon Feb 06, 2023 7:01 pm America/New_York

Hi Gail,
I am trying to download ocean IOP MODIS-AQUA, and other sensor data, from the earth.data.nasa.gov/oceancolor.gsfc.nasa.gov site.

This is a typical wget command I am using at the Windows command prompt:
wget --user=anthcook --ask-password --auth-no-challenge=on https://oceandata.sci.gsfc.nasa.gov/ob/getfile/AQUA_MODIS.20220101.L3m.DAY.IOP.a_531.4km.nc

I did look at the programming guide in the link you provided at NSIDC. In particular, I saw the "bounding-box" term, such as in the given example at NSIDC:
https://n5eil02u.ecs.nsidc.org/egi/request?short_name=NSIDC-0481&version=1&time=2017-01-01T00:00:00,2018-12-31T00:00:00&bounding_box=-52.5,68.5,-47.5,69.5

When I try to append the string "&bounding_box=-52.5,68.5,-47.5,69.5" to the URL in my wget command above, wget executes the download of the full globe dataset, and then wget tries to execute "bounding_box=-52.5,68.5,-47.5,69.5", which it reports as an unknown wget command. So it behaves as if wget is separately trying to execute the bounding_box command independently from the download.

Many thanks, and still searching for a solution,
Anthony

OB.DAAC - amscott
User Services
User Services
Posts: 341
Joined: Mon Jun 22, 2020 5:24 pm America/New_York
Answers: 1
Has thanked: 8 times
Been thanked: 3 times

Re: Subsetting MODIS-AQUA download by lat/lon with wget?

by OB.DAAC - amscott » Fri Feb 10, 2023 11:54 am America/New_York

Currently, the options that can be used with wget or curl are here: https://oceandata.sci.gsfc.nasa.gov/api/file_search_help/

anthcook
Posts: 20
Joined: Thu Feb 02, 2023 1:11 pm America/New_York
Answers: 0

Re: Subsetting MODIS-AQUA download by lat/lon with wget?

by anthcook » Fri Feb 10, 2023 12:55 pm America/New_York

Hi amscott,
Thank you for the link.

The line below, found on the page in your link, provides an indication that Level1 data can be specified with lat/lon limits:
https://oceandata.sci.gsfc.nasa.gov/cgi/getfile/T2003122090500.L1A_LAC.R0000032134_21N_17N_160W_152W.hdf

Is there a similar provision or ability for limiting lat/lon limits for downloading Level3 data with wget?

Thank you,
Anthony

OB.DAAC - SeanBailey
User Services
User Services
Posts: 1461
Joined: Wed Sep 18, 2019 6:15 pm America/New_York
Answers: 1
Been thanked: 4 times

Re: Subsetting MODIS-AQUA download by lat/lon with wget?

by OB.DAAC - SeanBailey » Fri Feb 10, 2023 1:28 pm America/New_York

Anthony,
That example is to an existing extracted L1A file (one used by our SeaBASS team for doing validation analyses). We do not support extracting on the fly, but do offer extraction via data orders for L1, L2 and L3 data. Using the L3 browser, you can request spatially extracted data to be staged for you.

https://oceancolor.gsfc.nasa.gov/l3/

Regards,
Sean

anthcook
Posts: 20
Joined: Thu Feb 02, 2023 1:11 pm America/New_York
Answers: 0

Re: Subsetting MODIS-AQUA download by lat/lon with wget?

by anthcook » Fri Feb 10, 2023 1:37 pm America/New_York

Hi Sean,
I did not mention it earlier, but all of my original downloads of subsetting and extracting L3 data were via the L3 browser page.

Looking for a more automated method of downloading led me to using wget commands.

A future upgrade of allowing subsetting/extracting L3 data via wget commands would be enthusiastically welcomed, although I realize that might not be feasible and/or could involve a huge amount of work from the EarthData staff.

Thank you,
Anthony

OB.DAAC - SeanBailey
User Services
User Services
Posts: 1461
Joined: Wed Sep 18, 2019 6:15 pm America/New_York
Answers: 1
Been thanked: 4 times

Re: Subsetting MODIS-AQUA download by lat/lon with wget?

by OB.DAAC - SeanBailey » Fri Feb 10, 2023 3:07 pm America/New_York

Anthony,

We also support extracted subscriptions, but currently only or L1 and L2. It is our plan to extend that support to L3.
Another plan in the works is to have the file search API support spatial searches (currently it only does temporal) and allow it to submit extraction requests. ...that might satisfy your need, although it would be a bit asynchronous.

Extracting on the fly would only be possible with L3, and would definitely require some pretty significant development work. We'll put it on the wish list.

Sean

OB.DAAC - amscott
User Services
User Services
Posts: 341
Joined: Mon Jun 22, 2020 5:24 pm America/New_York
Answers: 1
Has thanked: 8 times
Been thanked: 3 times

Re: Subsetting MODIS-AQUA download by lat/lon with wget?

by OB.DAAC - amscott » Fri Feb 10, 2023 5:28 pm America/New_York

@anthcook this takes awhile but you can query earthdata search using this format:

wget --load-cookies ~/.urs_cookies --save-cookies ~/.urs_cookies --auth-no-challenge=on https://cmr.earthdata.nasa.gov/search?fi=MODIS&fdc=Ocean+Biology+Distributed+Active+Archive+Center&fl=3+-+Gridded+Observations&fpc0=Earth+Observation+Satellites&fps0=Aqua&fpb0=Space-based+Platforms&lat=10.96875&long=8.4375&zoom=0

To get this URL, I used the filters on the left of the Earthdata Search Tool to select all the values (images attached) and then copied the URL and stuck it into the wget command.
Screen Shot 2023-02-10 at 4.58.24 PM.png
Screen Shot 2023-02-10 at 4.58.24 PM.png (26.66 KiB) Not viewed yet
Screen Shot 2023-02-10 at 4.58.24 PM.png
Screen Shot 2023-02-10 at 4.58.24 PM.png (26.66 KiB) Not viewed yet
Screen Shot 2023-02-10 at 4.58.24 PM.png
Screen Shot 2023-02-10 at 4.58.24 PM.png (26.66 KiB) Not viewed yet
Attachments
Screen Shot 2023-02-10 at 5.00.24 PM.png
Screen Shot 2023-02-10 at 5.00.24 PM.png (204.92 KiB) Not viewed yet
Screen Shot 2023-02-10 at 5.00.13 PM.png
Screen Shot 2023-02-10 at 5.00.13 PM.png (45.59 KiB) Not viewed yet

anthcook
Posts: 20
Joined: Thu Feb 02, 2023 1:11 pm America/New_York
Answers: 0

Re: Subsetting MODIS-AQUA download by lat/lon with wget?

by anthcook » Tue Feb 14, 2023 3:15 pm America/New_York

Thank you amscott,
I received errors when I tried to execute your command in wget (see attachment). How did you not receive these errors?

Anthony
Attachments
amscott_example.PNG
amscott_example.PNG (40.66 KiB) Not viewed yet

Post Reply