Ask a Question | Search PSRCHIVE: |
Home
|
PSRCHIVE user documentation: psrstatSelecting, configuring, executing, and querying algorithmsSome algorithms can be selected, configured, executed, and queried using syntax that is similar to that used for other variables. (For a complete list, see Configurable Algorithms and Options.)For example, to see the configuration of the algorithms used to identify the on- and off-pulse regions psrstat -c on,off filename[s]The algorithms can also be selected and configured using commands of the following form psrstat -c ALGORITHM=NAME:OPTIONS filename[s]where ALGORITHM is the algorithm to be configured, NAME is any valid algorithm name and OPTIONS is a comma-separated list of options. For example, to set the on-pulse region to all phase bins greater than five sigma above the mean off-pulse noise: psrstat -c on=above:threshold=5 filename[s]To see all available on-pulse identificaiton algorithms and their options, type psrstat -c on=helpThe signal-to-noise ratio estimators typically use their own algorithms to find the on-pulse and off-pulse regions, and some of the signal-to-noise algorithms allow these to be configured. For example, the following psrstat command line does the following:
psrstat -c 'snr=modular:{on=minimum:{find_min=0,smooth:width=0.05}}' -c snr -c snr:on:found filename[s]Instead of working completely on the command line, it is also possible to specify a text file of psrstat commands. For example, the above command line that sets, configures, and queries the signal-to-noise ratio estimator is equivalent to running the following script. #!/usr/bin/env psrstat -C # # snr.psh # # choose the ModularSNR signal-to-noise ratio estimator snr=modular # choose the BaselineWindow on-pulse estimator snr:on=minimum # configure BaselineWindow to search for the maximum snr:on:find_min=0 # set the width of the smoothing window snr:on:smooth:width=0.05%turn # execute the algorithm and print the S/N snr # query the selected range of pulse phase snr:on:foundNote that some flavours of linux do not support command line arguments in the command passed to env. In this case, execute the above script using psrstat -C snr.psh filename[s]The snr.psh script is equivalent to the following C++ code // // snr.cpp // #include "Pulsar/Archive.h" #include "Pulsar/ModularSNR.h" #include "Pulsar/BaselineWindow.h" #include "Pulsar/Smooth.h" #includeThe above code can be compiled and executed as described at How to compile.
|