Skip to content
jessicahunter24 edited this page Apr 2, 2013 · 16 revisions

NumPy is a package of modules for python that provides greater flexibility for arrays, linear algebra functions, and math. Since NumPy arrays are much easier to work with, they are often used in PINSPEC for the user to provide information to a function. Some commonly used formats and functions used in input files for NumPy arrays are given below.

Consider a basic matrix of the structure

A = [ 1. 2. 3.
      4. 5. 6.
      7. 8. 9.]

The numpy equivalent would be:

A=numpy.array([[1.,2.,3.],[4.,5.,6.],[7.,8., 9.])`

To create an array with no specified size:

X=numpy.array([])

To create an array full of zeros of sixe 1x2x3:

X=numpy.zeros((1,2,3))

For further guidance on NumPy, a reference manual for NumPy v1.7 can be found here. For users familiar with MATLAB, guidance on the transition to NumPy can be found here.

Next: Single-Level Breit-Wigner Cross Sections

Return to Creating Input Files

Tutorials

Home

Clone this wiki locally