CompressedPixelData#
- class stixpy.product.sources.CompressedPixelData(*, meta, control, data, energies, idb_versions=None)[source]#
Bases:
ScienceData,PixelPlotMixin,TimesSeriesPlotMixin,SpectrogramPlotMixinCompressed count data from selected pixels, detectors and energies.
Examples
>>> from stixpy.data import test >>> from stixpy.product import Product >>> compressed_pd = Product("http://dataarchive.stix.i4ds.net/fits/L1/2020/05/05/SCI/" ... "solo_L1_stix-sci-xray-cpd_20200505T235959-20200506T000019_V02_0087031809-50883.fits") >>> compressed_pd CompressedPixelData <sunpy.time.timerange.TimeRange object at ... Start: 2020-05-05 23:59:59 End: 2020-05-06 00:00:19 Center:2020-05-06 00:00:09 Duration:0.00023148148148144365 days or 0.005555555555554648 hours or 0.33333333333327886 minutes or 19.99999999999673 seconds DetectorMasks [0...4]: [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31] PixelMasks [0...4]: [['1' '1' '1' '1' '1' '1' '1' '1' '1' '1' '1' '1']] EnergyEdgeMasks [0]: [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32]
Attributes Summary
A
stixpy.science.DetectorMasksobject representing the detectors contained in the data.An
astropy.units.Quantiyarray giving the duration or integration timeA
astropy.table.Tableobject representing the energies contained in the data.A
stixpy.science.PixelMasksobject representing the pixels contained in the dataService subtype
Service type
Science Structure ID for product
A
sunpy.time.TimeRangefor the data.An
astropy.time.Timearray representing the center of the observed time bins.Methods Summary
concatenate(others)Concatenate two or more science products.
get_data([time_indices, energy_indices, ...])Return the counts, errors, times, durations and energies for selected data.
is_datasource_for(*, meta, **kwargs)Determines if meta data meach Raw Pixel Data
plot_pixels(*[, kind, time_indices, ...])plot_spectrogram([axes, time_indices, ...])Plot a spectrogram for the selected time and energies.
plot_timeseries([time_indices, ...])Plot a times series of the selected times and energies.
Attributes Documentation
- detectors#
A
stixpy.science.DetectorMasksobject representing the detectors contained in the data.
- duration#
An
astropy.units.Quantiyarray giving the duration or integration time
- energies#
A
astropy.table.Tableobject representing the energies contained in the data.
- level#
- pixels#
A
stixpy.science.PixelMasksobject representing the pixels contained in the data
- service_subtype#
Service subtype
- service_type#
Service type
- ssid#
Science Structure ID for product
- time_range#
A
sunpy.time.TimeRangefor the data.
- times#
An
astropy.time.Timearray representing the center of the observed time bins.
Methods Documentation
- concatenate(others)#
Concatenate two or more science products.
- Parameters:
others (
list[stixpy.science.ScienceData]) – The other/s science products to concatenate- Returns:
stixpy.science.ScienceData– The concatenated science products
- get_data(time_indices=None, energy_indices=None, detector_indices=None, pixel_indices=None, sum_all_times=False)#
Return the counts, errors, times, durations and energies for selected data.
Optionally summing in time and or energy.
- Parameters:
time_indices (
listornumpy.ndarray) – If an 1xN array will be treated as mask if 2XN array will sum data between given indices. For exampletime_indices=[0, 2, 5]would return only the first, third and sixth times whiletime_indices=[[0, 2],[3, 5]]would sum the data between.energy_indices (
listornumpy.ndarray) – If an 1xN array will be treated as mask if 2XN array will sum data between given indices. For exampleenergy_indices=[0, 2, 5]would return only the first, third and sixth times whileenergy_indices=[[0, 2],[3, 5]]would sum the data between.detector_indices (
listornumpy.ndarray) – If an 1xN array will be treated as mask if 2XN array will sum data between given indices. For exampledetector_indices=[0, 2, 5]would return only the first, third and sixth detectors whiledetector_indices=[[0, 2],[3, 5]]would sum the data between.pixel_indices (
listornumpy.ndarray) – If an 1xN array will be treated as mask if 2XN array will sum data between given indices. For examplepixel_indices=[0, 2, 5]would return only the first, third and sixth pixels whilepixel_indices=[[0, 2],[3, 5]]would sum the data between.sum_all_times (
bool) – Flag to sum all give time intervals into one
- Returns:
tuple– Counts, errors, times, deltatimes, energies
- classmethod is_datasource_for(*, meta, **kwargs)[source]#
Determines if meta data meach Raw Pixel Data
- plot_pixels(*, kind='pixel', time_indices=None, energy_indices=None, fig=None, cmap=None, **kwargs)#
- plot_spectrogram(axes=None, time_indices=None, energy_indices=None, detector_indices='all', pixel_indices='all', **plot_kwargs)#
Plot a spectrogram for the selected time and energies.
- Parameters:
axes (optional
matplotlib.axes) – The axes the plot the spectrogram.time_indices (
listornumpy.ndarray) – If an 1xN array will be treated as mask if 2XN array will sum data between given indices. For exampletime_indices=[0, 2, 5]would return only the first, third and sixth times whiletime_indices=[[0, 2],[3, 5]]would sum the data between.energy_indices (
listornumpy.ndarray) – If an 1xN array will be treated as mask if 2XN array will sum data between given indices. For exampleenergy_indices=[0, 2, 5]would return only the first, third and sixth times whileenergy_indices=[[0, 2],[3, 5]]would sum the data between.**plot_kwargs (
dict) – Any additional arguments are passed topcolormesh().
- Returns:
- plot_timeseries(time_indices=None, energy_indices=None, detector_indices='all', pixel_indices='all', axes=None, error_bar=False, **plot_kwarg)#
Plot a times series of the selected times and energies.
- Parameters:
axes (optional
matplotlib.axes) – The axes the plot the spectrogram.time_indices (
listornumpy.ndarray) – If an 1xN array will be treated as mask if 2XN array will sum data between given indices. For exampletime_indices=[0, 2, 5]would return only the first, third and sixth times whiletime_indices=[[0, 2],[3, 5]]would sum the data between.energy_indices (
listornumpy.ndarray) – If an 1xN array will be treated as mask if 2XN array will sum data between given indices. For exampleenergy_indices=[0, 2, 5]would return only the first, third and sixth times whileenergy_indices=[[0, 2],[3, 5]]would sum the data between.detector_indices (
listornumpy.ndarray) – If an 1xN array will be treated as mask if 2XN array will sum data between given indices. For exampledetector_indices=[0, 2, 5]would return only the first, third and sixth detectors whiledetector_indices=[[0, 2],[3, 5]]would sum the data between.pixel_indices (
listornumpy.ndarray) – If an 1xN array will be treated as mask if 2XN array will sum data between given indices. For examplepixel_indices=[0, 2, 5]would return only the first, third and sixth pixels whilepixel_indices=[[0, 2],[3, 5]]would sum the data between.error_bar (optional
bool) – Add error bars to plot.**plot_kwargs (
dict) – Any additional arguments are passed toplot().
- Returns: