GithubHelp home page GithubHelp logo

Comments (5)

scottransom avatar scottransom commented on June 29, 2024

If you have a .pfd file, you can load it in using the prepfold module (into the pfd class). Then you can loop over a range of frequencies using the adjust_fold_frequency() method. That returns the adjusted profiles as well as the reduced chi^2. So then you could plot period (or freq) vs chi^2. Hope that helps.

from presto.

jmohta avatar jmohta commented on June 29, 2024

Thank you for your response. I tried doing the method you mentioned but I am not able to get exact P vs chi^2 graph as in the PFD file. Can I do something like use adjust_period() function to get the profile at desired period value and then calculate chi^2 using calc_redchi2 function? Would this work?

from presto.

scottransom avatar scottransom commented on June 29, 2024

That is basically what the adjust_fold_frequency() method does. How different do the plots look? They should be very similar....

But your method should basically work as well. However, if you want or need the exact curve that prepfold puts out in the .pfd plots, I'd recommend just inserting a printf() line in a for loop in the prepfold_plot.c file so that it prints out the values. Then running show_pfd() on the .pfd file.

from presto.

jmohta avatar jmohta commented on June 29, 2024

In the adjust_fold_frequency() method we need to pass phase bins as one of the parameter to the function. I have only the range of periods. So, in that case what should I pass to the function? I tried once passing directly the period values but I didn't get the desired graph. Then I tried to pass 1/period values to the function then too it doesn't give me the graph. So, how can I convert period values to number of phase bin shift? Thank you for your help.

from presto.

scottransom avatar scottransom commented on June 29, 2024

Since frequency is (by definition) the derivative of phase wrt time, the delta f (i.e. the change in freq) is equal to delta Phase / T, where Phase is the fraction of a rotation (i.e. the number of phase bins to shift / # of phase bins in the profile) and T is the total observation time. The range of frequencies that prepfold searches is usually +/-2*#of phase bins in the profile.

from presto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.