Blog: Caution with numpy float32 images
There is an interesting thread on the numpy discussion group about an unexpected result of taking the mean (or sum) of a large array of 32-bit floating point numbers. If you exceed the 32-big float precision then you will get the wrong answer on some platforms. Takeaway: use float64 or specify the precision of the accumulator.
Here are some examples:
In [1]: d = np.ones((1000, 1000), dtype ...
Tutorial: Practical Python for Astronomers
Practical Python for Astronomers is a series of hands-on workshops to explore the Python language and the powerful analysis tools it provides. The emphasis is on using Python to solve real-world problems that astronomers are likely to encounter in research.
The workshops immediately make use of the full suite of plotting, analysis, and file reading tools. Along the way elements of the Python language such as data types ...
Resource: python4astronomers
Description: Practical Python for Astronomers
Homepage URL: http://python4astronomers.github.com/
Practical Python for Astronomers is a series of hands-on workshops to explore the Python language and the powerful analysis tools it provides. The emphasis is on using Python to solve real-world problems that astronomers are likely to encounter in research.
The workshops immediately make use of the full suite of plotting, analysis, and file reading tools. Along ...