Python Press-Schechter function in python

  • Thread starter Thread starter mahya
  • Start date Start date
  • Tags Tags
    Function Python
AI Thread Summary
To create a Python program that plots the Press-Schechter function based on inputs of redshift, mass range (M), and dn/dM, beginners should start by familiarizing themselves with Python through the official tutorials available at python.org. Understanding basic Python concepts will be essential for implementing the calculations. The Python math library will be crucial for mathematical operations, specifically functions like math.exp(), math.pi, math.sqrt(), and math.pow(). For graphing the results, utilizing the pyplot module from the Matplotlib library is recommended, as it provides the necessary tools to create and display the graph effectively.
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
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top