Skip to content
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

How to filter this data with respect to a geopandas dataframe #31

Closed
kaushikCanada opened this issue Jan 26, 2024 · 2 comments
Closed

Comments

@kaushikCanada
Copy link

I have a shapefile and i need all the EARLY data for the previous 2 days. how do u use this library to do that? i am new to this data so please bear with me.

@ghiggi
Copy link
Owner

ghiggi commented Jan 30, 2024

Hey ! Are you speaking about the IMERG Early Run product?
in that case you can use the software to download such product over the time period of interest, open it into an xarray Dataset and then perform the geospatial subsetting operations of interest.

import gpm_api
import datetime

product = "IMERG-ER"
product_type = "NRT"
version = 7

start_time = datetime.datetime(2020,7, 22, 0, 1, 11)
end_time = datetime.datetime(2020,7, 22, 0, 23, 5)

gpm_api.download(product=product,
                 product_type=product_type,
                 version=version,
                 n_threads=2,
                 start_time=start_time,
                 end_time=end_time)
                 
  ds = gpm_api.open_dataset(product=product,
                          product_type=product_type,
                          version=version
                          start_time=start_time,
                          end_time=end_time)             

I suggest you to open the shapefile with shapely and then extract the polygon bounds to define an extent to crop the ds.
Have a look at this tutorial https://github.com/ghiggi/gpm_api/blob/main/tutorials/tutorial_02_IMERG.ipynb for more info.

@kaushikCanada
Copy link
Author

kaushikCanada commented Jan 30, 2024 via email

@ghiggi ghiggi closed this as completed Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants