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.1.tar.gz (57.6 kB view details)

Uploaded Source

Built Distribution

PyPulse-0.1.1-py3-none-any.whl (62.9 kB view details)

Uploaded Python 3

File details

Details for the file PyPulse-0.1.1.tar.gz.

File metadata

  • Download URL: PyPulse-0.1.1.tar.gz
  • Upload date:
  • Size: 57.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.24.0 CPython/3.6.9

File hashes

Hashes for PyPulse-0.1.1.tar.gz
Algorithm Hash digest
SHA256 89cb362d2108215784f5b0df8e79311f7856f0da705ce4d77d4e884ca6c651b4
MD5 aa87a11b28cabf6ec00d1d0933762955
BLAKE2b-256 ab57bdbb60bac2bbb3642c2262a3480fc227538408ccd856abc3af3b98d425ae

See more details on using hashes here.

File details

Details for the file PyPulse-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: PyPulse-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 62.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.24.0 CPython/3.6.9

File hashes

Hashes for PyPulse-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 df72d572772f5d31828238f762871172b8888516c4a15c0a56b54a647484db96
MD5 ca177835ee1207ca235c857f7e402575
BLAKE2b-256 d1752d2450cd511f8ec2bb3a7f2c753f472f7dbde4d587d9bbba7000dbf3191c

See more details on using hashes here.

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