Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with bounding_box parameter #464

Closed
riesgutierrez opened this issue Feb 21, 2024 · 3 comments
Closed

Problem with bounding_box parameter #464

riesgutierrez opened this issue Feb 21, 2024 · 3 comments

Comments

@riesgutierrez
Copy link

riesgutierrez commented Feb 21, 2024

I am looking for the product "GLDAS Noah Land Surface Model L4 monthly 0.25 x 0.25 degree V2.1 (GLDAS_NOAH025_M)" for a polygon containing Colombia (bounding_box=(-80.947, -5.872, -65.479, 14.518)), using the function "earthaccess.search_data". However, when downloading with the function "earthaccess.download", the product is downloaded for the whole planet and not for the region of Colombia.

Thank you for your cooperation.

This is the code I am using:

import earthaccess
import os
import xarray as xr
from pyproj import CRS

auth = earthaccess.login()

#username: xxxxx
#password: xxxxx


#Searching for data
results = earthaccess.search_data(
    #short_name="GLDAS Noah Land Surface Model L4 monthly 0.25 x 0.25 degree V2.1 (GLDAS_NOAH025_M)",
    doi="10.5067/SXAVCZFAQLNO",
    cloud_hosted=True,
    bounding_box=(-80.947, -5.872, -65.479, 14.518),
    temporal=("2009-01-01", "2009-12-31"),
    )

data_links = [granule.data_links(access="external") for granule in results]

files = earthaccess.download(results, "D:/CURSO_R_PYTHON/series_tiempo_ml/descargas")
@betolink
Copy link
Member

betolink commented Feb 21, 2024

Hi @riesgutierrez, the issue here is that earthaccess doesn't support subsetting services yet. This is a global dataset so any bounding box will match any of the files in the collection. We are in the process of integrating subsetting services like OPeNDAP, NASA's Harmony etc to have that capability in the library.

In the meantime we could use OPeNDAP directly, I think @battistowx has some examples of how. Or we could also open the files and subset them using xarray(slow unless you are in AWS). Here is an example with another global dataset: https://notebooksharing.space/view/0c9b943bfe8ec599df7ecf667c0efc8450f4d3a4c55ce359acc6949a3cc832ee#displayOptions=

Lastly, we could download and subset locally (although not optimal), I think we should have subsetting services this year!

@riesgutierrez
Copy link
Author

@betolink
Thank you very much for the information, I will proceed to review the link you share with me.

Regards

@mfisher87
Copy link
Collaborator

Hope you all don't mind, converting this issue to a discussion for better visibility than a closed issue would have :)

@nsidc nsidc locked and limited conversation to collaborators Feb 21, 2024
@mfisher87 mfisher87 converted this issue into discussion #467 Feb 21, 2024
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in earthaccess project Feb 21, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

3 participants