Coder Social home page Coder Social logo

jellis18 / nx01 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stevertaylor/nx01

0.0 1.0 0.0 7.28 MB

Python code to perform isotropic, anisotropic (non-evolving/evolving) searches.

License: MIT License

Python 44.15% Jupyter Notebook 55.85%

nx01's Introduction

NX01

Python code to perform isotropic, anisotropic (non-evolving/evolving) searches for gravitational-waves via pulsar-timing.

Perhaps you want the webpage?

Code list

  • NX01_master.py: performs a full evolving-anisotropy GWB and noise analysis. Uses MultiNest or parallel-tempering sampling.
  • NX01_singlePsr.py: performs a stochastic search for single-pulsar noise parameters within the reduced-rank time-frequency approximation. Uses MultiNest or parallel-tempering sampling.
  • NX01_AnisCoefficients.py: utility file to create power-anisotropy basis-functions.
  • NX01_utils.py: utility file.
  • NX01_plot.py: plotting package, adapted and extended from PAL.
  • NX01_psr.py: utility file which defines the pulsar class for storing all relevant variables.
  • NX01_datafile.py: creates an hdf5 container to store all the information in the pulsar class. Useful for storing array products.
  • NX01_jitter.pxy: cython code to perform Sherman-Morrison block noise-matrix inversions when handling ECORR (jitter).
  • NX01_bayesutils.py: utilities file for generating plotting data.

Preliminaries

One important first thing to note is to make sure you have correctly updated your tempo2 clock files with the corresponding files packaged with the NANOGrav data download.

It is recommended that you initially open and follow the steps in the nanograv-pulsar-store.ipynb notebook, and produce your own PsrListings_GWB.txt and PsrListings_CW.txt. These latter files are lists of pulsars in the order with which they contribute to the stochastic background upper limit (_GWB.txt) and the single-source SNR (_CW.txt). Each pulsar is associated with a path to an hdf5 file (storing all pulsar properties), parfile, and timfile.

By following the steps in the notebook (only up until the cross-validation plotting between NX01 and PAL2) you will produce your own hdf5 files, which you should put in a directory of your choice. These hdf5 files will store everything you need for subsequent GW searches. Another important step in the notebook is to produce par files which are stripped of tempo2 EFAC, EQUAD, ECORR, RedAmp, and RedInd values. These values are replaced by mean values from Justin's previous single-pulsar analyses.

Single-pulsar noise analysis

It should be straightforward to perform a single-pulsar noise analysis out of the box.

Run python NX01_singlePsr.py --help for a list of all options.

An example run command would be:

python NX01_singlePsr.py
--parfile=./NANOGrav_9y/par/J1713+0747_NANOGrav_9yv1.t2.gls.strip.par
--timfile=./NANOGrav_9y/tim/J1713+0747_NANOGrav_9yv1.tim
--efacequad-sysflag=f --fullN --ptmcmc

Without the --ptmcmc option, the sampler will default to MultiNest.

If you have MPI installed you can parallelise by running the following:

mpirun -np 4 NX01_singlePsr.py
--parfile=./NANOGrav_9y/par/J1713+0747_NANOGrav_9yv1.t2.gls.strip.par
--timfile=./NANOGrav_9y/tim/J1713+0747_NANOGrav_9yv1.tim
--efacequad-sysflag=f --fullN --ptmcmc

where 4 cores will produce 4 temperature chains in the parallel-tempering MCMC sampling process. Without the --ptmcmc command, 4 cores would have been used to update the live points in MultiNest.

Gravitational-wave searches

It is recommended to read in pulsars from their respective hdf5 files, which you should have previously produced from the nanograv-pulsar-store.ipynb notebook.

Run python NX01_master.py --help for a list of all options.

An example run command would be:

python NX01_master.py --from-h5
--psrlist=./PsrListings_GWB.txt --nmodes=15
--incGWB --fix-slope --num_psrs=18 --fullN

which will perform a GW background upper-limit analysis (without correlations...to include correlations add --incCorr) on the 18 pulsars analyzed in the 9-year NANOGrav limit paper.

As in the single-pulsar analysis case, you can use MPI for the PTMCMC, however MultiNest functionality is not yet ready.

nx01's People

Contributors

stevertaylor avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.