DMX Class¶
The DMX class handles pulsar DMX files as output by tempo and dmxparse.py.
Usage:
d = DMX(FILENAME) #automatically parses each DM line with the DM() class
print d.DMs[0].getMJD() #prints the MJD of the first DM value.
print d.getMJDs() #prints the values of all of the epochs.
Methods¶
Warning
save()
is currently not fully implemented
-
getMJDs
()¶ Return the MJD of each DM value. Loops over
getEpoch()
inDM
.Return type: numpy.ndarray
-
getEpochs
()¶ Return the MJD of each DM value. Loops over
getEpoch()
inDM
.Return type: numpy.ndarray
-
getValues
()¶ Return each DM value. Loops over
getValue()
inDM
.Return type: numpy.ndarray
-
getErrs
()¶ Return the DM uncertainties for each measurement. Loops over
getError()
inDM
.Return type: numpy.ndarray
-
getErrors
()¶ Return the DM uncertainties for each measurement. Loops over
getError()
inDM
.Return type: numpy.ndarray
-
getR1s
()¶ Return the R1 values for each measurement, the starting MJD for the bin. Loops over
getR1()
inDM
.Return type: numpy.ndarray
-
getR2s
()¶ Return the R2 values for each measurement, the ending MJD for the bin. Loops over
getR2()
inDM
.Return type: numpy.ndarray
-
getF1s
()¶ Return the F1 values for each measurement, the lowest frequency for the bin. Loops over
getF1()
inDM
.Return type: numpy.ndarray
-
getF2s
()¶ Return the F2 values for each measurement, the highest frequency for the bin. Loops over
getF2()
inDM
.Return type: numpy.ndarray
-
getBin
()¶ Return the bin string label. Loops over
getDMXbin()
inDM
.Return type: numpy.ndarray
-
getDMXbin
()¶ Return the bin string label. Loops over
getDMXbin()
inDM
.Return type: numpy.ndarray
-
getter
(func)¶ Generic helper function to loop over each DM value. Used internally, though hypothetically one could apply additional operations on each DM value
Parameters: func (function) – Function to call on each DM value Return type: nump.ndarray
-
getDMseries
()¶ Return a tuple of the DM time series (times, DMs, DM errors). DMs are calculated as the DMX model plus the DM parameter (the fiducial value).
Returns: times (numpy.ndarray), DM (numpy.ndarray), DM errors (numpy.ndarray)
DM Class¶
The DM class handles individual pulsar DMX measurements.
-
class
DM
(epoch[, value=None, err=None, R1=None, R2=None, F1=None, F2=None, dmxbin=None])¶ Stores the entries of a DM line.
Parameters: - epoch (float/str) – If only the epoch parameter is specified, then the parameter is the entire DM string and will be parsed.
- value (float) – DM value.
- err (float) – DM error
- R1 (float) – R1, starting MJD for the bin
- R2 (float) – R2, ending MJD for the bin
- F1 (float) – F1, lowest frequency for the bin
- F2 (float) – F2, highest frequency for the bin
- dmxbin (str) – bin label
Methods¶
-
getBin
() Return the label of the bin.
Return type: str
-
getDMXbin
() Return the label of the bin.
Return type: str
-
setMJD
(epoch)¶ Set the epoch of the DM to a value.
Parameters: epoch (float) – Value to set the DM epoch to.
-
setEpoch
(epoch)¶ Set the epoch of the DM to a value.
Parameters: epoch (float) – Value to set the DM epoch to.
-
setDM
(value)¶ Set the epoch of the DM to a value.
Parameters: value (float) – Value to set the DM to.
-
setValue
(value)¶ Set the epoch of the DM to a value.
Parameters: value (float) – Value to set the DM to.
-
setErr
(err)¶ Set the error of the DM to a value.
Parameters: err (float) – Value to set the error to.
-
setError
(err)¶ Set the error of the DM to a value.
Parameters: err (float) – Value to set the error to.