GOES data only plotting in 24-hour chunks

13 views
Skip to first unread message

Alex James

unread,
Jun 21, 2018, 4:40:27 AM6/21/18
to SunPy
Hi everyone,

I'm trying to plot GOES lightcurves with SunPy, but I'm not sure whether the code in the following documented example is working as intended: http://docs.sunpy.org/en/v0.9.0/generated/gallery/goes_hek_m25.html

I would like to plot data over just a few hours, but the code in this example only plots data in 24-hour chunks. The example suggests the user would also like data over an 8 hour period, e.g.,

tr = TimeRange(['2011-06-07 04:00', '2011-06-07 12:00'])

but the method returns a plot of a full day of data, midnight-to-midnight (seen in the given example plot). Is this working as intended? It seems like the data is downloaded by
'Fido.search' as day-long fits files, but is there a known way to then plot only the specified hours?

Thanks in advance for any help,
Alex

Stuart Mumford

unread,
Jun 21, 2018, 6:46:12 AM6/21/18
to su...@googlegroups.com
Hi Alex,

As the FITS files are for a whole day, constructing the TimeSeries from the
file will make it for the whole timerange. You can truncate the resulting
TimeSeries with the `truncate` method as shown here: http://docs.sunpy.org/en/
stable/guide/data_types/timeseries.html#truncating-a-timeseries

So doing `my_timeseries.truncate(tr)` should give you the desired outcome.

Hope that helps,
Stuart

On Thursday, 21 June 2018 09:40:27 BST Alex James wrote:
> Hi everyone,
>
> I'm trying to plot GOES lightcurves with SunPy, but I'm not sure whether
> the code in the following documented example is working as intended:
> http://docs.sunpy.org/en/v0.9.0/generated/gallery/goes_hek_m25.html
>
> I would like to plot data over just a few hours, but the code in this
> example only plots data in 24-hour chunks. The example suggests the user
> would also like data over an 8 hour period, e.g.,
>
> tr = TimeRange
> <http://docs.sunpy.org/en/v0.9.0/api/sunpy.time.TimeRange.html#sunpy.time.T
> imeRange>(['2011-06-07 04:00', '2011-06-07 12:00'])

Alex James

unread,
Jun 21, 2018, 6:58:01 AM6/21/18
to SunPy
Hi Stuart,

That's perfect! Thank you!

Alex
Reply all
Reply to author
Forward
0 new messages