MOONS Pipeline Reference Manual 0.13.2
Functions
SCI_SINGLE format

Functions

moo_sci_single * moo_sci_single_new (moo_detector_type type)
 Create a new moo_sci_single.
 
void moo_sci_single_delete (moo_sci_single *self)
 Delete a moo_sci_single.
 
void moo_sci_single_save (moo_sci_single *self, const char *filename, moo_detector_type type)
 Save a moo_sci_single to a FITS file.
 
moo_sci_single * moo_sci_single_create (const char *filename, moo_detector_type type)
 Create a new moo_sci_single with the given filename and type.
 
cpl_error_code moo_sci_single_load (moo_sci_single *self, unsigned int level)
 Load a moo_sci_single from the filename.
 
hdrl_image * moo_sci_single_get_image (moo_sci_single *self)
 Get image of SCI_SINGLE.
 
cpl_propertylist * moo_sci_single_get_header (moo_sci_single *self)
 Get header of sci single.
 
cpl_image * moo_sci_single_get_sky (moo_sci_single *self)
 Get sky of sci single.
 
cpl_image * moo_sci_single_get_qual (moo_sci_single *self)
 Get image of qual.
 
double moo_sci_single_compute_snr (moo_sci_single *self, int targ_idx, moo_sky_lines_list *skylines)
 Compute SNR for a given target.
 

Detailed Description

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

Functionality include:

Synopsis:
#include "moo_sci_single.h"

Function Documentation

◆ moo_sci_single_compute_snr()

double moo_sci_single_compute_snr ( moo_sci_single *  self,
int  targ_idx,
moo_sky_lines_list *  skylines 
)

Compute SNR for a given target.

Parameters
self[SCI_SINGLE] sci_single structure
targ_idxid of the target
skylinesthe SKYLINES which contains OH free zones list
Returns
snr

Definition at line 392 of file moo_sci_single.c.

References moo_pfits_get_cd1_1(), moo_pfits_get_crpix1(), moo_pfits_get_crval1(), moo_sci_single_get_header(), moo_sci_single_get_image(), and moo_sky_lines_list_get_free_zones().

Referenced by moo_sci_compute_snr().

◆ moo_sci_single_create()

moo_sci_single * moo_sci_single_create ( const char *  filename,
moo_detector_type  type 
)

Create a new moo_sci_single with the given filename and type.

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

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

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 205 of file moo_sci_single.c.

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

Referenced by moo_sci_create().

◆ moo_sci_single_delete()

void moo_sci_single_delete ( moo_sci_single *  self)

Delete a moo_sci_single.

Parameters
selfmoo_sci_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_sci_single.c.

Referenced by moo_sci_delete().

◆ moo_sci_single_get_header()

cpl_propertylist * moo_sci_single_get_header ( moo_sci_single *  self)

Get header of sci single.

Parameters
selfSCI_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 314 of file moo_sci_single.c.

Referenced by moo_coadd(), moo_compute_resp(), moo_correct_tell_science(), moo_molecfit_model(), moo_resp_create(), moo_sci_single_compute_snr(), and moo_telluric_create().

◆ moo_sci_single_get_image()

hdrl_image * moo_sci_single_get_image ( moo_sci_single *  self)

Get image of SCI_SINGLE.

Parameters
selfSCI_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 294 of file moo_sci_single.c.

Referenced by moo_coadd(), moo_correct_tell_science(), moo_molecfit_model(), moo_resp_create(), moo_sci_single_compute_snr(), moo_scilist_get_image(), and moo_telluric_create().

◆ moo_sci_single_get_qual()

cpl_image * moo_sci_single_get_qual ( moo_sci_single *  self)

Get image of qual.

Parameters
selfSCI_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 366 of file moo_sci_single.c.

References moo_fits_load_extension_image().

Referenced by moo_coadd(), and moo_scilist_get_qual().

◆ moo_sci_single_get_sky()

cpl_image * moo_sci_single_get_sky ( moo_sci_single *  self)

Get sky of sci single.

Parameters
selfSCI_SINGLE
Returns
the sky 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 342 of file moo_sci_single.c.

References moo_fits_load_extension_image().

Referenced by moo_coadd(), moo_sci_single_load(), and moo_scilist_get_sky().

◆ moo_sci_single_load()

cpl_error_code moo_sci_single_load ( moo_sci_single *  self,
unsigned int  level 
)

Load a moo_sci_single from the filename.

Parameters
selfthe sci_single to load
levelthe bad pixel level
Returns
the error code or CPL_ERROR_NONE

Definition at line 237 of file moo_sci_single.c.

References moo_badpix_to_mask(), moo_fits_load_extension_image(), and moo_sci_single_get_sky().

Referenced by moo_molecfit_model(), and moo_sci_load_single().

◆ moo_sci_single_new()

moo_sci_single * moo_sci_single_new ( moo_detector_type  type)

Create a new moo_sci_single.

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

The returned object must be deallocated using moo_sci_single_delete().

Definition at line 69 of file moo_sci_single.c.

References MOO_BADPIX_GOOD, and moo_detector_get_name().

Referenced by moo_coadd(), and moo_sci_single_create().

◆ moo_sci_single_save()

void moo_sci_single_save ( moo_sci_single *  self,
const char *  filename,
moo_detector_type  type 
)

Save a moo_sci_single to a FITS file.

Parameters
selfmoo_sci_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 124 of file moo_sci_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_sci_add_single(), and moo_sci_save().