MOONS Pipeline Reference Manual 0.13.2
Functions
RBN_SINGLE format

Functions

moo_rbn_single * moo_rbn_single_new (moo_detector_type type)
 Create a new moo_rbn_single.
 
void moo_rbn_single_delete (moo_rbn_single *self)
 Delete a moo_rbn_single.
 
moo_rbn_single * moo_rbn_single_create (const char *filename, moo_detector_type type)
 Create a new moo_rbn_single with the given filename and type.
 
void moo_rbn_single_save (const moo_rbn_single *self, const char *filename, moo_detector_type type)
 Save a moo_rbn_single to a FITS file.
 
cpl_error_code moo_rbn_single_set_wcs1 (moo_rbn_single *self, double crpix1, double crval1, double cd1_1, const char *ctype1, const char *cunit1)
 Set the WCS1 of the extension.
 
hdrl_image * moo_rbn_single_get_image (moo_rbn_single *self)
 Get image of RBN_SINGLE.
 
cpl_image * moo_rbn_single_get_data (moo_rbn_single *self)
 Get image of data.
 
cpl_image * moo_rbn_single_get_errs (moo_rbn_single *self)
 Get image of errs.
 
cpl_image * moo_rbn_single_get_qual (moo_rbn_single *self)
 Get image of qual.
 
cpl_propertylist * moo_rbn_single_get_header (moo_rbn_single *self)
 Get header of rbn single.
 
cpl_error_code moo_rbn_single_load (moo_rbn_single *self, unsigned int level)
 load the data of a moo_rbn_single
 
double moo_rbn_single_compute_snr (moo_rbn_single *self, int rbn_idx, moo_sky_lines_list *skylines)
 Compute SNR for a given target.
 
cpl_error_code moo_rbn_single_dump (const moo_rbn_single *self, FILE *stream)
 Dump structural information of a Single DET.
 
cpl_error_code moo_rbn_single_free (moo_rbn_single *self)
 Free memory associate to this single RBN.
 

Detailed Description

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

Functionality include:

Synopsis:
#include "moo_rbn_single.h"

Function Documentation

◆ moo_rbn_single_compute_snr()

double moo_rbn_single_compute_snr ( moo_rbn_single *  self,
int  rbn_idx,
moo_sky_lines_list *  skylines 
)

Compute SNR for a given target.

Parameters
self[RBN_SINGLE] rbn_single structure
rbn_idxid of the target
skylinesthe SKYLINES which contains OH free zones
Returns
snr

Definition at line 432 of file moo_rbn_single.c.

References moo_pfits_get_cd1_1(), moo_pfits_get_crpix1(), moo_pfits_get_crval1(), moo_rbn_single_get_header(), moo_rbn_single_get_image(), and moo_sky_lines_list_get_free_zones().

Referenced by moo_rbn_compute_snr().

◆ moo_rbn_single_create()

moo_rbn_single * moo_rbn_single_create ( const char *  filename,
moo_detector_type  type 
)

Create a new moo_rbn_single with the given filename and type.

Parameters
filenamethe RBN filename
typethe detector type
Returns
1 newly allocated moo_rbn_single or NULL in case of an error

The returned object must be deallocated using moo_rbn_single_delete(). Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 121 of file moo_rbn_single.c.

References moo_detector_get_name(), moo_pfits_get_naxis(), and moo_rbn_single_new().

Referenced by moo_rbn_create().

◆ moo_rbn_single_delete()

void moo_rbn_single_delete ( moo_rbn_single *  self)

Delete a moo_rbn_single.

Parameters
selfmoo_rbn_single to delete
Returns
void

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

Definition at line 92 of file moo_rbn_single.c.

Referenced by moo_rbn_delete(), and moo_rebin().

◆ moo_rbn_single_dump()

cpl_error_code moo_rbn_single_dump ( const moo_rbn_single *  self,
FILE *  stream 
)

Dump structural information of a Single DET.

Parameters
selfrbn single 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 519 of file moo_rbn_single.c.

Referenced by moo_rbn_dump().

◆ moo_rbn_single_free()

cpl_error_code moo_rbn_single_free ( moo_rbn_single *  self)

Free memory associate to this single RBN.

Parameters
selfmoo_rbn_single where want to free memory
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 559 of file moo_rbn_single.c.

Referenced by moo_rbn_free_single().

◆ moo_rbn_single_get_data()

cpl_image * moo_rbn_single_get_data ( moo_rbn_single *  self)

Get image of data.

Parameters
selfRBN_SINGLE
Returns
image or NULL

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 273 of file moo_rbn_single.c.

Referenced by moo_rbnlist_get_single_data(), and moo_rebin().

◆ moo_rbn_single_get_errs()

cpl_image * moo_rbn_single_get_errs ( moo_rbn_single *  self)

Get image of errs.

Parameters
selfRBN_SINGLE
Returns
image or NULL

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 298 of file moo_rbn_single.c.

Referenced by moo_rebin().

◆ moo_rbn_single_get_header()

cpl_propertylist * moo_rbn_single_get_header ( moo_rbn_single *  self)

Get header of rbn single.

Parameters
selfRBN_SINGLE
Returns
the header or NULL

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 350 of file moo_rbn_single.c.

Referenced by moo_calib_flux(), moo_correct_tell(), moo_molecfit_calctrans(), moo_rbn_single_compute_snr(), moo_sub_sky_stare(), and moo_telluric_create_from_rbn().

◆ moo_rbn_single_get_image()

hdrl_image * moo_rbn_single_get_image ( moo_rbn_single *  self)

Get image of RBN_SINGLE.

Parameters
selfRBN_SINGLE
Returns
image or NULL

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 255 of file moo_rbn_single.c.

Referenced by moo_calib_flux(), moo_correct_tell(), moo_molecfit_calctrans(), moo_rbn_single_compute_snr(), moo_rbnlist_get_image(), and moo_telluric_create_from_rbn().

◆ moo_rbn_single_get_qual()

cpl_image * moo_rbn_single_get_qual ( moo_rbn_single *  self)

Get image of qual.

Parameters
selfRBN_SINGLE
Returns
image or NULL

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 322 of file moo_rbn_single.c.

References moo_fits_load_extension_image().

Referenced by moo_rbnlist_get_single_qual().

◆ moo_rbn_single_load()

cpl_error_code moo_rbn_single_load ( moo_rbn_single *  self,
unsigned int  level 
)

load the data of a moo_rbn_single

Parameters
self
levelthe level of bad pixel
Returns
the error status or CPL_ERROR_NONE

Possible cpl_error_code set in this function:

Definition at line 376 of file moo_rbn_single.c.

References moo_badpix_to_mask(), and moo_fits_load_extension_image().

Referenced by moo_molecfit_calctrans(), and moo_rbn_load_single().

◆ moo_rbn_single_new()

moo_rbn_single * moo_rbn_single_new ( moo_detector_type  type)

Create a new moo_rbn_single.

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

The returned object must be deallocated using moo_rbn_single_delete().

Definition at line 69 of file moo_rbn_single.c.

References MOO_BADPIX_GOOD, and moo_detector_get_name().

Referenced by moo_rbn_single_create(), and moo_rebin().

◆ moo_rbn_single_save()

void moo_rbn_single_save ( const moo_rbn_single *  self,
const char *  filename,
moo_detector_type  type 
)

Save a moo_rbn_single to a FITS file.

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

Definition at line 154 of file moo_rbn_single.c.

References moo_detector_get_name(), moo_fits_write_extension_image(), moo_pfits_append_hduclass_error(), and moo_pfits_append_hduclass_quality().

Referenced by moo_rbn_add_single(), and moo_rbn_save().

◆ moo_rbn_single_set_wcs1()

cpl_error_code moo_rbn_single_set_wcs1 ( moo_rbn_single *  self,
double  crpix1,
double  crval1,
double  cd1_1,
const char *  ctype1,
const char *  cunit1 
)

Set the WCS1 of the extension.

Parameters
selfsingle the extension
crpix1the crpix1 keyword
crval1the crval1 keyword
cd1_1the cd1_1 keyword
ctype1the ctype1 keyword
cunit1the cunit1 keyword
Returns
the relevant error code

the header of the extension must be preallocated before calling this function Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if a field of extension is NULL

Definition at line 214 of file moo_rbn_single.c.

Referenced by moo_rebin().