MOONS Pipeline Reference Manual 0.13.1
Modules | Functions
SCI format

Modules

 SCI_SINGLE format
 

Functions

moo_sci * moo_sci_new (void)
 Create a new moo_sci.
 
void moo_sci_delete (moo_sci *self)
 Delete a moo_sci.
 
cpl_error_code moo_sci_add_target_table (moo_sci *self, moo_target_table *table)
 Add target table to SCI file and update moo_sci structure.
 
cpl_error_code moo_sci_set_single (moo_sci *self, moo_sci_single *single)
 assign moo_sci_single structure in moo_sci structure
 
cpl_error_code moo_sci_add_single (moo_sci *self, moo_detector_type type, moo_sci_single *single)
 Add SCI_SINGLE extension to SCI file and update moo_sci structure.
 
moo_sci * moo_sci_create (const cpl_frame *frame)
 Create a new empty SCI filename.
 
moo_target_tablemoo_sci_get_target_table (moo_sci *self)
 Get the target table of SCI file.
 
moo_sci_single * moo_sci_load_single (moo_sci *self, moo_detector_type type, int level)
 Load the type part in SCI and return it.
 
moo_sci_single * moo_sci_get_single (moo_sci *self, moo_detector_type type)
 Get the type part in SCI and return it.
 
void moo_sci_save (moo_sci *self, const char *filename)
 Save a moo_sci to a FITS file.
 
cpl_error_code moo_sci_compute_snr (moo_sci *self, moo_sky_lines_list *skylines)
 Compute SNR for all targets in SCI.
 

Detailed Description

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

Functionality include:

Synopsis:
#include "moo_sci.h"

Function Documentation

◆ moo_sci_add_single()

cpl_error_code moo_sci_add_single ( moo_sci *  self,
moo_detector_type  type,
moo_sci_single *  single 
)

Add SCI_SINGLE extension to SCI file and update moo_sci structure.

Parameters
selfmoo_sci structure to update
typethe detector type (RI, YJ, H)
singlemoo_sci_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 216 of file moo_sci.c.

References moo_sci_set_single(), and moo_sci_single_save().

Referenced by moo_coadd(), and moo_sub_sky_stare().

◆ moo_sci_add_target_table()

cpl_error_code moo_sci_add_target_table ( moo_sci *  self,
moo_target_table table 
)

Add target table to SCI file and update moo_sci structure.

Parameters
selfmoo_sci structure to update
tabletarget table to store on SCI file
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 132 of file moo_sci.c.

Referenced by moo_coadd(), and moo_sub_sky_stare().

◆ moo_sci_compute_snr()

cpl_error_code moo_sci_compute_snr ( moo_sci *  self,
moo_sky_lines_list *  skylines 
)

Compute SNR for all targets in SCI.

Parameters
self[SCI] file
skylinesSKY_LINE_LIST
Returns
CPL_ERROR_NONE or the relevant cpl_error_code on error

Definition at line 415 of file moo_sci.c.

References MOO_BADPIX_CALIB_DEFECT, MOO_BADPIX_OUTSIDE_DATA_RANGE, moo_sci_get_target_table(), moo_sci_load_single(), and moo_sci_single_compute_snr().

◆ moo_sci_create()

moo_sci * moo_sci_create ( const cpl_frame *  frame)

Create a new empty SCI filename.

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

The returned object must be deallocated using moo_sci_delete().

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 249 of file moo_sci.c.

References moo_sci_new(), moo_sci_single_create(), MOO_TYPE_H, MOO_TYPE_RI, and MOO_TYPE_YJ.

Referenced by moo_coadd(), moo_create_s1d(), moo_molecfit_model(), moo_scilist_create(), and moo_scilist_create_clean().

◆ moo_sci_delete()

void moo_sci_delete ( moo_sci *  self)

Delete a moo_sci.

Parameters
selfmoo_sci to delete
Returns
void

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

Definition at line 84 of file moo_sci.c.

References moo_sci_single_delete(), and moo_target_table_delete().

Referenced by moo_coadd(), moo_combine_pair(), moo_create_s1d(), moo_molecfit_model(), moo_scilist_create_clean(), moo_scilist_empty(), moo_scilist_set(), and moo_sub_sky_stare().

◆ moo_sci_get_single()

moo_sci_single * moo_sci_get_single ( moo_sci *  self,
moo_detector_type  type 
)

Get the type part in SCI and return it.

Parameters
selfthe SCI
typethe type of extension to get
Returns
the moo_sci_single corresponding to the type or NULL

Possible error code :

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 351 of file moo_sci.c.

References MOO_TYPE_H, MOO_TYPE_RI, and MOO_TYPE_YJ.

Referenced by moo_coadd(), moo_compute_resp(), moo_create_s1d(), moo_molecfit_model(), moo_sci_load_single(), moo_scilist_get_image(), moo_scilist_get_qual(), moo_scilist_get_single(), and moo_scilist_get_sky().

◆ moo_sci_get_target_table()

moo_target_table * moo_sci_get_target_table ( moo_sci *  self)

Get the target table of SCI file.

Parameters
selfmoo_sci object to read
Returns
the TARGET_TABLE object or NULL

The returned object must be deallocated using moo_sci_delete().

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 284 of file moo_sci.c.

References moo_target_table_new().

Referenced by moo_coadd(), moo_compute_resp(), moo_correct_tell_science(), moo_create_s1d(), moo_resp_create(), moo_sci_compute_snr(), moo_scilist_create_clean(), and moo_telluric_create().

◆ moo_sci_load_single()

moo_sci_single * moo_sci_load_single ( moo_sci *  self,
moo_detector_type  type,
int  level 
)

Load the type part in SCI and return it.

Parameters
selfthe SCI
typethe type of extension to load
levelthe mask error level (equal or greater than 0)
Returns
the moo_sci_single corresponding to the type or NULL

Possible error code :

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 323 of file moo_sci.c.

References moo_sci_get_single(), and moo_sci_single_load().

Referenced by moo_correct_tell_science(), moo_create_s1d(), moo_resp_create(), moo_sci_compute_snr(), moo_scilist_load_single(), and moo_telluric_create().

◆ moo_sci_new()

moo_sci * moo_sci_new ( void  )

Create a new moo_sci.

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

The returned object must be deallocated using moo_sci_delete().

Definition at line 66 of file moo_sci.c.

Referenced by moo_coadd(), moo_sci_create(), and moo_sub_sky_stare().

◆ moo_sci_save()

void moo_sci_save ( moo_sci *  self,
const char *  filename 
)

Save a moo_sci to a FITS file.

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

Definition at line 385 of file moo_sci.c.

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

Referenced by moo_coadd(), moo_combine_pair(), and moo_products_add_sci().

◆ moo_sci_set_single()

cpl_error_code moo_sci_set_single ( moo_sci *  self,
moo_sci_single *  single 
)

assign moo_sci_single structure in moo_sci structure

Parameters
selfmoo_sci structure to update
singlemoo_sci_single structure

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 174 of file moo_sci.c.

References MOO_TYPE_H, MOO_TYPE_RI, and MOO_TYPE_YJ.

Referenced by moo_sci_add_single().