MOONS Pipeline Reference Manual 0.13.1
Modules | Functions
DET format

Modules

 DET_SINGLE format
 

Functions

moo_det * moo_det_new (void)
 Create a new moo_det.
 
moo_det * moo_det_create (const cpl_frame *frame)
 Create a new moo_det from the given DET frame.
 
cpl_error_code moo_det_load (moo_det *self, unsigned int level)
 Load all parts in DET.
 
cpl_error_code moo_det_load_ri (moo_det *self, int num, int level)
 Load the RI part in DET.
 
moo_single * moo_det_load_single (moo_det *self, moo_detector_type type, int num, int level)
 Load the type part in DET and return it.
 
cpl_error_code moo_det_free_single (moo_det *self, moo_detector_type type, int num)
 Free the given type part in DET.
 
cpl_error_code moo_det_load_yj (moo_det *self, int num, int level)
 Load the YJ part in DET.
 
cpl_error_code moo_det_load_h (moo_det *self, int num, int level)
 Load the H part in DET.
 
moo_single * moo_det_get_single (moo_det *self, moo_detector_type type, int num)
 Get the type part in DET and return it.
 
moo_single * moo_det_get_ri (moo_det *self, int num)
 Get the RI part in DET.
 
cpl_table * moo_det_get_fibre_table (moo_det *self)
 Get the FIBRE TABLE in DET.
 
cpl_propertylist * moo_det_get_primary_header (moo_det *self)
 Get the PRIMARY HEADER in DET.
 
void moo_det_delete (moo_det *self)
 Delete a moo_det.
 
void moo_det_save (moo_det *self, const char *filename)
 Save a moo_det to a FITS file.
 
cpl_error_code moo_det_dump (const moo_det *self, FILE *stream)
 Dump structural information of DET.
 
cpl_error_code moo_det_sum (moo_det *self, moo_det *det)
 Sum DET structure.
 
cpl_error_code moo_det_subtract (moo_det *self, moo_det *det)
 Subtract DET structure.
 
cpl_error_code moo_det_divide (moo_det *self, moo_det *det)
 Divide DET structure.
 
cpl_error_code moo_det_rescale_using_exptime (moo_det *self, moo_det *det)
 Rescale using exptime factor.
 
cpl_error_code moo_det_mean (moo_det *self, moo_det *det)
 Sum DET structure.
 
cpl_error_code moo_det_filter_snr (moo_det *self, double *min_snr_tab)
 Flag low snr pixels from DET structure.
 
cpl_error_code moo_ext_free_single (moo_ext *self, moo_detector_type type, int num)
 Free the given type part in EXT.
 

Detailed Description

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

Functionality include:

Synopsis:
#include "moo_det.h"

Function Documentation

◆ moo_det_create()

moo_det * moo_det_create ( const cpl_frame *  frame)

Create a new moo_det from the given DET frame.

Parameters
framethe given DET frame
Returns
1 newly allocated moo_det or NULL in case of an error

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

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the frame group is not CPL_FRAME_GROUP_PRODUCT or CPL_FRAME_GROUP_CALIB

Definition at line 91 of file moo_det.c.

References moo_det_get_fibre_table(), moo_det_new(), moo_single_create(), MOO_TYPE_H, MOO_TYPE_RI, and MOO_TYPE_YJ.

Referenced by moo_correct_bias(), moo_correct_dark(), moo_detlist_create(), moo_prepare_adu(), and moo_subtract_nod().

◆ moo_det_delete()

void moo_det_delete ( moo_det *  self)

Delete a moo_det.

Parameters
selfmoo_det to delete
Returns
void

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

Definition at line 472 of file moo_det.c.

References moo_single_delete().

Referenced by moo_compute_p2p(), moo_correct_bias(), moo_correct_dark(), moo_detlist_empty(), moo_detlist_set(), moo_prepare(), moo_prepare_adu(), moo_remove_CRH(), and moo_subtract_nod().

◆ moo_det_divide()

cpl_error_code moo_det_divide ( moo_det *  self,
moo_det *  det 
)

Divide DET structure.

Parameters
selfDET result of the division
detDET to divide
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 682 of file moo_det.c.

References moo_single_divide().

◆ moo_det_dump()

cpl_error_code moo_det_dump ( const moo_det *  self,
FILE *  stream 
)

Dump structural information of DET.

Parameters
selfDET 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 550 of file moo_det.c.

References moo_single_dump().

◆ moo_det_filter_snr()

cpl_error_code moo_det_filter_snr ( moo_det *  self,
double *  min_snr_tab 
)

Flag low snr pixels from DET structure.

Parameters
selfDET to filter
min_snr_tabminimum snr
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 808 of file moo_det.c.

References MOO_BADPIX_GOOD, moo_det_load_single(), moo_single_filter_snr(), MOO_TYPE_H, MOO_TYPE_RI, and MOO_TYPE_YJ.

◆ moo_det_free_single()

cpl_error_code moo_det_free_single ( moo_det *  self,
moo_detector_type  type,
int  num 
)

Free the given type part in DET.

Parameters
selfthe DET
typethe type of extension to free
numthe TAS number
Returns
error code or CPL_ERROR_NONE

TAS number is 0 or 1.

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if num is negative
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if num is bigger than 1

Definition at line 231 of file moo_det.c.

References moo_det_get_single(), and moo_single_free().

Referenced by moo_detlist_free_single().

◆ moo_det_get_fibre_table()

cpl_table * moo_det_get_fibre_table ( moo_det *  self)

Get the FIBRE TABLE in DET.

Parameters
selfthe DET
Returns
The FIBRE TABLE

TAS number is 0 or 1.

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 424 of file moo_det.c.

Referenced by moo_det_create(), moo_extract(), moo_remove_CRH(), and moo_subtract_nod().

◆ moo_det_get_primary_header()

cpl_propertylist * moo_det_get_primary_header ( moo_det *  self)

Get the PRIMARY HEADER in DET.

Parameters
selfthe DET
Returns
The PRIMARY_HEADER

TAS number is 0 or 1.

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 453 of file moo_det.c.

Referenced by moo_apply_p2p(), moo_correct_detlin(), and moo_subtract_nod().

◆ moo_det_get_ri()

moo_single * moo_det_get_ri ( moo_det *  self,
int  num 
)

Get the RI part in DET.

Parameters
selfthe DET
numthe TAS number
Returns
The RI part

TAS number is 0 or 1.

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if num is negative
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if num is bigger than 1

Definition at line 400 of file moo_det.c.

◆ moo_det_get_single()

moo_single * moo_det_get_single ( moo_det *  self,
moo_detector_type  type,
int  num 
)

Get the type part in DET and return it.

Parameters
selfthe DET
typethe type of extension to get
numthe TAS number [1,2]
Returns
the moo_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 359 of file moo_det.c.

References MOO_TYPE_H, MOO_TYPE_RI, and MOO_TYPE_YJ.

Referenced by moo_correct_dark(), moo_det_free_single(), moo_det_load_single(), moo_detlist_get_image(), moo_detlist_get_single_data(), moo_detlist_get_single_qual(), moo_prepare(), and moo_prepare_adu().

◆ moo_det_load()

cpl_error_code moo_det_load ( moo_det *  self,
unsigned int  level 
)

Load all parts in DET.

Parameters
selfthe DET
levelthe mask error level
Returns
error code or CPL_ERROR_NONE

Possible error code :

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 135 of file moo_det.c.

References moo_det_load_h(), moo_det_load_ri(), and moo_det_load_yj().

Referenced by moo_subtract_nod().

◆ moo_det_load_h()

cpl_error_code moo_det_load_h ( moo_det *  self,
int  num,
int  level 
)

Load the H part in DET.

Parameters
selfthe DET
numthe TAS number
levelthe mask error level
Returns
error code or CPL_ERROR_NONE

TAS number is 0 or 1.

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if num is negative
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if num is bigger than 1
  • CPL_ERROR_ILLEGAL_INPUT if type is unknown

Definition at line 298 of file moo_det.c.

References moo_single_load().

Referenced by moo_det_load().

◆ moo_det_load_ri()

cpl_error_code moo_det_load_ri ( moo_det *  self,
int  num,
int  level 
)

Load the RI part in DET.

Parameters
selfthe DET
numthe TAS number
levelthe mask error level
Returns
error code or CPL_ERROR_NONE

TAS number is 0 or 1.

Possible error code :

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if num is negative
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if num is bigger than 1

Definition at line 166 of file moo_det.c.

References moo_single_load().

Referenced by moo_det_load().

◆ moo_det_load_single()

moo_single * moo_det_load_single ( moo_det *  self,
moo_detector_type  type,
int  num,
int  level 
)

Load the type part in DET and return it.

Parameters
selfthe DET
typethe type of extension to load
numthe TAS number [1,2]
levelthe mask error level (equal or greater than 0)
Returns
the moo_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 197 of file moo_det.c.

References moo_det_get_single(), and moo_single_load().

Referenced by moo_apply_p2p(), moo_compute_hot_map(), moo_compute_noise_map(), moo_compute_p2p(), moo_compute_slitoffset(), moo_correct_bias(), moo_correct_dark(), moo_correct_detlin(), moo_det_filter_snr(), moo_detlist_load_single(), moo_extract(), moo_flat_shift_compute(), moo_model_flat(), and moo_reproject_model().

◆ moo_det_load_yj()

cpl_error_code moo_det_load_yj ( moo_det *  self,
int  num,
int  level 
)

Load the YJ part in DET.

Parameters
selfthe DET
numthe TAS number
levelthe mask error level
Returns
error code or CPL_ERROR_NONE

TAS number is 0 or 1.

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if num is negative
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if num is bigger than 1

Definition at line 265 of file moo_det.c.

References moo_single_load().

Referenced by moo_det_load().

◆ moo_det_mean()

cpl_error_code moo_det_mean ( moo_det *  self,
moo_det *  det 
)

Sum DET structure.

Parameters
selfDET result of the mean
detDET 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 769 of file moo_det.c.

References moo_single_mean().

◆ moo_det_new()

moo_det * moo_det_new ( void  )

Create a new moo_det.

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

The returned object must be deallocated using moo_det_delete().

Definition at line 71 of file moo_det.c.

Referenced by moo_compute_p2p(), moo_det_create(), and moo_remove_CRH().

◆ moo_det_rescale_using_exptime()

cpl_error_code moo_det_rescale_using_exptime ( moo_det *  self,
moo_det *  det 
)

Rescale using exptime factor.

Parameters
selfDET result of the rescaling
detDET use to rescale
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 721 of file moo_det.c.

References moo_pfits_get_dit(), moo_pfits_get_exptime(), moo_pfits_get_ndit(), and moo_single_multiply_scalar().

Referenced by moo_subtract_nod().

◆ moo_det_save()

void moo_det_save ( moo_det *  self,
const char *  filename 
)

Save a moo_det to a FITS file.

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

Definition at line 507 of file moo_det.c.

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

Referenced by moo_prepare(), moo_prepare_adu(), moo_products_add(), and moo_subtract_nod().

◆ moo_det_subtract()

cpl_error_code moo_det_subtract ( moo_det *  self,
moo_det *  det 
)

Subtract DET structure.

Parameters
selfDET result of the sum
detDET 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 643 of file moo_det.c.

References moo_single_sub().

Referenced by moo_subtract_nod().

◆ moo_det_sum()

cpl_error_code moo_det_sum ( moo_det *  self,
moo_det *  det 
)

Sum DET structure.

Parameters
selfDET result of the sum
detDET 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 604 of file moo_det.c.

References moo_single_sum().

◆ moo_ext_free_single()

cpl_error_code moo_ext_free_single ( moo_ext *  self,
moo_detector_type  type,
int  num 
)

Free the given type part in EXT.

Parameters
selfthe EXT
typethe type of extension to free
numthe TAS number
Returns
error code or CPL_ERROR_NONE

TAS number is 0 or 1.

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if num is negative
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if num is bigger than 1

Definition at line 486 of file moo_ext.c.

References moo_ext_get_single(), and moo_ext_single_free().

Referenced by moo_extlist_free_single().