MOONS Pipeline Reference Manual 0.13.2
Functions
BPM format

Functions

moo_bpm * moo_bpm_new (void)
 Create a new moo_bpm.
 
cpl_error_code moo_bpm_set_data (moo_bpm *self, moo_detector_type type, int ntas, cpl_image *data, cpl_propertylist *header)
 set bpm data for relevant extension
 
cpl_error_code moo_bpm_add_data (moo_bpm *self, cpl_image *img, moo_detector_type type, int ntas)
 Add CPL_IMAGE extension to BPM filename and update moo_bpm structure.
 
cpl_error_code moo_bpm_merge (moo_bpm *a, moo_bpm *b)
 Merge to moo_bpm structure in the first.
 
void moo_bpm_save (moo_bpm *self, const char *filename)
 Save a moo_bpm to a FITS file.
 
void moo_bpm_delete (moo_bpm *self)
 Delete a moo_bpm.
 

Detailed Description

This module provides functions to create, use, and destroy a moo_bpm

Functionality include:

Synopsis:
#include "moo_bpm.h"

Function Documentation

◆ moo_bpm_add_data()

cpl_error_code moo_bpm_add_data ( moo_bpm *  self,
cpl_image *  img,
moo_detector_type  type,
int  ntas 
)

Add CPL_IMAGE extension to BPM filename and update moo_bpm structure.

Parameters
selfmoo_bpm structure to update
imgCPL_IMAGE extension to store
typetype of detector
ntasnumber of spectrographs

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 113 of file moo_bpm.c.

References moo_bpm_set_data(), and moo_detector_get_extname().

◆ moo_bpm_delete()

void moo_bpm_delete ( moo_bpm *  self)

Delete a moo_bpm.

Parameters
selfmoo_bpm to delete
Returns
void

If the moo_map self is NULL, nothing is done and no error is set.

Definition at line 213 of file moo_bpm.c.

◆ moo_bpm_merge()

cpl_error_code moo_bpm_merge ( moo_bpm *  a,
moo_bpm *  b 
)

Merge to moo_bpm structure in the first.

Parameters
amoo_bpm structure which contains the result
bmoo_bpm structure to merge

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 158 of file moo_bpm.c.

◆ moo_bpm_new()

moo_bpm * moo_bpm_new ( void  )

Create a new moo_bpm.

Returns
1 newly allocated moo_bpm or NULL in case of an error

The returned object must be deallocated using moo_bpm_delete().

Definition at line 66 of file moo_bpm.c.

◆ moo_bpm_save()

void moo_bpm_save ( moo_bpm *  self,
const char *  filename 
)

Save a moo_bpm to a FITS file.

Parameters
selfmoo_bpm to write to disk or NULL
filenameName of the file to write
Returns
CPL_ERROR_NONE or the relevant cpl_error_code on error

This function saves a moo_bpm to a FITS file, using cfitsio. Only not NULL extensions are written.

Definition at line 186 of file moo_bpm.c.

References moo_detector_get_extname(), and moo_fits_write_extension_image().

Referenced by moo_products_add_bpm().

◆ moo_bpm_set_data()

cpl_error_code moo_bpm_set_data ( moo_bpm *  self,
moo_detector_type  type,
int  ntas,
cpl_image *  data,
cpl_propertylist *  header 
)

set bpm data for relevant extension

Parameters
self
typethe detector type
ntasnumber of TAS
datathe bpm data
headerthe bpm header
Returns
error code

Definition at line 85 of file moo_bpm.c.

Referenced by moo_bpm_add_data().