Skip to content

Commit

Permalink
Merge pull request #156 from StingraySoftware/polarimetric_lcs
Browse files Browse the repository at this point in the history
Generic lcs
  • Loading branch information
matteobachetti authored Sep 14, 2023
2 parents 228b7a0 + be9a2e5 commit ea1e9ee
Show file tree
Hide file tree
Showing 27 changed files with 645 additions and 597 deletions.
76 changes: 72 additions & 4 deletions .github/workflows/ci_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,85 @@ env:
TOXARGS: '-v'

jobs:
ci-tests:
name: ${{ matrix.os }}, ${{ matrix.tox_env }}

check_commit:
# Check the commit message for the presence of keywords that indicate
# that the CI tests should be skipped, in favor of running doc builds only.
# Messages like [docs only], [docs-only], or [skip-tests] will skip
# Only the CI part of the workflow, not the doc build.
# [skip ci], [ci skip] etc. are instead handled by GitHub itself and will skip
# the entire workflow.
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

# Found this solution at
# https://monadical.com/posts/filters-github-actions.html#Case-2-Pull-request
- name: check if message indicates that tests should be skipped
id: check_commit
run: |
message=$(git log -1 --pretty=format:'%B')
re="\[(docs.only|skip-tests).*\]"
if [[ $message =~ $re ]]; then
echo "match=true" >> $GITHUB_OUTPUT
echo "$message -> Match is true"
else
echo "$message -> Match is false"
fi
outputs:
match: ${{ steps.check_commit.outputs.match }}

docs-tests:
name: ${{ matrix.tox_env }}
runs-on: ${{ matrix.os }}
if: "!(contains(github.event.head_commit.message, '[skip ci]') || contains(github.event.head_commit.message, '[ci skip]'))"
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
python: '3.8'
python: '3.10'
tox_env: 'build_docs'
- os: ubuntu-latest
python: '3.10'
tox_env: 'linkcheck'
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
submodules: true
- name: Check out that no sensitive environment variable is shared
run: env
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install base dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: Install system dependencies
run: sudo apt-get -y install graphviz pandoc
- name: Print Python, pip, setuptools, and tox versions
run: |
python -c "import sys; print(f'Python {sys.version}')"
python -c "import pip; print(f'pip {pip.__version__}')"
python -c "import setuptools; print(f'setuptools {setuptools.__version__}')"
python -c "import tox; print(f'tox {tox.__version__}')"
- name: Run tests
run: tox -e ${{ matrix.tox_env }}

ci-tests:
needs: check_commit
if: ${{ needs.check_commit.outputs.match != 'true' }}
name: ${{ matrix.os }}, ${{ matrix.tox_env }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
python: '3.10'
tox_env: 'codestyle'
Expand Down
4 changes: 2 additions & 2 deletions CITATION
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ howpublished = {Astrophysics Source Code Library},
month = feb,
archivePrefix = "ascl",
eprint = {1502.021},
adsurl = {http://adsabs.harvard.edu/abs/2015ascl.soft02021B},
adsurl = {https://adsabs.harvard.edu/abs/2015ascl.soft02021B},
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

Expand All @@ -39,7 +39,7 @@ archivePrefix = "arXiv",
eid = {109},
pages = {109},
doi = {10.1088/0004-637X/800/2/109},
adsurl = {http://adsabs.harvard.edu/abs/2015ApJ...800..109B},
adsurl = {https://adsabs.harvard.edu/abs/2015ApJ...800..109B},
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

6 changes: 3 additions & 3 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Project maintainers who do not follow or enforce the Code of Conduct in good fai

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [https://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
[homepage]: https://contributor-covenant.org
[version]: https://contributor-covenant.org/version/1/4/
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Contributions from everyone, experienced and inexperienced, are welcome!
If you don't know where to start, look at the open [Issues](https://github.com/StingraySoftware/HENDRICS/issues)
and/or get involved in our [Slack channel ](http://slack-invite.timelabtechnologies.com/).
and/or get involved in our [Slack channel ](https://join.slack.com/t/stingraysoftware/shared_invite/zt-49kv4kba-mD1Y~s~rlrOOmvqM7mZugQ).

Please follow the [Astropy contribution guidelines](http://docs.astropy.org/en/stable/development/workflow/development_workflow.html),
and the [Astropy coding guidelines](http://docs.astropy.org/en/stable/development/codeguide.html#coding-style-conventions).
Please follow the [Astropy contribution guidelines](https://docs.astropy.org/en/stable/development/workflow/development_workflow.html),
and the [Astropy coding guidelines](https://docs.astropy.org/en/stable/development/codeguide.html#coding-style-conventions).
This code is written in Python 3.8+
Tests run at each commit during Pull Requests, so it is easy to single out points in the code that break this compatibility.
19 changes: 9 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ difficult to treat power density spectra with the usual tools. By
exploiting the presence of two independent detectors, one could use the
**cospectrum** as a proxy for the power density spectrum (for an
explanation of why this is important, look at Bachetti et al., *ApJ*,
800, 109 -`arXiv:1409.3248 <http://arxiv.org/abs/1409.3248>`__).
800, 109 -`arXiv:1409.3248 <https://arxiv.org/abs/1409.3248>`__).

Today, this set of command line scripts is much more complete and it is
capable of working with the data of many more satellites. Among the
Expand All @@ -34,18 +34,17 @@ users will have the choice to analyze single datasets with an easy
interactive interface, and continue the analysis in batch mode with
HENDRICS. The periodograms produced by HENDRICS (like a power density
spectrum or a cospectrum), can be saved in a format compatible with
`Xspec <http://heasarc.gsfc.nasa.gov/xanadu/xspec/>`__ or
`Isis <http://space.mit.edu/home/mnowak/isis_vs_xspec/mod.html>`__, for
``XSpec`` or ``ISIS``, for
those who are familiar with those fitting packages. Despite its original
main focus on NuSTAR, the software can be used to make standard
aperiodic timing analysis on X-ray data from, in principle, any other
satellite (for sure XMM-Newton and RXTE).

The **documentation** can be found
`here <http://hendrics.readthedocs.io>`__.
`here <https://hendrics.readthedocs.io>`__.

A **tutorial** is also available
`here <http://hendrics.readthedocs.io/en/main/tutorials/index.html>`__.
`here <https://hendrics.readthedocs.io/en/main/tutorials/index.html>`__.

Installation instructions
-------------------------
Expand Down Expand Up @@ -74,13 +73,13 @@ license information in the ``LICENSE.rst`` file.
**If you use this software in a publication**, please refer to its
Astrophysics Source Code Library identifier:

1. Bachetti, M. 2018, HENDRICS: High ENergy Data Reduction Interface from the Command Shell, record `ascl:1805.019 <http://ascl.net/1805.019>`__.
1. Bachetti, M. 2018, HENDRICS: High ENergy Data Reduction Interface from the Command Shell, record `ascl:1805.019 <https://ascl.net/1805.019>`__.

and please also cite `stingray <https://stingray.science/stingray/citing.html>`

In particular, **if you use the cospectrum**, please also refer to:

2. Bachetti et al. 2015, `ApJ <http://iopscience.iop.org/0004-637X/800/2/109/>`__ , **800**, 109.
2. Bachetti et al. 2015, `ApJ <https://iopscience.iop.org/0004-637X/800/2/109/>`__ , **800**, 109.

If you have found a bug please report it by creating a
new issue on the `HENDRICS GitHub issue tracker. <https://github.com/StingraySoftware/HENDRICS/issues>`_
Expand All @@ -89,7 +88,7 @@ Development guidelines
----------------------

Please follow the development workflow for
`the Astropy project <http://docs.astropy.org/en/stable/development/workflow/development_workflow.html>`__.
`the Astropy project <https://docs.astropy.org/en/stable/development/workflow/development_workflow.html>`__.
In the hendrics/tests
directory, there is a test suite called ``test_fullrun.py``. These tests
use the actual command line scripts, and should always pass (albeit with
Expand All @@ -99,6 +98,6 @@ the API.
.. |Build Status| image:: https://github.com/StingraySoftware/HENDRICS/workflows/CI%20Tests/badge.svg
:target: https://github.com/StingraySoftware/HENDRICS/actions/
.. |Coverage Status| image:: https://codecov.io/gh/StingraySoftware/HENDRICS/branch/main/graph/badge.svg
:target: https://codecov.io/gh/StingraySoftware/HENDRICS
:target: https://app.codecov.io/gh/StingraySoftware/HENDRICS
.. |Documentation Status| image:: https://readthedocs.org/projects/hendrics/badge/?version=main
:target: http://hendrics.readthedocs.io/en/main/?badge=main
:target: https://hendrics.readthedocs.io/en/main/?badge=main
10 changes: 0 additions & 10 deletions docs/hendrics/index.rst

This file was deleted.

24 changes: 12 additions & 12 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ HENDRICS documentation
.. |Build Status| image:: https://github.com/StingraySoftware/HENDRICS/workflows/CI%20Tests/badge.svg
:target: https://github.com/StingraySoftware/HENDRICS/actions/
.. |Coverage Status| image:: https://codecov.io/gh/StingraySoftware/HENDRICS/branch/main/graph/badge.svg
:target: https://codecov.io/gh/StingraySoftware/HENDRICS
:target: https://app.codecov.io/gh/StingraySoftware/HENDRICS
.. |Documentation Status| image:: https://readthedocs.org/projects/hendrics/badge/?version=main
:target: http://hendrics.readthedocs.io/en/main/?badge=main
:target: https://hendrics.stingray.science/en/main/?badge=main

Description
-----------
Expand All @@ -34,8 +34,7 @@ users will have the choice to analyze single datasets with an easy
interactive interface, and continue the analysis in batch mode with
HENDRICS. The periodograms produced by HENDRICS (like a power density
spectrum or a cospectrum), can be saved in a format compatible with
`Xspec <http://heasarc.gsfc.nasa.gov/xanadu/xspec/>`__ or
`Isis <http://space.mit.edu/home/mnowak/isis_vs_xspec/mod.html>`__, for
``XSpec`` or ``ISIS``, for
those who are familiar with those fitting packages. Despite its original
main focus on NuSTAR, the software can be used to make standard
aperiodic timing analysis on X-ray data from, in principle, any other
Expand All @@ -50,11 +49,14 @@ HENDRICS 8.0 (under development)
+ ``HENaccelsearch`` now has additional options for detrending, denoising and deorbiting
+ An improved Maximum likelihood algorithm as FFTFIT substitute for TOA calculation
+ NASA's IXPE added to supported missions
+ Compatible with `Stingray 1.1 <https://github.com/StingraySoftware/stingray/releases/tag/v1.1>`__ or newer
+ Add option to obtain weighted light curves


HENDRICS 7.0
~~~~~~~~~~~~

+ Based on `Stingray 1.0 <https://github.com/StingraySoftware/stingray/releases/tag/v1.>`__, bringing a huge bump in performance
+ Based on `Stingray 1.0 <https://github.com/StingraySoftware/stingray/releases/tag/v1.0>`__, bringing a huge bump in performance
+ Following Astropy, Numpy and Scipy, HENDRICS 7.0 is only compatible with Python >3.8
+ Accepts many more file formats for round-trip of Stingray objects, thanks to the new functionality of Stingray.
+ Energy-filtered periodograms
Expand Down Expand Up @@ -114,7 +116,7 @@ Functionality additions:
.. Note ::
MaLTPyNT provisionally accepted as an
`Astropy affiliated package <http://www.astropy.org/affiliated/index.html>`__
`Astropy affiliated package <https://www.astropy.org/affiliated/index.html>`__
In preparation for the 2.0 release, the API has received some visible changes.
Expand Down Expand Up @@ -176,13 +178,13 @@ license information in the ``LICENSE.rst`` file.
**If you use this software in a publication**, please refer to its
Astrophysics Source Code Library identifier:

1. Bachetti, M. 2018, HENDRICS: High ENergy Data Reduction Interface from the Command Shell, record `ascl:1805.019 <http://ascl.net/1805.019>`__.
1. Bachetti, M. 2018, HENDRICS: High ENergy Data Reduction Interface from the Command Shell, record `ascl:1805.019 <https://ascl.net/1805.019>`__.

and please also cite `stingray <https://stingray.science/stingray/citing.html>`

In particular, **if you use the cospectrum**, please also refer to:

2. Bachetti et al. 2015, `ApJ <http://iopscience.iop.org/0004-637X/800/2/109/>`__ , **800**, 109.
2. Bachetti et al. 2015, `ApJ <https://iopscience.iop.org/article/10.1088/0004-637X/800/2/109>`__ , **800**, 109.

If you have found a bug please report it by creating a
new issue on the `HENDRICS GitHub issue tracker. <https://github.com/StingraySoftware/HENDRICS/issues>`_
Expand All @@ -193,15 +195,15 @@ Acknowledgements
(MaLTPyNT) 2.0
~~~~~~~~~~~~~~
I would like to thank all the co-authors of `the NuSTAR timing
paper <http://arxiv.org/abs/1409.3248>`__ and the NuSTAR X-ray binaries
paper <https://arxiv.org/abs/1409.3248>`__ and the NuSTAR X-ray binaries
working group. This software would not exist without the interesting
discussions before and around that paper. In particular, I would like to
thank Ivan Zolotukhin, Francesca Fornasini, Erin Kara, Felix Fürst,
Poshak Gandhi, John Tomsick and Abdu Zoghbi for helping testing the code
and giving various suggestions on how to improve it. Last but not least,
I would like to thank Marco Buttu (by the way, `check out his book if
you speak
Italian <http://www.amazon.it/Programmare-con-Python-completa-DigitalLifeStyle-ebook/dp/B00L95VURC/ref=sr_1_1?s=books&ie=UTF8&qid=1424298092&sr=1-1>`__)
Italian <https://www.amazon.it/Programmare-con-Python-completa-DigitalLifeStyle-ebook/dp/B00L95VURC/ref=sr_1_1?s=books&ie=UTF8&qid=1424298092&sr=1-1>`__)
for his priceless pointers on Python coding and code management
techniques.

Expand Down Expand Up @@ -229,8 +231,6 @@ API documentation
:maxdepth: 2

hendrics/modules
hendrics/index


Indices and tables
==================
Expand Down
26 changes: 13 additions & 13 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,41 @@ Prerequisites
You'll need a recent python 3.8+ installation.
The main dependency is

1. `Stingray <http://github.com/stingraysoftware/stingray>`__,
1. `Stingray <https://github.com/stingraysoftware/stingray>`__,

which in turn depends on

2. `Numpy <http://www.numpy.org/>`__;
2. `Numpy <https://www.numpy.org/>`__;

3. `Matplotlib <http://matplotlib.org/>`__;
3. `Matplotlib <https://matplotlib.org/>`__;

4. `Scipy <http://scipy.org/>`__;
4. `Scipy <https://scipy.org/>`__;

5. `Astropy <http://www.astropy.org/>`__
5. `Astropy <https://www.astropy.org/>`__

**Optional but recommended** dependencies are:

6. the `netCDF 4 library <http://www.unidata.ucar.edu/software/netcdf/>`__ with its
6. the `netCDF 4 library <https://www.unidata.ucar.edu/software/netcdf/>`__ with its
`python bindings <https://github.com/Unidata/netcdf4-python>`__;

7. `Numba <http://numba.pydata.org>`__;
7. `Numba <https://numba.pydata.org>`__;

8. `statsmodels <http://www.statsmodels.org/stable/index.html>`__
8. `statsmodels <https://www.statsmodels.org/stable/index.html>`__

9. `emcee <http://dfm.io/emcee/current/>`__
9. `emcee <https://emcee.readthedocs.io/en/stable/>`__

10. `pint <http://github.com/nanograv/pint/>`__
10. `pint <https://github.com/nanograv/pint/>`__

You should also
have a working `HEASoft <http://heasarc.nasa.gov/lheasoft/>`__
have a working `HEASoft <https://heasarc.gsfc.nasa.gov/lheasoft/>`__
installation to produce the cleaned event files and to use
`XSpec <http://heasarc.nasa.gov/lheasoft/xanadu/xspec/index.html>`__.
`XSpec <https://heasarc.gsfc.nasa.gov/xanadu/xspec/>`__.

Installing releases
-------------------
::

$ pip install hendrics numba emcee statsmodels netcdf4 matplotlib stingray>=1.0b1
$ pip install hendrics numba emcee statsmodels netcdf4 matplotlib stingray>=1.1


Installing the Development version
Expand Down
Loading

0 comments on commit ea1e9ee

Please sign in to comment.