Package: Geocentric TOA Tools (GeoTOA) Authors: Matthew Kerr and Paul Ray Version: 2.0 Date: 2022 January 11 *** NOTICE *** This code is provided as contributed code in hopes that it will be helpful. The authors do not warrant that the code is bug free, or even correct. E-mail questions and requests are welcomed, but support can only be provided on a time-available basis. PREREQUISITES: * Fermitools software , version 2.0.8 or later (Python 3 version) * Tempo2 software installed * A version of python with numpy, matplotlib and scipy installed. INSTALLATION: * Unpack the .tgz file. This will make a directory called GeoTOA with two subdirectories (bin and python) * Add the bin directory to your path * Add the python directory to your PYTHONPATH, typically like this: setenv PYTHONPATH /GeoTOA-2.0/python:$PYTHONPATH DESCRIPTION OF CODES: * upolyfold.py computes TOAs from unbinned LAT data (a photon, or 'FT1' file) using the maximum likelihood methods described in Ray et al. (2011, ApJS, 194, 17). * itemplate.py generates a template for use with upolyfold.py USAGE: * Make sure you have a photon event file corresponding to the energy and angle cuts that maximize the S/N for your pulsar, extracted from the FSSC archive, and the spacecraft file that covers the same time range * You also need a .par file with a timing model for your pulsar that works at least well enough that you can fold the pulsar without losing phase count. * Use tempo2 -gr fermi to add a PULSE_PHASE column to your photon file. To use Tempo2 to do this you MUST use the raw (NOT barycentered or geocentered) photon event file. * Next, use itemplate.py to generate a template profile for your timing. Just run "itemplate.py my_photon_file.fits" and tell it you want a gaussian template. Then draw in some gaussian components by clicking and dragging your mouse across the FWHM of each visible component. Close the window and itemplate will do an unbinned fit to the model. Then give it a file name to write out your template (for example "template.gauss") * Now, to generate TOAs, you need a photon file with geocentered times. Generate this using "gtbary -tcorrect=GEO". Give the output file a name that indicated it contains geocentered data, so you don't get confused! * Type upolyfold.py -h and read about the options! * Then, to create TOAs using upolyfold.py, use a command like this: % upolyfold.py -r -n 32 -t template.3gauss J1231-1411_1.0Deg_239557517_361106549MET_350_300000MeV_z100_GEO.fits J1231-1411.par This will create 32 TOAs from your photon file using the template called "template.3gauss". The folding will be done with polycos generated from "J1231-1411.par". The polycos get stored in polyco_new.dat. If you want to reuse that file without recomputing it, just leave the "-r" off the command line. This CAN BE UNSAFE because if you have changed the par file in the meantime, the polycos will be old. Be careful! You can also add "-o outfile.tim" to write the TOAs to an output file. Each TOA is comments with the number of photons that went into that TOA ("-np #") and also the probability that the observed photon distribution in that TOA's data came from a uniform (unpulsed) sources. These can be helpful diagnostics of whether a TOA is good. You can then run tempo2 to refine the parameters of your timing model: % tempo -gr plk -f J1231-1411.par outfile.tim Good Luck! -- Paul