Physical Constants

platform:Unix, Windows, Mac
synopsis:A set of physical constants that can be used by a bunch of different programs.
Variable Name Description
v_C_0 Speed of light m/s.
v_Boltz Boltzmans Const. J/K.
v_me Mass of electron in kg
v_amu Mass of proton/neutron in kg.
v_electronradius Electron radius in m.
v_electron_rcs Cross section of electon m^2.
v_epsilon0 Vacuum permittivity.
v_mu0 Vacuum permeability.
v_elemcharge Elementary charge in mks units
v_elemcharge_cgs Elementary charge in cgs units.
R_EARTH Radius of earth in km.

Math Utilities

This is a set of math utility functions that can be used for ISR.

platform:Unix, Windows, Mac
synopsis:This module has various math functions that are not included in scipy or numpy.
mathutils.angles2xy(az, el)

Creates x and y coordinates from az and el arrays.

This function will take a numpy array of az and elevation angles in degrees and create the x, y locations projected on to the z=0 plane. It is assumed that the elevation angle is mesured from the z=0 plane. The az angle is from x=0 and goes clockwise.

Parameters:
  • az (numpy array) – Azimuth angles in degrees.
  • el (numpy array) – Elevation angles in degrees.
Returns:

(xout (numpy array), yout (numpy array)) – x and y coordinates.

mathutils.array2cart(Az, El)
This function will turn azimuth and elevation angles to X, Y and Z coordinates
assuming a unit sphere.
Parameters:
  • Az (numpy array) – Azimuth angles in degrees.
  • El (numpy array) – Elevation angles in degrees.
Returns:

(X (numpy array), Y (numpy array), Z (numpy array)) – x, y and z coordinates.

mathutils.cart2array(X, Y, Z)
This function will turn the X, Y and Z coordinate to azimuth and elevation angles
assuming a unit sphere.
Parameters:
  • X (numpy array) – x coordinates.
  • Y (numpy array) – y coordinates.
  • Z (numpy array) – z coordinates.
Returns:

(Az (numpy array), El (numpy array)) – Azimuth and elevation angles in degrees.

mathutils.chirpz(Xn, A, W, M)

Chirpz calculation for a single array.

This function calculates the chirpz transfrom for the numpy array Xn given the complex constants A and W along with the length of the final array M.

Parameters:
  • Xn (numpy array) – The signal that the Chirp z transform will be calculated for.
  • A (complex) – A complex constant used to determine the direction of the integration in Z.
  • W (complex) – Another complex constant that will determine the direction of the integration in Z.
  • M (int) – The length of the final chirpz transfrom.
Returns:

yk (numpy array) – The M length chirp z tranfrom given Xn and the complex constants.

mathutils.diric(x, n)

Based on octave-signal v. 1.10 diric. Jitted for up to 2x speedup in this case, and demo of Numba 0.17

Authors:Michael Hirsch
mathutils.jinc

This will output a jinc function.

Parameters:t (numpy array) – Time array in seconds.
Returns:outdata (numpy array) – Jinc(t)
mathutils.rotcoords(Az, El, Az_0, El_0)

Applies rotation matrix to Az and El arrays.

This function will rotate the Az and Elevation cordinates given offset angles. This will use a rotation matrix after the angles have been changed to Cartisian coordinates assuming a unit sphere.

Parameters:
  • Az (numpy array) – Azimuth angles in degrees.
  • El (numpy array) – Elevation angles in degrees.
  • Az_0 (float) – The azimuth rotation angle in degrees.
  • El_0 (float) – The elevation rotation angle in degrees.
Returns:

(Az_out (numpy array), El_out (numpy array)) – Rotated azimuth and elevation angles in degrees.

mathutils.rotmatrix(Az_0, El_0)

Makes a rotation matrix.

This creates a rotation matrix for the rotcoords function. First rotate about the z axis and then rotate about the new y axis http://www.agi.com/resources/help/online/stk/11.0/index.htm#comm/CommRadar03-03.htm

Parameters:
  • Az_0 (float) – The azimuth rotation angle in degrees.
  • El_0 (float) – The elevation rotation angle in degrees.
Returns:

rotmat (numpy array) – A 3x3 rotation matrix.

mathutils.sommerfeldchirpz(func, N, M, dk, Lmax=1, errF=0.1, a=-1j, p=1.0, x0=None, exparams=())

Numerically integrate Sommerfeld like integral using chirpz.

This function will numerically integrate a Sommerfeld like integral, int(exp(awk)f(k),t=0..inf) using at most Lmax number of N length chirpz transforms to make an M length array. If the normalized difference between the previous estimate of the output Xk is less then the parameter errF then the loop stops and a flag that represents convergence is set to true. A number of repeats are also output as well. This technique is based off the article Li et. al Adaptive evaluation of the Sommerfeld-type integral using the chirp z-transform, 1991. This function also uses a modified Simpsons rule for integration found in Milla PhD Thesis (2010).

Parameters:
  • func (func) – A function that is used to create f(k).
  • N (int) – The length of the chirp z transform used.
  • M (int) – The length of the output array.
  • dk (float) – The sample period of k.
  • Lmax (int, optional) – default 1, The maximum number of repeats of the integration before the loop finishes.
  • errF (float, optional) – default .1, The threshold of the normalized difference between the new iteration and the old to stop to stop the iteration.
  • a (complex, optional) – default -1.0*1j, A complex number that determines the trejectory of the integration on the z plane.
  • p (float, optional) – default 1.0, A real number that helps to define the spacing on the omega plane.
  • x0 (complex, optional) – default p*np.pi/dk, The starting point on the omega plane.
  • exparams (tuple, optional) – default (), Any extra params other then k to create f(k).
Returns:

(Xk (numpy array),flag_c (bool),irep (int)) – The integrated data that is of length M. A convergence flag. The number of repetitions until convergence.

mathutils.sommerfelderf(func, N, omega, a, b, exparams=())

Integrate somerfeld integral using ERF transform for single portion.

This function will numerically integrate a Sommerfeld like integral, int(exp(-jwk)f(k),k=a..b) using the ERF transform and 2N+1 samples. This technique is from the paper B. L. Ooi 2007.

Parameters:
  • func (func) – A function that is used to create f(k).
  • N (int) – The integration uses 2N+1 samples to do the integration.
  • omega – The Frequency array in radians per second.
  • a (float) – Lower bound of the integral.
  • b (float) – Upper bound of teh integral.
  • exparams (tuple, optional) – default (), Any extra params other then k to create f(k).
Returns:

Xk (numpy array) – The integrated data that is the same length as omega.

mathutils.sommerfelderfrep(func, N, omega, b1, Lmax=1, errF=0.1, exparams=())

Numerically integrate Sommerfeld like integral using erf transform function loop.

This function will numerically integrate a Sommerfeld like integral, int(exp(-jwk)f(k),k=0..inf) using the ERF transform and 2N+1 samples and at most Lmax loops. If the normalized difference between the previous estimate of the output Xk is less then the parameter errF then the loop stops and a flag that represents convergence is set to true. A number of loops is also output as well. This function uses sommerfelderf to do the integration

Parameters:
  • func (func) – A function that is used to create f(k).
  • N (int) – The integration uses 2N+1 samples to do the integration.
  • omega (float) – The Frequency array in radians per second.
  • b1 (int) – The inital bounds of the first try and then step size for each subsiquent integral.
  • Lmax (int, optional) – default 1, The maximum number of repeats of the integration before the loop finishes.
  • errF (float, optional) – default .1, The threshold of the normalized difference between the new iteration and the old to stop to stop the iteration.
  • exparams (tuple, optional) – default (), Any extra params other then k to create f(k).
Returns:

(Xk (numpy array),flag_c (bool),irep (int)) – The integrated data that is of length M. A convergence flag. The number of repetitions until convergence.

Sensor Constants

This will create a set of sensor constants depending on an input string.

platform:Unix, Windows, Mac
synopsis:Gets a ISR sensor constants and calculates theoretical beam patterns.
sensorConstants.AMISR_Pattern(AZ, EL, Az0, El0)

Returns the AMISR pattern in the direction of the array face.

This function will create an idealized antenna pattern for the AMISR array. The pattern is not normalized. The antenna is assumed to made of a grid of ideal cross dipole elements. In the array every other column is shifted by 1/2 dy. The parameters are taken from the AMISR spec and the method for calculating the field is derived from a report by Adam R. Wichman. The inputs for the az and el coordinates can be either an array or scalar. If both are arrays they must be the same shape.

Parameters:
  • Az (numpy array) – Azimuth angles in degrees.
  • El (numpy array) – Elevation angles in degrees.
  • Az_0 (float) – The azimuth pointing angle in degrees.
  • El_0 (float) – The elevation pointing angle in degrees.
Returns:

Patout (numpy array) – The normalized radiation density.

sensorConstants.AMISR_Patternadj(Az, El, Az0, El0, Angleoffset)

This function will call AMISR beam patern function after it rotates the coordinates given the offset of the phased array.

Parameters:
  • Az (numpy array) – Azimuth angles in degrees.
  • El (numpy array) – Elevation angles in degrees.
  • Az_0 (float) – The azimuth pointing angle in degrees.
  • El_0 (float) – The elevation pointing angle in degrees.
  • Angleoffset (list) – A 2 element list holding the offset of the face of the array from north.
Returns:

Beam_Pattern (numpy array) – The relative beam pattern from the azimuth points.

sensorConstants.Circ_Ant_Pattern(EL, r, lamb)

Returns the pattern for a circular dish antenna.

This function will create an idealized antenna pattern for a circular antenna array. The pattern is not normalized. The antenna is assumed to made of a grid of ideal cross dipole elements. In the array every other column is shifted by 1/2 dy. The parameters are taken from the AMISR spec and the method for calculating the field is derived from a report by Adam R. Wichman. The inputs for the az and el coordinates can be either an array or scalar. If both are arrays they must be the same shape.

Parameters:
  • EL (numpy array) – The elevation coordinates in radians. Vertical is at zero radians.
  • r (float) – Radius of the antenna in meters.
  • lamb (float) – wavelength of radiation in meters.
Returns:

Patout (numpy array) – The normalized radiation density.

sensorConstants.Millstone_Pattern(Az, El, Az0, El0, Angleoffset)

Gives the ideal antenna pattern for the MISA dish at Milstone hill.

This function will call circular antenna beam patern function after it rotates the coordinates given the pointing direction.

Parameters:
  • Az (numpy array) – Azimuth angles in degrees.
  • El (numpy array) – Elevation angles in degrees.
  • Az_0 (float) – The azimuth pointing angle in degrees.
  • El_0 (float) – The elevation pointing angle in degrees.
  • Angleoffset (list) – A 2 element list holding the offset of the face of the array from north.
Returns:

Beam_Pattern (numpy array) – The relative beam pattern from the azimuth points.

sensorConstants.Sond_Pattern(Az, El, Az0, El0, Angleoffset)

Gives the ideal antenna pattern for the Sondestrom radar.

This function will call circular antenna beam patern function after it rotates the coordinates given the pointing direction.

Parameters:
  • Az (numpy array) – Azimuth angles in degrees.
  • El (numpy array) – Elevation angles in degrees.
  • Az_0 (float) – The azimuth pointing angle in degrees.
  • El_0 (float) – The elevation pointing angle in degrees.
  • Angleoffset (list) – A 2 element list holding the offset of the face of the array from north.
Returns:

Beam_Pattern (numpy array) – The relative beam pattern from the azimuth points.

sensorConstants.getConst(typestr, angles=None)

Get the constants associated with a specific radar system. This will fill out a dictionary with all of the parameters.

Parameters:
  • type (str) – Name of the radar system.
  • angles (numpy array) – Nx2 array where each row is an az, el pair in degrees.
Returns:

sensdict (dict[str, obj])

Holds the different sensor constants.:

{
        'Name': radar name,
        'Pt': Transmit power in W,
        'k': wave number in rad/m,
        'lamb': Wave length in m,
        'fc': Carrier Frequency in Hz,
        'fs': Sampling frequency in Hz,
        'taurg': Pulse length number of samples,
        'Tsys': System Temperature in K,
        'BeamWidth': Tuple of beamwidths in degrees,
        'Ksys': ,
        'BandWidth': Filter bandwidth in Hz,
        'Angleoffset': Tuple of angle offset,
        'ArrayFunc': Function to calculate antenna pattern,
        't_s': Sampling time in s
}

sensorConstants.get_files(fname)

Gets the hdf5 files associated with the radar.

Parameters:fname (str) – Name for the radar.
Returns:newpath (str) – String holding the location for the file.