bounding_box
parameter and subsetting / clipping
#467
-
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") |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Hi @riesgutierrez, the issue here is that 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! |
Beta Was this translation helpful? Give feedback.
-
@betolink Regards |
Beta Was this translation helpful? Give feedback.
-
@betolink, any news on this? 🙂 |
Beta Was this translation helpful? Give feedback.
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 sub…