MOONS Pipeline Reference Manual 0.13.2
Functions
RBN_LIST format

Functions

moo_rbnlist * moo_rbnlist_new (void)
 Create a new moo_rbnlist.
 
moo_rbnlist * moo_rbnlist_create (const cpl_frameset *frameset)
 Create a new moo_rbnlist from the given RBN frameset.
 
cpl_error_code moo_rbnlist_load_single (const moo_rbnlist *self, moo_detector_type type, int level)
 Load the type part for all RBN in the rbnlist.
 
cpl_size moo_rbnlist_get_size (const moo_rbnlist *self)
 Get the number of RBN in the rbnlist.
 
moo_rbn * moo_rbnlist_get (moo_rbnlist *self, int i)
 Get the RBN at the position i in the list.
 
hdrl_imagelist * moo_rbnlist_get_image (const moo_rbnlist *self, moo_detector_type type)
 Get the all the images of the type part in the rbnlist.
 
cpl_imagelist * moo_rbnlist_get_single_data (const moo_rbnlist *self, moo_detector_type type)
 Get the type data part for all RBN in the rbnlist.
 
cpl_imagelist * moo_rbnlist_get_single_qual (const moo_rbnlist *self, moo_detector_type type)
 Get the type QUAL part for all RBN in the rbnlist.
 
cpl_error_code moo_rbnlist_set (moo_rbnlist *self, moo_rbn *rbn, cpl_size pos)
 Insert a RBN into an moo_rbnlist.
 
cpl_error_code moo_rbnlist_push (moo_rbnlist *self, moo_rbn *rbn)
 Insert a RBN a the end of moo_rbnlist.
 
moo_rbn * moo_rbnlist_unset (moo_rbnlist *self, cpl_size pos)
 Remove a RBN from a RBN list.
 
void moo_rbnlist_empty (moo_rbnlist *self)
 Empty an moo_rbnlist and deallocate all its RBN.
 
void moo_rbnlist_unwrap (moo_rbnlist *self)
 Free memory used by a moo_rbnlist object, except the RBN.
 
void moo_rbnlist_delete (moo_rbnlist *self)
 Free all memory used by a moo_rbnlist object including the RBN.
 

Detailed Description

Function Documentation

◆ moo_rbnlist_create()

moo_rbnlist * moo_rbnlist_create ( const cpl_frameset *  frameset)

Create a new moo_rbnlist from the given RBN frameset.

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

The returned object must be deallocated using moo_rbnlist_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_rbnlist.c.

References moo_rbn_create(), moo_rbnlist_new(), and moo_rbnlist_push().

◆ moo_rbnlist_delete()

void moo_rbnlist_delete ( moo_rbnlist *  self)

Free all memory used by a moo_rbnlist object including the RBN.

Parameters
selfThe RBN list or NULL
Returns
void
See also
moo_rbnlist_empty(), moo_rbnlist_unwrap() If the RBN_LIST format self is NULL, nothing is done and no error is set.

Definition at line 529 of file moo_rbnlist.c.

References moo_rbnlist_empty(), and moo_rbnlist_unwrap().

◆ moo_rbnlist_empty()

void moo_rbnlist_empty ( moo_rbnlist *  self)

Empty an moo_rbnlist and deallocate all its RBN.

Parameters
selfThe RBN list or NULL
Returns
Nothing
See also
moo_rbnlist_empty(), moo_rbnlist_delete()
Note
If self is NULL nothing is done and no error is set.

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

Definition at line 473 of file moo_rbnlist.c.

References moo_rbn_delete(), and moo_rbnlist_unset().

Referenced by moo_rbnlist_delete().

◆ moo_rbnlist_get()

moo_rbn * moo_rbnlist_get ( moo_rbnlist *  self,
int  i 
)

Get the RBN at the position i in the list.

Parameters
selfthe list of RBN
iposition in the list
Returns
RBN 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 186 of file moo_rbnlist.c.

References moo_rbnlist_get_size().

Referenced by moo_combine_sky().

◆ moo_rbnlist_get_image()

hdrl_imagelist * moo_rbnlist_get_image ( const moo_rbnlist *  self,
moo_detector_type  type 
)

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

Parameters
selfthe list of RBN
typethe type of extension to load
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

Definition at line 212 of file moo_rbnlist.c.

References moo_rbn_get_single(), and moo_rbn_single_get_image().

◆ moo_rbnlist_get_single_data()

cpl_imagelist * moo_rbnlist_get_single_data ( const moo_rbnlist *  self,
moo_detector_type  type 
)

Get the type data part for all RBN in the rbnlist.

Parameters
selfthe list of RBN
typethe type of extension to load
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

Definition at line 260 of file moo_rbnlist.c.

References moo_rbn_get_single(), and moo_rbn_single_get_data().

◆ moo_rbnlist_get_single_qual()

cpl_imagelist * moo_rbnlist_get_single_qual ( const moo_rbnlist *  self,
moo_detector_type  type 
)

Get the type QUAL part for all RBN in the rbnlist.

Parameters
selfthe list of RBN
typethe type of extension to load
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

Definition at line 294 of file moo_rbnlist.c.

References moo_rbn_get_single(), and moo_rbn_single_get_qual().

◆ moo_rbnlist_get_size()

cpl_size moo_rbnlist_get_size ( const moo_rbnlist *  self)

Get the number of RBN in the rbnlist.

Parameters
selfthe list of RBN
Returns
The number of RBN 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 163 of file moo_rbnlist.c.

Referenced by moo_rbnlist_get().

◆ moo_rbnlist_load_single()

cpl_error_code moo_rbnlist_load_single ( const moo_rbnlist *  self,
moo_detector_type  type,
int  level 
)

Load the type part for all RBN in the rbnlist.

Parameters
selfthe list of RBN
typethe type of extension to load
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

Definition at line 104 of file moo_rbnlist.c.

References moo_rbn_load_single().

◆ moo_rbnlist_new()

moo_rbnlist * moo_rbnlist_new ( void  )

Create a new moo_rbnlist.

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

The returned object must be deallocated using moo_rbnlist_delete().

Definition at line 56 of file moo_rbnlist.c.

Referenced by moo_rbnlist_create().

◆ moo_rbnlist_push()

cpl_error_code moo_rbnlist_push ( moo_rbnlist *  self,
moo_rbn *  rbn 
)

Insert a RBN a the end of moo_rbnlist.

Parameters
selfThe moo_rbnlist
rbnThe RBN to insert
Returns
CPL_ERROR_NONE or the relevant cpl_error_code on error
See also
moo_rbnlist_set()

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

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

The added RBN is owned by the moo_rbnlist object, which deallocates it moo_rbnlist_delete is called. Other option is to use moo_rbnlist_unset to recover ownership of the RBN, in which case the moo_rbnlist 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 409 of file moo_rbnlist.c.

References moo_rbnlist_set().

Referenced by moo_rbnlist_create().

◆ moo_rbnlist_set()

cpl_error_code moo_rbnlist_set ( moo_rbnlist *  self,
moo_rbn *  rbn,
cpl_size  pos 
)

Insert a RBN into an moo_rbnlist.

Parameters
selfThe moo_rbnlist
rbnThe RBN to insert
posThe list position (from 0 to number of RBN)
Returns
CPL_ERROR_NONE or the relevant cpl_error_code on error

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

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

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

The added RBN is owned by the moo_rbnlist object, which deallocates it moo_rbnlist_delete is called. Other option is to use moo_rbnlist_unset to recover ownership of the RBN, in which case the moo_rbnlist 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 RBN in rbnlist

Definition at line 345 of file moo_rbnlist.c.

References moo_rbn_delete().

Referenced by moo_rbnlist_push().

◆ moo_rbnlist_unset()

moo_rbn * moo_rbnlist_unset ( moo_rbnlist *  self,
cpl_size  pos 
)

Remove a RBN from a RBN list.

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

The specified RBN is not deallocated, it is simply removed from the list. The pointer to the RBN is returned to let the user decide to deallocate it or not. Eventually, the RBN will have to be deallocated with moo_rbn_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 435 of file moo_rbnlist.c.

Referenced by moo_rbnlist_empty().

◆ moo_rbnlist_unwrap()

void moo_rbnlist_unwrap ( moo_rbnlist *  self)

Free memory used by a moo_rbnlist object, except the RBN.

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

Definition at line 509 of file moo_rbnlist.c.

Referenced by moo_rbnlist_delete().