PhotGrid
- class pymsg.PhotGrid(file_name, passband_file_name=None)
The PhotGrid class represents a grid of photometric intensity data.
This grid may be used to interpolate the intensity (or related quantities) for a set of atmosphere parameter values.
- __init__(file_name, passband_file_name=None)
- PhotGrid constructor (via loading data from a photgrid file, or
from a specgrid file together with a passband file).
- Parameters
file_name (string) – Name of grid file.
passband_file_name (string) – Name of passband file (if file_name corresponds to a specgrid file)
- Returns
Constructed object.
- Return type
- Raises
FileNotFound – If either file cannot be found.
TypeError – If either file contains an incorrect datatype.
- property rank
Number of dimensions in grid.
- Type
int
- property axis_labels
Atmosphere parameter axis labels.
- Type
list
- property axis_x_min
Atmosphere parameter axis minima.
- Type
dict
- property axis_x_max
Atmosphere parameter axis maxima.
- Type
dict
- property cache_count
Number of nodes currently held in grid cache.
- Type
int
- property cache_limit
Maximum number of nodes to hold in grid cache. Set to 0 to disable caching.
- Type
double
- intensity(x, mu, deriv=None)
Evaluate the photometric intensity, normalized to the zero- point flux.
- Parameters
x (dict) – Atmosphere parameters; keys must match axis_labels property, values must be double.
mu (double) – Cosine of angle of emergence relative to surface normal.
deriv (dict, optional) – Flags indicating whether to evaluate derivative with respect to each atmosphere parameter; keys must match the axis_labels property, values must be boolean.
- Returns
photometric intensity (/sr).
- Return type
double
- Raises
KeyError – If x does not define all keys appearing in the axis_labels property.
ValueError – If x or mu falls outside the bounds of the grid.
LookupError – If x falls in a grid void.
- E_moment(x, k, deriv=None)
Evaluate the photometric intensity E-moment, normalized to the zero-point flux.
- Parameters
x (dict) – Atmosphere parameters; keys must match axis_labels property, values must be double.
k (int) – Degree of moment.
deriv (dict, optional) – Flags indicating whether to evaluate derivative with respect to each atmosphere parameter; keys must match the axis_labels property, values must be boolean.
- Returns
photometric intensity E-moment.
- Return type
double
- Raises
KeyError – If x does not define all keys appearing in the axis_labels property.
ValueError – If x or k falls outside the bounds of the grid.
LookupError – If x falls in a grid void.
- D_moment(x, l, deriv=None)
Evaluate the photometric intensity D-moment, normalized to the zero-point flux.
- Parameters
x (dict) – Atmosphere parameters; keys must match axis_labels property, values must be double.
l (int) – Harmonic degree of moment.
deriv (dict, optional) – Flags indicating whether to evaluate derivative with respect to each atmosphere parameter; keys must match the axis_labels property, values must be boolean.
- Returns
photometric intensity D-moment.
- Return type
double
- Raises
KeyError – If x does not define all keys appearing in the axis_labels property.
ValueError – If x or l falls outside the bounds of the grid.
LookupError – If x falls in a grid void.
- flux(x, deriv=None)
Evaluate the photometric flux, normalized to the zero-point flux.
- Parameters
x (dict) – Atmosphere parameters; keys must match axis_labels property, values must be double.
deriv (dict, optional) – Flags indicating whether to evaluate derivative with respect to each atmosphere parameter; keys must match the axis_labels property, values must be boolean.
- Returns
photometric flux.
- Return type
double
- Raises
KeyError – If x does not define all keys appearing in the axis_labels property.
ValueError – If x or l falls outside the bounds of the grid.
LookupError – If x falls in a grid void.