From Dr Ben Hoyle

Site: PublicCode

Python extracts

Create an array, such that the histogram will have gaussian properties.

import numpy as np import mixture

arr = np.concatenate([np.random.normal(0, 1, [1000]),

                      np.random.normal(6, 2, [2000])])

Save array to file

f = open('output.txt', 'w') f.writelines(["%s\n" % item for item in list])

Open a fits file

import pyfits d = pyfits.open('File.fits') data = d[1].data.field(0)

Create empty array

Size=100 arr=[0.0]*Size

Create IDL indgen() equiv

arr=range(Start,stop)

histograms

import numpy as np h = np.bincount(InputArr,minlength=MaxSizeHist)

Retrieved from http://www.usm.uni-muenchen.de/people/hoyleb/index.php?n=Site.PublicCode
Page last modified on June 14, 2013, at 10:02 AM EST