MOONS Pipeline Reference Manual 0.13.1
Modules | Functions
RBN format

Modules

 RBN_SINGLE format
 

Functions

moo_rbn * moo_rbn_new (void)
 Create a new moo_rbn.
 
moo_rbn * moo_rbn_create (const cpl_frame *frame)
 Create a new empty RBN filename.
 
void moo_rbn_delete (moo_rbn *self)
 Delete a moo_rbn.
 
cpl_error_code moo_rbn_free_single (moo_rbn *self, moo_detector_type type)
 Free the given type part in RBN.
 
cpl_error_code moo_rbn_set_single (moo_rbn *self, moo_rbn_single *single)
 assign moo_rbn_single structure in moo_rbn structure
 
cpl_error_code moo_rbn_add_single (moo_rbn *self, moo_detector_type type, moo_rbn_single *single)
 Add RBN_SINGLE extension to RBN filename and update moo_rbn structure.
 
void moo_rbn_save (moo_rbn *self, const char *filename)
 Save a moo_rbn to a FITS file.
 
cpl_error_code moo_rbn_add_fibre_table (moo_rbn *self, cpl_table *fibre_table)
 Add fibre table to RBN filename and update moo_rbn structure.
 
moo_rbn_single * moo_rbn_get_single (moo_rbn *self, moo_detector_type type)
 Get a RBN single from RBN.
 
moo_rbn_single * moo_rbn_load_single (moo_rbn *self, moo_detector_type type, unsigned int level)
 Load the type part in RBN and return it.
 
cpl_table * moo_rbn_get_fibre_table (moo_rbn *self)
 Get the FIBRE TABLE in RBN.
 
cpl_error_code moo_rbn_compute_snr (moo_rbn *self, moo_sky_lines_list *skylines)
 Compute SNR for targets in RBN.
 
cpl_error_code moo_rbn_dump (const moo_rbn *self, FILE *stream)
 Dump structural information of RBN.
 
cpl_propertylist * moo_rbn_get_primary_header (moo_rbn *self)
 Get the PRIMARY HEADER in RBN.
 

Detailed Description

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

Functionality include:

Synopsis:
#include "moo_rbn.h"

Function Documentation

◆ moo_rbn_add_fibre_table()

cpl_error_code moo_rbn_add_fibre_table ( moo_rbn *  self,
cpl_table *  fibre_table 
)

Add fibre table to RBN filename and update moo_rbn structure.

Parameters
selfmoo_rbn structure to update
fibre_tablefibre table to store on RBN file

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 288 of file moo_rbn.c.

Referenced by moo_rebin().

◆ moo_rbn_add_single()

cpl_error_code moo_rbn_add_single ( moo_rbn *  self,
moo_detector_type  type,
moo_rbn_single *  single 
)

Add RBN_SINGLE extension to RBN filename and update moo_rbn structure.

Parameters
selfmoo_rbn structure to update
typethe detector type (RI, YJ, H)
singlemoo_rbn_single structure
Returns
the relevant error code or CPL_ERROR_NONE

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 226 of file moo_rbn.c.

References moo_rbn_set_single(), and moo_rbn_single_save().

Referenced by moo_rebin().

◆ moo_rbn_compute_snr()

cpl_error_code moo_rbn_compute_snr ( moo_rbn *  self,
moo_sky_lines_list *  skylines 
)

Compute SNR for targets in RBN.

Parameters
self[RBN] the rbn
skylinesSKY_LINE_LIST
Returns
CPL_ERROR_NONE or the relevant cpl_error_code on error

Definition at line 421 of file moo_rbn.c.

References MOO_BADPIX_GOOD, moo_rbn_get_fibre_table(), moo_rbn_load_single(), and moo_rbn_single_compute_snr().

◆ moo_rbn_create()

moo_rbn * moo_rbn_create ( const cpl_frame *  frame)

Create a new empty RBN filename.

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

The returned object must be deallocated using moo_rbn_delete().

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 85 of file moo_rbn.c.

References moo_rbn_new(), moo_rbn_single_create(), MOO_TYPE_H, MOO_TYPE_RI, and MOO_TYPE_YJ.

Referenced by moo_molecfit_calctrans(), and moo_rbnlist_create().

◆ moo_rbn_delete()

void moo_rbn_delete ( moo_rbn *  self)

Delete a moo_rbn.

Parameters
selfmoo_rbn to delete
Returns
void

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

Definition at line 120 of file moo_rbn.c.

References moo_rbn_single_delete().

Referenced by moo_combine_sky(), moo_molecfit_calctrans(), moo_rbnlist_empty(), moo_rbnlist_set(), and moo_rebin().

◆ moo_rbn_dump()

cpl_error_code moo_rbn_dump ( const moo_rbn *  self,
FILE *  stream 
)

Dump structural information of RBN.

Parameters
selfRBN to dump
streamOutput stream, accepts stdout or stderr
Returns
CPL_ERROR_NONE or the relevant cpl_error_code on error

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_FILE_IO if a write operation fails

Definition at line 469 of file moo_rbn.c.

References moo_rbn_single_dump().

◆ moo_rbn_free_single()

cpl_error_code moo_rbn_free_single ( moo_rbn *  self,
moo_detector_type  type 
)

Free the given type part in RBN.

Parameters
selfthe RBN
typethe type of extension to free
Returns
error code or CPL_ERROR_NONE

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 160 of file moo_rbn.c.

References moo_rbn_get_single(), and moo_rbn_single_free().

Referenced by moo_rbnlist_free_single().

◆ moo_rbn_get_fibre_table()

cpl_table * moo_rbn_get_fibre_table ( moo_rbn *  self)

Get the FIBRE TABLE in RBN.

Parameters
selfthe RBN
Returns
The FIBRE TABLE

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 397 of file moo_rbn.c.

Referenced by moo_calib_flux(), moo_combine_sky(), moo_correct_tell(), moo_molecfit_calctrans(), moo_rbn_compute_snr(), moo_sub_sky_stare(), moo_target_table_select_sky_index(), and moo_telluric_create_from_rbn().

◆ moo_rbn_get_primary_header()

cpl_propertylist * moo_rbn_get_primary_header ( moo_rbn *  self)

Get the PRIMARY HEADER in RBN.

Parameters
selfthe RBN
Returns
The PRIMARY_HEADER

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 512 of file moo_rbn.c.

Referenced by moo_calib_flux(), and moo_correct_tell().

◆ moo_rbn_get_single()

moo_rbn_single * moo_rbn_get_single ( moo_rbn *  self,
moo_detector_type  type 
)

Get a RBN single from RBN.

Parameters
selfmoo_rbn structure to read
typetype of detector
Returns
RBN_SINGLE

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 325 of file moo_rbn.c.

References MOO_TYPE_H, MOO_TYPE_RI, and MOO_TYPE_YJ.

Referenced by moo_molecfit_calctrans(), moo_rbn_free_single(), moo_rbnlist_get_image(), moo_rbnlist_get_single_data(), moo_rbnlist_get_single_qual(), and moo_sub_sky_stare().

◆ moo_rbn_load_single()

moo_rbn_single * moo_rbn_load_single ( moo_rbn *  self,
moo_detector_type  type,
unsigned int  level 
)

Load the type part in RBN and return it.

Parameters
selfthe RBN
typethe type of extension to load
levelthe bad pixel level
Returns
the moo_rbn_single corresponding to the type or NULL

Possible error code :

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 360 of file moo_rbn.c.

References moo_rbn_single_load(), MOO_TYPE_H, MOO_TYPE_RI, and MOO_TYPE_YJ.

Referenced by moo_calib_flux(), moo_correct_tell(), moo_rbn_compute_snr(), moo_rbnlist_load_single(), moo_sub_sky_stare(), and moo_telluric_create_from_rbn().

◆ moo_rbn_new()

moo_rbn * moo_rbn_new ( void  )

Create a new moo_rbn.

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

The returned object must be deallocated using moo_rbn_delete().

Definition at line 67 of file moo_rbn.c.

Referenced by moo_combine_sky(), moo_rbn_create(), and moo_rebin().

◆ moo_rbn_save()

void moo_rbn_save ( moo_rbn *  self,
const char *  filename 
)

Save a moo_rbn to a FITS file.

Parameters
selfmoo_rbn 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_rbn to a FITS file, using cfitsio. Only not NULL extensions are written.

Definition at line 259 of file moo_rbn.c.

References moo_rbn_single_save(), MOO_TYPE_H, MOO_TYPE_RI, and MOO_TYPE_YJ.

Referenced by moo_products_add_rbn().

◆ moo_rbn_set_single()

cpl_error_code moo_rbn_set_single ( moo_rbn *  self,
moo_rbn_single *  single 
)

assign moo_rbn_single structure in moo_rbn structure

Parameters
selfmoo_rbn structure to update
singlemoo_rbn_single structure

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 184 of file moo_rbn.c.

References MOO_TYPE_H, MOO_TYPE_RI, and MOO_TYPE_YJ.

Referenced by moo_rbn_add_single().