MOONS Pipeline Reference Manual 0.13.1
Functions
EXT_LIST format

Functions

moo_extlist * moo_extlist_new (void)
 Create a new moo_extlist.
 
moo_extlist * moo_extlist_create (cpl_frameset *frameset)
 Create a new moo_extlist from the given DET frameset.
 
cpl_error_code moo_extlist_load_single (const moo_extlist *self, moo_detector_type type, int num, int level)
 Load the type part for all DET in the extlist.
 
cpl_error_code moo_extlist_free_single (const moo_extlist *self, moo_detector_type type, int num)
 Free the type part for all DET in the extlist.
 
cpl_size moo_extlist_get_size (const moo_extlist *self)
 Get the number of DET in the extlist.
 
moo_ext * moo_extlist_get (moo_extlist *self, int i)
 Get the DET at the position i in the list.
 
hdrl_imagelist * moo_extlist_get_image (const moo_extlist *self, moo_detector_type type, int num)
 Get the all the images of the type part in the extlist.
 
cpl_imagelist * moo_extlist_get_single_data (const moo_extlist *self, moo_detector_type type, int num)
 Get the type data part for all DET in the extlist.
 
cpl_imagelist * moo_extlist_get_single_qual (const moo_extlist *self, moo_detector_type type, int num)
 Get the type QUAL part for all DET in the extlist.
 
cpl_error_code moo_extlist_set (moo_extlist *self, moo_ext *ext, cpl_size pos)
 Insert a DET into an moo_extlist.
 
cpl_error_code moo_extlist_push (moo_extlist *self, moo_ext *ext)
 Insert a DET a the end of moo_extlist.
 
moo_ext * moo_extlist_unset (moo_extlist *self, cpl_size pos)
 Remove a DET from a DET list.
 
void moo_extlist_empty (moo_extlist *self)
 Empty an moo_extlist and deallocate all its DET.
 
void moo_extlist_unwrap (moo_extlist *self)
 Free memory used by a moo_extlist object, except the DET.
 
void moo_extlist_delete (moo_extlist *self)
 Free all memory used by a moo_extlist object including the DET.
 
moo_ext * moo_extlist_sum (moo_extlist *self, const char *filename)
 Sum EXT element from the list and save result in filename.
 

Detailed Description

Function Documentation

◆ moo_extlist_create()

moo_extlist * moo_extlist_create ( cpl_frameset *  frameset)

Create a new moo_extlist from the given DET frameset.

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

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

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 72 of file moo_extlist.c.

References moo_ext_create(), moo_extlist_new(), and moo_extlist_push().

◆ moo_extlist_delete()

void moo_extlist_delete ( moo_extlist *  self)

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

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

Definition at line 561 of file moo_extlist.c.

References moo_extlist_empty(), and moo_extlist_unwrap().

◆ moo_extlist_empty()

void moo_extlist_empty ( moo_extlist *  self)

Empty an moo_extlist and deallocate all its DET.

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

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

Definition at line 505 of file moo_extlist.c.

References moo_ext_delete(), and moo_extlist_unset().

Referenced by moo_extlist_delete().

◆ moo_extlist_free_single()

cpl_error_code moo_extlist_free_single ( const moo_extlist *  self,
moo_detector_type  type,
int  num 
)

Free the type part for all DET in the extlist.

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 144 of file moo_extlist.c.

References moo_ext_free_single().

◆ moo_extlist_get()

moo_ext * moo_extlist_get ( moo_extlist *  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 197 of file moo_extlist.c.

References moo_extlist_get_size().

Referenced by moo_extlist_sum().

◆ moo_extlist_get_image()

hdrl_imagelist * moo_extlist_get_image ( const moo_extlist *  self,
moo_detector_type  type,
int  num 
)

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

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 226 of file moo_extlist.c.

References moo_ext_get_single(), and moo_ext_single_get_image().

◆ moo_extlist_get_single_data()

cpl_imagelist * moo_extlist_get_single_data ( const moo_extlist *  self,
moo_detector_type  type,
int  num 
)

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

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 280 of file moo_extlist.c.

References moo_ext_get_single(), and moo_ext_single_get_data().

◆ moo_extlist_get_single_qual()

cpl_imagelist * moo_extlist_get_single_qual ( const moo_extlist *  self,
moo_detector_type  type,
int  num 
)

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

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 321 of file moo_extlist.c.

References moo_ext_get_single(), and moo_ext_single_get_qual().

◆ moo_extlist_get_size()

cpl_size moo_extlist_get_size ( const moo_extlist *  self)

Get the number of DET in the extlist.

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 174 of file moo_extlist.c.

Referenced by moo_extlist_get(), and moo_extlist_sum().

◆ moo_extlist_load_single()

cpl_error_code moo_extlist_load_single ( const moo_extlist *  self,
moo_detector_type  type,
int  num,
int  level 
)

Load the type part for all DET in the extlist.

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 108 of file moo_extlist.c.

References moo_ext_load_single().

◆ moo_extlist_new()

moo_extlist * moo_extlist_new ( void  )

Create a new moo_extlist.

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

The returned object must be deallocated using moo_extlist_delete().

Definition at line 57 of file moo_extlist.c.

Referenced by moo_extlist_create().

◆ moo_extlist_push()

cpl_error_code moo_extlist_push ( moo_extlist *  self,
moo_ext *  ext 
)

Insert a DET a the end of moo_extlist.

Parameters
selfThe moo_extlist
extThe DET to insert
Returns
CPL_ERROR_NONE or the relevant cpl_error_code on error
See also
moo_extlist_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_extlist object, which deallocates it moo_extlist_delete is called. Other option is to use moo_extlist_unset to recover ownership of the DET, in which case the moo_extlist 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 440 of file moo_extlist.c.

References moo_extlist_set().

Referenced by moo_extlist_create().

◆ moo_extlist_set()

cpl_error_code moo_extlist_set ( moo_extlist *  self,
moo_ext *  ext,
cpl_size  pos 
)

Insert a DET into an moo_extlist.

Parameters
selfThe moo_extlist
extThe 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 extlist.

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_extlist object, which deallocates it moo_extlist_delete is called. Other option is to use moo_extlist_unset to recover ownership of the DET, in which case the moo_extlist 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 extlist

Definition at line 376 of file moo_extlist.c.

References moo_ext_delete().

Referenced by moo_extlist_push().

◆ moo_extlist_sum()

moo_ext * moo_extlist_sum ( moo_extlist *  self,
const char *  filename 
)

Sum EXT element from the list and save result in filename.

Parameters
selfThe EXT list to sum
filenamefilename to save the new EXT result
Returns
EXT result of the sum
See also
moo_extlist_empty(), moo_extlist_unwrap() If the EXT_LIST format self is NULL, nothing is done and no error is set.

Definition at line 581 of file moo_extlist.c.

References MOO_BADPIX_GOOD, moo_ext_create(), moo_ext_get_fibre_table(), moo_ext_load(), moo_ext_save(), moo_ext_sum(), moo_extlist_get(), and moo_extlist_get_size().

◆ moo_extlist_unset()

moo_ext * moo_extlist_unset ( moo_extlist *  self,
cpl_size  pos 
)

Remove a DET from a DET list.

Parameters
selfThe moo_extlist
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_ext_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 467 of file moo_extlist.c.

Referenced by moo_extlist_empty().

◆ moo_extlist_unwrap()

void moo_extlist_unwrap ( moo_extlist *  self)

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

Parameters
selfThe DET list or NULL
Returns
Nothing
See also
moo_extlist_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 541 of file moo_extlist.c.

Referenced by moo_extlist_delete().