PhotGrid Functions

void load_photgrid(const char *photgrid_file_name, PhotGrid *photgrid, int *stat)

Create a new PhotGrid by loading data from a photgrid file.

Parameters
  • photgrid_file_name – Name of the photgrid file.

  • photgrid – Returned grid object.

  • stat – Returned status code.

void load_photgrid_from_specgrid(const char *specgrid_file_name, const char *passband_file_name, PhotGrid *photgrid, int *stat)

Create a new PhotGrid by loading data from a specgrid file, and convolving on-the-fly with a passband response function also loaded from file.

Parameters
  • specgrid_file_name – Name of the specgrid file.

  • passband_file_name – Name of the passband file.

  • photgrid – Returned grid object.

  • stat – Returned status code.

void unload_photgrid(PhotGrid photgrid)

Unload a photometric grid, freeing up memory.

Parameters
  • photgrid – Grid object.

void get_photgrid_rank(Photgrid photgrid, int *rank)

Get the rank (dimension) of the grid.

Parameters
  • photgrid – Grid object.

  • rank – Returned rank.

void get_photgrid_cache_count(Photgrid photgrid, int *cache_count)

Get the number of nodes currently held in the grid cache.

Parameters
  • photgrid – Grid object.

  • ceche_count – Returned number of nodes.

void get_photgrid_cache_limit(Photgrid photgrid, int *cache_limit)

Get the maximum number of nodes to hold in the grid cache.

Parameters
  • photgrid – Grid object.

  • cache_limit – Returned maximum number of nodes.

void get_photgrid_axis_x_min(Photgrid photgrid, int i, double *x_min)

Get the minimum value of the i’th grid axis.

Parameters
  • photgrid – Grid object.

  • i – Axis index (beginning at 0).

  • x_min – Returned minimum value.

void get_photgrid_axis_x_max(Photgrid photgrid, int i, double *x_max)

Get the maximum value of the i’th grid axis.

Parameters
  • photgrid – Grid object.

  • i – Axis index (beginning at 0).

  • x_max – Returned maximum value.

void get_photgrid_axis_label(SpecGrid specgrid, int i, char *label)

Get the label of the i’th grid axis.

Parameters
  • photgrid – Grid object.

  • i – Index of the label (beginning at 0).

  • axis_label – Buffer to store axis label buffer (at least 17 bytes, to accomodate label plus null terminator).

void set_photgrid_cache_limit(Photgrid photgrid, int cache_limit, int *stat)

Set the maximum number of notes to hold in the grid cache. Set to 0 to disable caching.

Parameters
  • photgrid – Grid object.

  • cache_limit – Maximum number of nodes.

  • stat – Returned status code (set to NULL if not required).

void interp_photgrid_intensity(PhotGrid photgrid, double x_vec[], double mu, double *I, int *stat, bool deriv_vec[])

Interpolate the photometric intensity, normalized to the zero-point flux.

Parameters
  • photgrid – Grid object.

  • x_vec – Atmospheric parameter values.

  • mu – Cosine of angle of emergence relative to surface normal.

  • I – Returned photometric intensity (/sr).

  • stat – Returned status code (set to NULL if not required).

  • deriv_vec – Derivative flags (set to NULL if not required).

void interp_photgrid_E_moment(PhotGrid photgrid, double x_vec[], int k, double *E, int *stat, bool deriv_vec[])

Interpolate the photometric intensity E-moment, normalized to the zero-point flux.

Parameters
  • photgrid – Grid object.

  • x_vec – Atmospheric parameter values.

  • k – Degree of moment.

  • D – Returned photometric intensity E-moment.

  • stat – Returned status code (set to NULL if not required).

  • deriv_vec – Derivative flags (set to NULL if not required).

void interp_photgrid_D_moment(PhotGrid photgrid, double x_vec[], int l, double *D, int *stat, bool deriv_vec[])

Interpolate the photometric intensity D-moment, normalized to the zero-point flux.

Parameters
  • photgrid – Grid object.

  • x_vec – Atmospheric parameter values.

  • l – Harmonic degree of moment.

  • D – Returned photometric intensity D-moment.

  • stat – Returned status code (set to NULL if not required).

  • deriv_vec – Derivative flags (set to NULL if not required).

void interp_photgrid_flux(PhotGrid photgrid, double x_vec[], double *F, int *stat, bool deriv_vec[])

Interpolate the photometric flux, normalized to the zero-point flux.

Parameters
  • PhotGrid – Grid object.

  • x_vec – Atmospheric parameter values.

  • F – Returned photometric flux.

  • stat – Returned status code (set to NULL if not required).

  • deriv_vec – Derivative flags (set to NULL if not required).