Press-Schechter function in python

  • Context: Python 
  • Thread starter Thread starter mahya
  • Start date Start date
  • Tags Tags
    Function Python
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 3K views
mahya
Messages
7
Reaction score
0
I want to write program in python that gives "redshift", range of "M" and range of "dn/dM" as input and plots "Press-Schechter" function and delivers a graph as output. would you please give some hints? I'm beginner in programming and I don't know how to start.
 
Physics news on Phys.org
mahya said:
I want to write program in python that gives "redshift", range of "M" and range of "dn/dM" as input and plots "Press-Schechter" function and delivers a graph as output. would you please give some hints? I'm beginner in programming and I don't know how to start.
A good place to start learning Python would probably be the tutorials over at python.org, for example:
https://docs.python.org/3.4/tutorial/introduction.html

The full tutorial can be found here:
https://docs.python.org/3.4/tutorial/index.html

If you can get some understanding of python, when it's time to do the calculation you'll probably need to make use of the Python math library:
https://docs.python.org/3.4/library/math.html

In particular you'll have to use math.exp(), math.pi, math.sqrt(), and math.pow().

To display the graph, try making use of pyplot:
http://matplotlib.org/api/pyplot_api.html