PsrPopPy Documentation
Release 1
S Bates
April 17, 2013
CONTENTS
1
.
.
.
.
3
3
3
3
3
2
Installation
2.1 Download the package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2 Compile the FORTRAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5
5
5
3
Command-line scripts
3.1 populate.py . . .
3.2 dosurvey.py . . .
3.3 view.py . . . . .
3.4 visualize.py . . .
.
.
.
.
7
7
8
8
8
4
Tutorial - Basic Usage
4.1 Generate Population Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.2 Simulate a Pulsar Survey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.3 Visualising a Pulsar Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9
9
9
10
5
Module-level Documentation
5.1 pulsar – Creates/stores a pulsar object . . . . . . . . . . . . .
5.2 population – Creates/stores a population . . . . . . . . . . .
5.3 survey – Read a survey file into a survey object . . . . . . . . .
5.4 populate – Create a population object . . . . . . . . . . . . .
5.5 radialmodels – Container for radial distn models . . . . . .
5.6 galacticops – Container for functions relating to the Galaxy .
13
13
13
14
14
14
15
6
Introduction
1.1 What is PsrPopPy? .
1.2 Why is PsrPopPy? .
1.3 Who can contribute?
1.4 Acknowledgements
Indices and tables
Index
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
17
19
i
ii
PsrPopPy Documentation, Release 1
Contents:
CONTENTS
1
PsrPopPy Documentation, Release 1
2
CONTENTS
CHAPTER
ONE
INTRODUCTION
1.1 What is PsrPopPy?
PsrPopPy is a Python (for the most part) implementation of Duncan Lorimer’s PSRPOP code. All of the user-facing (in
normal circumstances) code is written in Python, with some remaining FORTRAN functions (e.g. NE2001, coordinate
conversion) for speed.
1.2 Why is PsrPopPy?
For the development of a research project, I was modifying the PSRPOP code, but found it somewhat tricky. I decided
to re-write the code with much heavier reliance on functions and with added OO design. This makes modifying the
code and addition of new features much more simple, with little speed loss since the difficult number crunching is still
done in FORTRAN. The added bonus of re-writing the code is the detection of a number of bugs in the original code,
which have hopefully been eliminated.
1.3 Who can contribute?
In short - anybody. The code is up on github and I’ll be happy to accept suggestions for future modifications and
improvements.
1.4 Acknowledgements
Many thanks to Duncan Lorimer for giving his blessing to this project and of course for generating the codebase which
has inspired this project.
3
PsrPopPy Documentation, Release 1
4
Chapter 1. Introduction
CHAPTER
TWO
INSTALLATION
To get started with PsrPopPy there are a few steps you’ll need to go through.
PsrPopPy is currently supported on Linux and Mac OS X, and for full feature support, it is recommended to install the
Matplotlib package and either use Python versions >2.6, or install the argparse module.
2.1 Download the package
The source for PsrPopPy can be downloaded from GitHub from the PsrPopPy page. The source will contain the
Python modules and scripts needed both for basic and advanced use.
2.2 Compile the FORTRAN
Although PsrPopPy is a Python-based package, some of the algorithms have been kept in their native FORTRAN for
speed and ease of programming (e.g. the NE2001 electron model, coordinate conversion...). Therefore, it is necessary
to compile the FORTRAN.
Two scripts are provided for just this purpose (though I hope to find someone willing to contribute configure scripts).
From the base directory:
> cd lib/fortran
To use make, edit makefile. and ensure that the gf variable points to the location of your gfortran
compiler. Then simply type make. All being well, four .so files will be generated.
Failing this, edit either make_mac.csh or make_linux.csh, depending upon your system, so that the gf variable
points to your local gfortran/f77 compiler. Running the script:
> tcsh make_.csh
should then compile a series of .so files in the fortran directory. Assuming this went to plan, the installation
process is completed.
5
PsrPopPy Documentation, Release 1
6
Chapter 2. Installation
CHAPTER
THREE
COMMAND-LINE SCRIPTS
3.1 populate.py
-n
Required: Number of pulsars to generate; or to detect in a survey
-o
Source Exif Data:
File Type : PDF
File Type Extension : pdf
MIME Type : application/pdf
PDF Version : 1.5
Linearized : No
Page Count : 24
Page Mode : UseOutlines
Warning : Duplicate 'Author' entry in dictionary (ignored)
Author : S Bates
Title : PsrPopPy Documentation
Subject :
Creator : LaTeX with hyperref package
Producer : pdfTeX-1.40.13
Create Date : 2013:04:17 17:20:34-04:00
Modify Date : 2013:04:17 17:20:34-04:00
Trapped : False
PTEX Fullbanner : This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012) kpathsea version 6.1.0