MOONS Pipeline Reference Manual 0.13.2
Functions
DET_LIST format

Functions

moo_detlist * moo_detlist_new (void)
 Create a new moo_detlist.
 
moo_detlist * moo_detlist_create (cpl_frameset *frameset)
 Create a new moo_detlist from the given DET frameset.
 
cpl_error_code moo_detlist_load_single (const moo_detlist *self, moo_detector_type type, int num, int level)
 Load the type part for all DET in the detlist.
 
cpl_error_code moo_detlist_free_single (const moo_detlist *self, moo_detector_type type, int num)
 Free the type part for all DET in the detlist.
 
cpl_size moo_detlist_get_size (const moo_detlist *self)
 Get the number of DET in the detlist.
 
moo_det * moo_detlist_get (moo_detlist *self, int i)
 Get the DET at the position i in the list.
 
hdrl_imagelist * moo_detlist_get_image (const moo_detlist *self, moo_detector_type type, int num)
 Get the all the images of the type part in the detlist.
 
cpl_imagelist * moo_detlist_get_single_data (const moo_detlist *self, moo_detector_type type, int num)
 Get the type data part for all DET in the detlist.
 
cpl_imagelist * moo_detlist_get_single_qual (const moo_detlist *self, moo_detector_type type, int num)
 Get the type QUAL part for all DET in the detlist.
 
cpl_error_code moo_detlist_set (moo_detlist *self, moo_det *det, cpl_size pos)
 Insert a DET into an moo_detlist.
 
cpl_error_code moo_detlist_push (moo_detlist *self, moo_det *det)
 Insert a DET a the end of moo_detlist.
 
moo_det * moo_detlist_unset (moo_detlist *self, cpl_size pos)
 Remove a DET from a DET list.
 
void moo_detlist_empty (moo_detlist *self)
 Empty an moo_detlist and deallocate all its DET.
 
void moo_detlist_unwrap (moo_detlist *self)
 Free memory used by a moo_detlist object, except the DET.
 
void moo_detlist_delete (moo_detlist *self)
 Free all memory used by a moo_detlist object including the DET.
 
cpl_error_code moo_rbnlist_free_single (const moo_rbnlist *self, moo_detector_type type)
 Free the type part for all DET in the detlist.
 

Detailed Description

Function Documentation

◆ moo_detlist_create()

moo_detlist * moo_detlist_create ( cpl_frameset *  frameset)

Create a new moo_detlist from the given DET frameset.

Returns
1 newly allocated moo_detlist 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

Definition at line 71 of file moo_detlist.c.

References moo_det_create(), moo_detlist_new(), and moo_detlist_push().

◆ moo_detlist_delete()

void moo_detlist_delete ( moo_detlist *  self)

Free all memory used by a moo_detlist object including the DET.

Parameters
selfThe DET list or NULL
Returns
void
See also
moo_detlist_empty(), moo_detlist_unwrap() If the DET_LIST format self is NULL, nothing is done and no error is set.

Definition at line 559 of file moo_detlist.c.

References moo_detlist_empty(), and moo_detlist_unwrap().

◆ moo_detlist_empty()

void moo_detlist_empty ( moo_detlist *  self)

Empty an moo_detlist and deallocate all its DET.

Parameters
selfThe DET list or NULL
Returns
Nothing
See also
moo_detlist_empty(), moo_detlist_delete()
Note
If self is NULL nothing is done and no error is set.

After the call the moo_det list can be populated again. It must eventually be deallocted with a call to moo_detlist_delete().

Definition at line 503 of file moo_detlist.c.

References moo_det_delete(), and moo_detlist_unset().

Referenced by moo_detlist_delete().

◆ moo_detlist_free_single()

cpl_error_code moo_detlist_free_single ( const moo_detlist *  self,
moo_detector_type  type,
int  num 
)

Free the type part for all DET in the detlist.

Parameters
selfthe list of DET
typethe type of extension to load
numthe TAS number
Returns
The 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 143 of file moo_detlist.c.

References moo_det_free_single().

Referenced by moo_compute_noise_map(), and moo_masterbias().

◆ moo_detlist_get()

moo_det * moo_detlist_get ( moo_detlist *  self,
int  i 
)

Get the DET at the position i in the list.

Parameters
selfthe list of DET
iposition in the list
Returns
DET element or NULL

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if i <0 or i >= list size

Definition at line 196 of file moo_detlist.c.

References moo_detlist_get_size().

Referenced by moo_remove_CRH().

◆ moo_detlist_get_image()

hdrl_imagelist * moo_detlist_get_image ( const moo_detlist *  self,
moo_detector_type  type,
int  num 
)

Get the all the images of the type part in the detlist.

Parameters
selfthe list of DET
typethe type of extension to load
numthe TAS number
Returns
The image list or NULL

TAS number is 1 or 2.

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 num smaller than 1
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if num is bigger than 2

Definition at line 225 of file moo_detlist.c.

References moo_det_get_single(), and moo_single_get_image().

Referenced by moo_masterbias().

◆ moo_detlist_get_single_data()

cpl_imagelist * moo_detlist_get_single_data ( const moo_detlist *  self,
moo_detector_type  type,
int  num 
)

Get the type data part for all DET in the detlist.

Parameters
selfthe list of DET
typethe type of extension to load
numthe TAS number
Returns
The type data list

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 279 of file moo_detlist.c.

References moo_det_get_single(), and moo_single_get_data().

Referenced by moo_compute_noise_map().

◆ moo_detlist_get_single_qual()

cpl_imagelist * moo_detlist_get_single_qual ( const moo_detlist *  self,
moo_detector_type  type,
int  num 
)

Get the type QUAL part for all DET in the detlist.

Parameters
selfthe list of DET
typethe type of extension to load
numthe TAS number
Returns
The type QUAL list

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 320 of file moo_detlist.c.

References moo_det_get_single(), and moo_single_get_qual().

Referenced by moo_compute_noise_map().

◆ moo_detlist_get_size()

cpl_size moo_detlist_get_size ( const moo_detlist *  self)

Get the number of DET in the detlist.

Parameters
selfthe list of DET
Returns
The number of DET or -1 on error

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 173 of file moo_detlist.c.

Referenced by moo_compute_noise_map(), and moo_detlist_get().

◆ moo_detlist_load_single()

cpl_error_code moo_detlist_load_single ( const moo_detlist *  self,
moo_detector_type  type,
int  num,
int  level 
)

Load the type part for all DET in the detlist.

Parameters
selfthe list of DET
typethe type of extension to load
numthe TAS number
levelMask error level
Returns
The 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 107 of file moo_detlist.c.

References moo_det_load_single().

Referenced by moo_compute_noise_map(), and moo_masterbias().

◆ moo_detlist_new()

moo_detlist * moo_detlist_new ( void  )

Create a new moo_detlist.

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

The returned object must be deallocated using moo_detlist_delete().

Definition at line 56 of file moo_detlist.c.

Referenced by moo_detlist_create().

◆ moo_detlist_push()

cpl_error_code moo_detlist_push ( moo_detlist *  self,
moo_det *  det 
)

Insert a DET a the end of moo_detlist.

Parameters
selfThe moo_detlist
detThe DET to insert
Returns
CPL_ERROR_NONE or the relevant cpl_error_code on error
See also
moo_detlist_set()

No action occurs if a DET is inserted more than once into the same position. It is allowed to insert the same DET into two different positions in a list.

The DET is inserted at the end in the DET list. If the DET already there is only present in that one location in the list, then the DET is deallocated.

The added DET is owned by the moo_detlist object, which deallocates it moo_detlist_delete is called. Other option is to use moo_detlist_unset to recover ownership of the DET, in which case the moo_detlist object is not longer responsible for deallocating it.

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 439 of file moo_detlist.c.

References moo_detlist_set().

Referenced by moo_detlist_create().

◆ moo_detlist_set()

cpl_error_code moo_detlist_set ( moo_detlist *  self,
moo_det *  det,
cpl_size  pos 
)

Insert a DET into an moo_detlist.

Parameters
selfThe moo_detlist
detThe DET to insert
posThe list position (from 0 to number of DET)
Returns
CPL_ERROR_NONE or the relevant cpl_error_code on error

It is allowed to specify the position equal to the number of DET in the list. This will increment the size of the detlist.

No action occurs if a DET is inserted more than once into the same position. It is allowed to insert the same DET into two different positions in a list.

The DET is inserted at the position pos in the DET list. If the DET already there is only present in that one location in the list, then the DET is deallocated.

The added DET is owned by the moo_detlist object, which deallocates it moo_detlist_delete is called. Other option is to use moo_detlist_unset to recover ownership of the DET, in which case the moo_detlist object is not longer responsible for deallocating it.

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if pos is negative
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if pos is bigger than the number of DET in detlist

Definition at line 375 of file moo_detlist.c.

References moo_det_delete().

Referenced by moo_detlist_push().

◆ moo_detlist_unset()

moo_det * moo_detlist_unset ( moo_detlist *  self,
cpl_size  pos 
)

Remove a DET from a DET list.

Parameters
selfThe moo_detlist
posThe list position (from 0 to number of DET-1)
Returns
The pointer to the removed DET or NULL in error case

The specified DET is not deallocated, it is simply removed from the list. The pointer to the DET is returned to let the user decide to deallocate it or not. Eventually, the DET will have to be deallocated with moo_det_delete().

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL
  • CPL_ERROR_ILLEGAL_INPUT if pos is negative
  • CPL_ERROR_ACCESS_OUT_OF_RANGE if pos is bigger than the number of images in self

Definition at line 465 of file moo_detlist.c.

Referenced by moo_detlist_empty().

◆ moo_detlist_unwrap()

void moo_detlist_unwrap ( moo_detlist *  self)

Free memory used by a moo_detlist object, except the DET.

Parameters
selfThe DET list or NULL
Returns
Nothing
See also
moo_detlist_empty()
Note
The caller must have pointers to all DET in the list and is reponsible for their deallocation. If self is NULL nothing is done and no error is set.

Definition at line 539 of file moo_detlist.c.

Referenced by moo_detlist_delete().

◆ moo_rbnlist_free_single()

cpl_error_code moo_rbnlist_free_single ( const moo_rbnlist *  self,
moo_detector_type  type 
)

Free the type part for all DET in the detlist.

Parameters
selfthe list of DET
typethe type of extension to load
Returns
The 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 137 of file moo_rbnlist.c.

References moo_rbn_free_single().