Practical Python Programming for Astronomers
Description of the course
- Intensitve course on practical Python programming for master students
- Offered from late-July to mid-August
- Schedule
- 14:00-16:00 on 29/Jul/2019
- 14:00-16:00 on 31/Jul/2019
- 14:00-16:00 on 02/Aug/2019
- 14:00-16:00 on 13/Aug/2019
- 14:00-16:00 on 16/Aug/2019
- 10:00-12:00 on 19/Aug/2019
- 14:00-16:00 on 23/Aug/2019
- Participants need to bring a computer.
- Python used for this course: Python 3
- External Python modules used for this course:
Exercises
- Exercise #1
- making a simple Python script
- executing a Python script
- doing simple calculations using Python
- using math module of Python
- making and using your own function
- using command-line arguments
- using argparse module to analyse command-line arguments
- Exercise #2
- using control flow statements “if”, “elif”, and “else”
- using control flow statement “for”
- using control flow statement “while”
- using control flow statement “continue”
- using control flow statement “break”
- using lists
- using dictionaries
- reading a file
- writing a file
- Exercise #3
- manipulating strings
- making and using your own module
- playing with Hipparcos catalogue
- downloading Hipparcos catalogue
- reading Hipparcos catalogue
- calculating absolute magnitudes of B-type main-sequence stars
- calculating a mean
- calculating a standard deviation
- calculating mean absolute magnitude of B, A, F, G, K, and M dwarfs
- Exercise #4
- installation of Numpy
- using ndarray of Numpy
- basic operations of Numpy
- Exercise #5
- installation of Matplotlib
- using Matplotlib
- Exercise #6
- random numbers
- numerical integrations
- Exercise #7
- least-squares fitting
- degree of freedom, reduced chi-squares, covariance matrix
- weighted least-squares fitting
- orthogonal distance regression
- age of solar system
Kinoshita Daisuke