Specifying sampling stepsize in data retrievals

22 views
Skip to first unread message

Tom Bridgman

unread,
Aug 10, 2020, 9:26:29 AM8/10/20
to SunPy
I don't see an example in the SunPy examples, and it looks like it isn't directly supported in Fido.

Is there a simple way to control the sampling stepsize when retrieving data?  For example, I want to retrieve data between two dates but want data sampled every hour or maybe 15 minutes?  The VSO interface supports this in IDL, selecting datasets within some window around the sample time.

Unless there is some more elegant way, the methods I currently see might be:

* run Fido between two timestamps, and then sample the result returned, maybe result[::10]?

* generate multiple Fido at specified times, perhaps using the pad(timedelta) method to define a window around each sample time.

Other options?

Thanks,
Tom

Will Barnes

unread,
Aug 10, 2020, 10:22:57 AM8/10/20
to SunPy
Hi Tom,

If I understand your question correctly, you can achieve what you're describing using the "Sample" search attribute. For example, if you were querying AIA 171Å from the VSO over a 30 minute interval sampled every 1 minute,

from sunpy.net import attrs, Fido
import astropy.units as u
q
= Fido.search(
    attrs.Instrument('AIA'),
    attrs.Wavelength(171*u.angstrom),
    attrs.Time('2011-01-01T00:00:00','2011-01-01T00:30:00'),
    attrs.Sample(1*u.min)
)

The Sample attr is also documented here in the documentation (albeit in the context of JSOC).

Best,

Will

Tom Bridgman

unread,
Aug 10, 2020, 11:13:18 AM8/10/20
to SunPy
Ah!  Under Attributes.  Thanks.
Reply all
Reply to author
Forward
0 new messages