Press-Schechter function in python

  • Context: Python 
  • Thread starter Thread starter mahya
  • Start date Start date
  • Tags Tags
    Function Python
Click For Summary
SUMMARY

The discussion focuses on implementing the Press-Schechter function in Python, requiring inputs for "redshift", a range of "M", and a range of "dn/dM". Key resources include the official Python 3.4 tutorial for foundational programming skills and the Python math library for necessary mathematical functions. Additionally, the Matplotlib library's pyplot module is recommended for graph plotting. These tools will enable users to visualize the Press-Schechter function effectively.

PREREQUISITES
  • Basic understanding of Python programming (Python 3.4)
  • Familiarity with mathematical functions in Python (Python math library)
  • Knowledge of data visualization techniques (Matplotlib pyplot)
  • Concept of the Press-Schechter function in cosmology
NEXT STEPS
  • Explore the official Python 3.4 tutorial for beginners
  • Learn how to use the Python math library, focusing on functions like math.exp() and math.sqrt()
  • Study Matplotlib's pyplot module for creating graphs
  • Research the Press-Schechter function and its applications in cosmology
USEFUL FOR

Beginner programmers, astrophysicists, and data scientists interested in cosmological modeling and visualization using Python.

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.
 
Technology 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
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
Replies
55
Views
7K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 26 ·
Replies
26
Views
3K
  • · Replies 17 ·
Replies
17
Views
3K