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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pypulse-0.1.2-py3-none-any.whl (63.9 kB view details)

Uploaded Python 3

File details

Details for the file pypulse-0.1.2.tar.gz.

File metadata

  • Download URL: pypulse-0.1.2.tar.gz
  • Upload date:
  • Size: 62.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for pypulse-0.1.2.tar.gz
Algorithm Hash digest
SHA256 4904d46557426625b374a9c87d96c31f0c25258c74696d944d2371ea30877b8b
MD5 a2614468144ea24d84db33a83fff79d4
BLAKE2b-256 77b7b5ae334aec54387bce166c1e98941bcbdf66eabca2c49ca15475ec72d5f1

See more details on using hashes here.

File details

Details for the file pypulse-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pypulse-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 63.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for pypulse-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e09c01c217d25f82211cc8349548f686290268dc715566b01632ea001e002a41
MD5 e7549a60f996d43e3f287d611eea5461
BLAKE2b-256 b809126e456a9a96113c135c281d1085e45ce6fab8a851e6a93bd4292160b6a5

See more details on using hashes here.

Supported by

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