MOONS Pipeline Reference Manual 0.13.1
Modules | Functions
EXT format

Modules

 EXT_SINGLE format
 

Functions

moo_ext * moo_ext_new (void)
 Create a new moo_ext.
 
moo_ext * moo_ext_create (const cpl_frame *frame)
 Create a new empty EXT filename.
 
cpl_error_code moo_ext_load (moo_ext *self, unsigned int level)
 Load all parts in EXT.
 
moo_ext_single * moo_ext_load_single (moo_ext *self, moo_detector_type type, int num, unsigned int level)
 Load the type part in EXT and return it.
 
moo_ext_single * moo_ext_get_single (moo_ext *self, moo_detector_type type, int ntas)
 Get a EXT single from EXT.
 
cpl_error_code moo_ext_set_single (moo_ext *self, moo_detector_type type, int ntas, moo_ext_single *single)
 assign moo_ext_single structure in moo_ext structure
 
cpl_error_code moo_ext_add_single (moo_ext *self, moo_ext_single *single, moo_detector_type type, int ntas)
 Add EXT_SINGLE extension to EXT filename and update moo_ext structure.
 
cpl_error_code moo_ext_add_fibre_table (moo_ext *self, cpl_table *fibre_table)
 Add fibre table to EXT filename and update moo_ext structure.
 
cpl_table * moo_ext_get_fibre_table (moo_ext *self)
 Get the FIBRE TABLE in EXT.
 
void moo_ext_delete (moo_ext *self)
 Delete a moo_ext.
 
void moo_ext_save (moo_ext *self, const char *filename)
 Save a moo_ext to a FITS file.
 
cpl_error_code moo_ext_dump (const moo_ext *self, FILE *stream)
 Dump structural information of EXT.
 
cpl_error_code moo_ext_sum (moo_ext *self, moo_ext *ext)
 Sum EXT structure.
 
cpl_error_code moo_ext_compute_snr (moo_ext *self, moo_map *wmap, moo_spectral_format *sformat, moo_sky_lines_list *skylines)
 Compute SNR for all fibres EXT.
 

Detailed Description

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

Functionality include:

Synopsis:
#include "moo_ext.h"

Function Documentation

◆ moo_ext_add_fibre_table()

cpl_error_code moo_ext_add_fibre_table ( moo_ext *  self,
cpl_table *  fibre_table 
)

Add fibre table to EXT filename and update moo_ext structure.

Parameters
selfmoo_ext structure to update
fibre_tablefibre table to store on EXT file

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

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 309 of file moo_ext.c.

Referenced by moo_extract().

◆ moo_ext_add_single()

cpl_error_code moo_ext_add_single ( moo_ext *  self,
moo_ext_single *  single,
moo_detector_type  type,
int  ntas 
)

Add EXT_SINGLE extension to EXT filename and update moo_ext structure.

Parameters
selfmoo_ext structure to update
typetype of detector
ntasnumber of spectrographs
singleEXT_SINGLE extension to store on LOC file

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

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 276 of file moo_ext.c.

References moo_detector_get_extname(), moo_ext_set_single(), and moo_ext_single_save().

Referenced by moo_extract().

◆ moo_ext_compute_snr()

cpl_error_code moo_ext_compute_snr ( moo_ext *  self,
moo_map *  wmap,
moo_spectral_format *  sformat,
moo_sky_lines_list *  skylines 
)

Compute SNR for all fibres EXT.

Parameters
self[EXT] the ext
wmap[MAP] the wavemap
sformatthe spectral format
skylinesSKY_LINE_LIST
Returns
CPL_ERROR_NONE or the relevant cpl_error_code on error

Definition at line 553 of file moo_ext.c.

References MOO_BADPIX_GOOD, moo_ext_get_fibre_table(), moo_ext_load_single(), moo_ext_single_compute_snr(), moo_qc_set_snr_range(), moo_spectral_format_get(), and moo_spectral_format_info_delete().

◆ moo_ext_create()

moo_ext * moo_ext_create ( const cpl_frame *  frame)

Create a new empty EXT filename.

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

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

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 86 of file moo_ext.c.

References moo_ext_delete(), moo_ext_new(), moo_ext_single_create(), MOO_TYPE_H, MOO_TYPE_RI, and MOO_TYPE_YJ.

Referenced by moo_extlist_create(), and moo_extlist_sum().

◆ moo_ext_delete()

void moo_ext_delete ( moo_ext *  self)

Delete a moo_ext.

Parameters
selfmoo_ext to delete
Returns
void

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

Definition at line 370 of file moo_ext.c.

References moo_ext_single_delete().

Referenced by moo_ext_create(), moo_extlist_empty(), moo_extlist_set(), and moo_extract().

◆ moo_ext_dump()

cpl_error_code moo_ext_dump ( const moo_ext *  self,
FILE *  stream 
)

Dump structural information of EXT.

Parameters
selfLOC 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 441 of file moo_ext.c.

References moo_ext_single_dump().

◆ moo_ext_get_fibre_table()

cpl_table * moo_ext_get_fibre_table ( moo_ext *  self)

Get the FIBRE TABLE in EXT.

Parameters
selfthe EXT
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 344 of file moo_ext.c.

Referenced by moo_apply_flat(), moo_compute_fibtrans(), moo_ext_compute_snr(), moo_extlist_sum(), and moo_rebin().

◆ moo_ext_get_single()

moo_ext_single * moo_ext_get_single ( moo_ext *  self,
moo_detector_type  type,
int  ntas 
)

Get a EXT single from EXT.

Parameters
selfmoo_ext structure to update
typetype of detector
ntasnumber of spectrographs
Returns
EXT_SINGLE

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

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 199 of file moo_ext.c.

References MOO_TYPE_H, MOO_TYPE_RI, and MOO_TYPE_YJ.

Referenced by moo_ext_free_single(), moo_extlist_get_image(), moo_extlist_get_single_data(), and moo_extlist_get_single_qual().

◆ moo_ext_load()

cpl_error_code moo_ext_load ( moo_ext *  self,
unsigned int  level 
)

Load all parts in EXT.

Parameters
selfthe EXT
levelthe bad pixel level
Returns
error code or CPL_ERROR_NONE

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

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 126 of file moo_ext.c.

References moo_ext_single_load().

Referenced by moo_extlist_sum().

◆ moo_ext_load_single()

moo_ext_single * moo_ext_load_single ( moo_ext *  self,
moo_detector_type  type,
int  num,
unsigned int  level 
)

Load the type part in EXT and return it.

Parameters
selfthe EXT
typethe type of extension to load
numthe TAS number [1,2]
levelthe bad pixel level
Returns
the moo_ext_single corresponding to the type or NULL

Possible error code :

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if num is not in range [1,2]

Definition at line 156 of file moo_ext.c.

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

Referenced by moo_apply_flat(), moo_compute_fibtrans(), moo_ext_compute_snr(), moo_extlist_load_single(), and moo_rebin().

◆ moo_ext_new()

moo_ext * moo_ext_new ( void  )

Create a new moo_ext.

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

The returned object must be deallocated using moo_ext_delete().

Definition at line 69 of file moo_ext.c.

Referenced by moo_ext_create(), and moo_extract().

◆ moo_ext_save()

void moo_ext_save ( moo_ext *  self,
const char *  filename 
)

Save a moo_ext to a FITS file.

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

Definition at line 406 of file moo_ext.c.

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

Referenced by moo_extlist_sum(), and moo_products_add_ext().

◆ moo_ext_set_single()

cpl_error_code moo_ext_set_single ( moo_ext *  self,
moo_detector_type  type,
int  ntas,
moo_ext_single *  single 
)

assign moo_ext_single structure in moo_ext structure

Parameters
selfmoo_ext structure to update
typetype of detector
ntasnumber of spectrographs
singlemoo_ext_single structure

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

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 231 of file moo_ext.c.

References MOO_TYPE_H, MOO_TYPE_RI, and MOO_TYPE_YJ.

Referenced by moo_ext_add_single().

◆ moo_ext_sum()

cpl_error_code moo_ext_sum ( moo_ext *  self,
moo_ext *  ext 
)

Sum EXT structure.

Parameters
selfEXT result of the sum
extEXT to sum
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

Definition at line 514 of file moo_ext.c.

References moo_ext_single_sum().

Referenced by moo_extlist_sum().