scottransom / presto

Open source pulsar search and analysis toolkit
http://www.cv.nrao.edu/~sransom/presto/
GNU General Public License v2.0
237 stars 176 forks source link

PFD file format? #183

Open indrajitbarve opened 1 year ago

indrajitbarve commented 1 year ago

Dear Scott ransom,

I would like to plot the .pfd profs cube data. Able to read the data but while plotting not able to get the plot like .ps file it generates. Can you please share the data format or what additional information (scalling) needed to plot the data.

scottransom commented 1 year ago

If you want to regenerate the original .ps plot, you can use the show_pfd command on the .pfd file. There are several options that let you (slightly) modify the plot. You can also read the .pfd and plot it any way you want with the prepfold.py python module that is included in PRESTO. Let me know if you need more specifics.

scottransom commented 1 year ago

BTW, the .pfd file itself is simply a C structure (of type PREPFOLDINFO) stored in binary format. Most of it is described in the header file include/prepfold.h. And you can see how it gets written and read in src/prepfold_utils.h

indrajitbarve commented 1 year ago

Dear Scott Ransom,

Thanks for your reply, I am able to read the data from the struct data cube from the "profs" section. The only thing is I am trying to plot a few selected data bands from the cube. When I plot it is not able to replica the plot. So I found from the pfd plotting code some scaling and shifting happening. I will go through the prepfold_utils.h further. Thanks ..

scottransom commented 1 year ago

Note that in prepfold.py, there is a greyscale() method which uses the same scaling as in the prepfold plots. And there are also plot_intervals() and plot_subbands() methods which use the greyscale() method.