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

Introduce power colors #780

Merged
merged 64 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
86d41fa
Introduce power colors
matteobachetti Nov 30, 2023
a6a66c1
Add changelog
matteobachetti Nov 30, 2023
460c90e
Fix docs for excluded frequencies and test
matteobachetti Nov 30, 2023
92c3e32
Test for power_err in power_color
matteobachetti Nov 30, 2023
e097132
Force correct format of excluded frequency intervals
matteobachetti Nov 30, 2023
0f0c70e
Be robust with array poisson_power
matteobachetti Nov 30, 2023
1f503b2
Nest inside dynamical Crosss spectrum and Power spectrum
matteobachetti Nov 30, 2023
f15b83d
Fix bug when using complex arrays
matteobachetti Nov 30, 2023
38109d7
Cast powers to real when doing power colors
matteobachetti Nov 30, 2023
c39fb77
Fix problem with input int power
matteobachetti Nov 30, 2023
3034b86
Add hue calculation and log power color
matteobachetti Dec 1, 2023
b8cf785
Add function to dynamical power spectrum to bin by number of time int…
matteobachetti Dec 1, 2023
86f4e83
Add m to docstrings
matteobachetti Dec 1, 2023
8223b06
Fix doc string
matteobachetti Dec 1, 2023
b0e6fbc
Better tests
matteobachetti Dec 1, 2023
e0d0c2e
Test average
matteobachetti Dec 1, 2023
646cdec
Fix bug that made unnorm_cs_all useless
matteobachetti Dec 1, 2023
c7bc68e
Test that the normalization is fixed once and for all
matteobachetti Dec 1, 2023
9a26a61
Add function to compute the rms (to complete the needs for power colo…
matteobachetti Dec 1, 2023
d7a55b6
Add test
matteobachetti Dec 1, 2023
7882e65
Update docs
matteobachetti Dec 2, 2023
42ad59c
Fix nbconvert version for now
matteobachetti Jan 2, 2024
a13b9f6
Improve compatibility with Numpy 2.0
matteobachetti Jan 11, 2024
8636b1d
More informative GTI failure
matteobachetti Dec 28, 2023
f01937d
Add changelog snippet
matteobachetti Dec 28, 2023
1fd421c
Make exception retrocompatible
matteobachetti Dec 28, 2023
582f17c
Hopefully less confusing warning
matteobachetti Dec 29, 2023
6ad70ec
Syntax fix
matteobachetti Dec 29, 2023
8a5b0fc
Add description of StingrayObject and StingrayTimeseries to docs
matteobachetti Dec 15, 2023
a7bcc37
Fix typo
matteobachetti Dec 15, 2023
15eaea7
Fix titles
matteobachetti Dec 15, 2023
dd1ab44
Add side parameter to find_nearest
matteobachetti Dec 8, 2023
9e23972
Add function to randomize data in small bad time intervals
matteobachetti Dec 8, 2023
4261c50
Add changelog
matteobachetti Dec 8, 2023
a60132c
Pay attention to edges
matteobachetti Dec 8, 2023
c6e7307
Rename options
matteobachetti Dec 8, 2023
c4cf72c
Fix syntax
matteobachetti Dec 8, 2023
3426b3f
Test that only the attributes we want are randomized
matteobachetti Dec 8, 2023
a57487c
Test case with no btis
matteobachetti Dec 8, 2023
6f79627
Add fake data to docs
matteobachetti Dec 9, 2023
d2084bd
Fix plotting
matteobachetti Dec 11, 2023
7dca2c6
Fix deprecation in plot
matteobachetti Dec 13, 2023
0b34459
Fix deprecation in plot
matteobachetti Dec 14, 2023
80891e6
Fix corner cases and warnings
matteobachetti Dec 14, 2023
1f6c993
Improve docstring
matteobachetti Jan 3, 2024
59d8a70
Test more keywords and more bad intervals
matteobachetti Jan 4, 2024
d1b2f0e
Top-level import when appropriate
matteobachetti Jan 11, 2024
93858a7
Add warning about applying the technique only to *very* short gaps
matteobachetti Jan 11, 2024
ba5ae1b
Change uniform to even, to avoid confusion between uniformly distribu…
matteobachetti Jan 11, 2024
c8f2595
Cleanup
matteobachetti Jan 11, 2024
dc365c3
Further warning
matteobachetti Jan 11, 2024
e809319
Fix docstring
matteobachetti Jan 11, 2024
ab966b5
Change buffer default behavior
matteobachetti Jan 11, 2024
d8c9d2b
Fix rst issue in docstring
matteobachetti Jan 11, 2024
faf9361
Fix meaning of m
matteobachetti Jan 11, 2024
dc3fd3a
Explain why rebin_by_n_intervals is different from rebin_time
matteobachetti Jan 11, 2024
c2bccea
Averaging powers, not counts
matteobachetti Jan 11, 2024
bf05e21
Default to average, not sum
matteobachetti Jan 11, 2024
12df86d
Change default behavior in rebinning: average
matteobachetti Jan 11, 2024
c7f7ba6
Add Heil citation
matteobachetti Jan 11, 2024
945a42c
frequency->freq
matteobachetti Jan 11, 2024
0469a44
Write explanation for power colors; check freq_edges dimensions and d…
matteobachetti Jan 11, 2024
17c7bf1
Additional small fix to docstring
matteobachetti Jan 11, 2024
83681ca
Fix method calls
matteobachetti Jan 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 47 additions & 2 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,57 @@ Stingray API

Library of Time Series Methods For Astronomical X-ray Data.

Base Class
==========
Most `stingray`` classes are subclasses of a single class, :class:`stingray.StingrayObject`, which
implements most of the I/O functionality and common behavior (e.g. strategies to combine data and
make operations such as the sum, difference, or negation). This class is not intended to be
instantiated directly, but rather to be used as a base class for other classes. Any class wanting
to inherit from :class:`stingray.StingrayObject` should define a ``main_array_attr`` attribute, which
defines the name of the attribute that will be used to store the "independent variable" main data array.
For example, for all time series-like objects, the main array is the time array, while for the
periodograms the main array is the frequency array.
All arrays sharing the length (not the shape: they might be multi-dimensional!) of the main array are called
"array attributes" and are accessible through the ``array_attrs`` method.
When applying a mask or any other selection to a :class:`stingray.StingrayObject`,
all array attributes are filtered in the same way. Some array-like attributes might have the same length
by chance, in this case the user or the developer should add these to the ``not_array_attr`` attribute.
For example, :class:`stingray.StingrayTimeseries` has ``gti`` among the not_array_attrs, since it is an
array but not related 1-to-1 to the main array, even if in some cases it might happen to have the same numbers
of elements of the main array, which is ``time``.

StingrayObject
--------------

.. autoclass:: stingray.StingrayObject
:members:

----

Data Classes
============

These classes define basic functionality related to common data types and typical methods
that apply to these data types, including basic read/write functionality. Currently
implemented are :class:`stingray.Lightcurve` and :class:`stingray.events.EventList`.
implemented are :class:`stingray.StingrayTimeseries`, :class:`stingray.Lightcurve` and
:class:`stingray.events.EventList`.

All time series-like data classes inherit from :class:`stingray.StingrayTimeseries`, which
implements most of the common functionality. The main data array is stored in the ``time``
attribute.
Good Time Intervals (GTIs) are stored in the ``gti`` attribute, which is a list of 2-tuples or 2-lists
containing the start and stop times of each GTI. The ``gti`` attribute is not an array attribute, since
it is not related 1-to-1 to the main array, even if in some cases it might happen to have the same number
of elements of the main array. It is by default added to the ``not_array_attr`` attribute.


StingrayTimeseries
------------------

.. autoclass:: stingray.StingrayTimeseries
:members:

----

Lightcurve
----------
Expand Down Expand Up @@ -88,7 +133,7 @@ Dynamical Powerspectrum
.. autoclass:: stingray.DynamicalPowerspectrum
:members:
:inherited-members:

----

CrossCorrelation
Expand Down
1 change: 1 addition & 0 deletions docs/changes/780.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Introduce power colors à la Heil et al. 2015
1 change: 1 addition & 0 deletions docs/changes/782.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add function to randomize data in small bad time intervals
1 change: 1 addition & 0 deletions docs/changes/787.trivial.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
More informative GTI messages
10 changes: 6 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ Current Capabilities
1. Data handling and simulation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* loading event lists from fits files of a few missions (RXTE/PCA, NuSTAR/FPM, XMM-Newton/EPIC, NICER/XTI)
* constructing light curves from event data, various operations on light curves (e.g. addition, subtraction, joining, and truncation)
* loading event lists from fits files (and generally good handling of OGIP-compliant missions, like RXTE/PCA, NuSTAR/FPM, XMM-Newton/EPIC, NICER/XTI)
* constructing light curves and time series from event data
* various operations on time series (e.g. addition, subtraction, joining, and truncation)
* simulating a light curve with a given power spectrum
* simulating a light curve from another light curve and a 1-d (time) or 2-d (time-energy) impulse response
* simulating an event list from a given light curve _and_ with a given energy spectrum
* Good Time Interval operations
* Filling gaps in light curves with statistically sound fake data

2. Fourier methods
1. Fourier methods
~~~~~~~~~~~~~~~~~~
* power spectra and cross spectra in Leahy, rms normalization, absolute rms and no normalization
* averaged power spectra and cross spectra
Expand All @@ -44,6 +46,7 @@ Current Capabilities
* bispectra; *needs testing*
* (Bayesian) quasi-periodic oscillation searches
* Lomb-Scargle periodograms and cross spectra
* Power Colors

3. Other time series methods
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -61,7 +64,6 @@ Other future additions we are currently implementing are:
* bicoherence
* phase-resolved spectroscopy of quasi-periodic oscillations
* Fourier-frequency-resolved spectroscopy
* power colours
* full HEASARC-compatible mission support
* pulsar searches with :math:`H`-test
* binary pulsar searches
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ docs =
docutils
sphinx-astropy
nbsphinx>=0.8.3,!=0.8.8
nbconvert<7.14
pandoc
ipython
towncrier<22.12.0
Expand Down
Loading