Skip to main content

A python package for handling and analyzing PSRFITS files.

Project description

PyPulse

License Code of Conduct ASCL

A pure-Python package for handling and analyzing PSRFITS files.

Read the documentation here.

This is an alternate code base from PSRCHIVE.

Requires:
python 2.7 or 3.X
numpy
scipy
matplotlib
astropy

Archive

A class for loading PSRFITS files

Usage:

ar = Archive(FILENAME) #loads archive, dedispersed and polarization averaged by default
ar.tscrunch() #averages the pulse in time
data = ar.getData() #returns the numpy data array for use by you
ar.imshow() #plots frequency vs phase for the pulses

SinglePulse

A class for handling calculations on single pulses

Usage:

sp = SinglePulse(data,windowsize=256) #will auto-calculate an offpulse region of length 256 bins
print sp.getFWHM() #prints the FWHM of the pulse
print sp.getSN() #prints a crude S/N of the pulse
print sp.fitPulse(template_array)[5] #prints a better S/N of the pulse using a template array

DynamicSpectrum

A class for handling dynamic spectra

Usage:

ds = DynamicSpectrum(FILENAME) #takes a 2D data array or a string to a .npz file for now
acf2d = ds.acf2d() #calculates the 2D ACF of the dynamic spectrum
ds.imshow() #plots the dynamic spectrum
ds.save(NEWFILENAME) #saves to a .npz file, which can then be loaded again with the first line

Par

A class for parsing pulsar parameter files

Usage:

p = Par(FILENAME)
print p.getPeriod() #prints the period in the par file (does not calculate for a specific MJD for now)
t,dmx,dmxerr = p.getDMseries() #returns the DM parameters in a nice time-series. Note that errors are those given in the par file, which may not be the "correct" ones (more info to be provided later)
print p.get("PX") #prints the parallax
print p.get("PX",error=True) #prints the error on the parallax

Tim

A class for parsing pulsar TOA files

Usage:

t = Tim(FILENAME) #automatically parses each TOA with the TOA() class
print t.toas[0].getMJD() #prints the MJD of the first TOA as a python Decimal
print t.toas[0].get('snr') #prints the value of the -snr flag of the TOA if it is available

Citations

See http://ascl.net/1706.011. You can cite as:

Lam, M. T., 2017, PyPulse, Astrophysics Source Code Library, record ascl:1706.011

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyPulse-0.1.0-1.tar.gz (57.7 kB view hashes)

Uploaded Source

Built Distribution

PyPulse-0.1.0-1-py3-none-any.whl (62.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page