blaylockbk / goes2go

Download and process GOES-16 and GOES-17 data from NOAA's archive on AWS using Python.
https://goes2go.readthedocs.io/
MIT License
205 stars 38 forks source link

Get data with gap between each other #52

Open arthurdurso opened 1 year ago

arthurdurso commented 1 year ago

I'm really considering using your python package, but in my project it would be better if I get data with certain frequency ( every hour for example ) and I'm not finding a way to do that with the Goes2go.

I'm looking for something similar as I do with Pandas as shown below. Captura de tela 2023-02-01 145218

blaylockbk commented 1 year ago

Hi @arthurdurso. This can be accomplished with something like this

from goes2go import GOES
import pandas as pd

DATES = pd.date_range('2023-01-01 00:00', '2023-01-01 03:00', freq="H")

G = GOES()
ds_list = [G.nearesttime(attime=DATE, return_as="xarray") for DATE in DATES]

# Join the xarray datasets together
ds = xr.concat(ds_list, dim='t')