MOONS Pipeline Reference Manual 0.13.2
Functions
CUBE format

Functions

moo_cube * moo_cube_new (void)
 Create a new moo_cube.
 
cpl_error_code moo_cube_set_data (moo_cube *self, moo_detector_type type, int ntas, cpl_imagelist *data, cpl_propertylist *header)
 set cube data for relevant extension
 
cpl_error_code moo_cube_add_data (moo_cube *self, cpl_imagelist *list, moo_detector_type type, int ntas)
 Add CPL_IMAGELIST extension to CUBE filename and update moo_cube structure.
 
void moo_cube_save (moo_cube *self, const char *filename)
 Save a moo_cube to a FITS file.
 
cpl_error_code moo_cube_normalise (moo_cube *self, moo_saturate_map *map)
 Normalise a moo_cube using saturate map.
 
moo_cube * moo_cube_merge (moo_cube *cubea, moo_saturate_map *saturatea, moo_cube *cubeb, moo_saturate_map *saturateb)
 Merging two cubes.
 
void moo_cube_delete (moo_cube *self)
 Delete a moo_cube.
 

Detailed Description

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

Functionality include:

Synopsis:
#include "moo_cube.h"

Function Documentation

◆ moo_cube_add_data()

cpl_error_code moo_cube_add_data ( moo_cube *  self,
cpl_imagelist *  list,
moo_detector_type  type,
int  ntas 
)

Add CPL_IMAGELIST extension to CUBE filename and update moo_cube structure.

Parameters
selfmoo_cube structure to update
listCPL_IMAGELIST extension to store
typetype of detector
ntasnumber of spectrographs

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 147 of file moo_cube.c.

References moo_cube_set_data(), and moo_detector_get_extname().

◆ moo_cube_delete()

void moo_cube_delete ( moo_cube *  self)

Delete a moo_cube.

Parameters
selfmoo_cube to delete
Returns
void

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

Definition at line 343 of file moo_cube.c.

Referenced by moo_correct_detlin().

◆ moo_cube_merge()

moo_cube * moo_cube_merge ( moo_cube *  cubea,
moo_saturate_map *  saturatea,
moo_cube *  cubeb,
moo_saturate_map *  saturateb 
)

Merging two cubes.

Parameters
cubeamoo_cube to merge
saturateaSATURATE MAP from cubea
cubebmoo_cube to merge
saturatebSATURATE MAP from cubeb
Returns
the merging cube or NULL

Definition at line 312 of file moo_cube.c.

References moo_cube_new().

◆ moo_cube_new()

moo_cube * moo_cube_new ( void  )

Create a new moo_cube.

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

The returned object must be deallocated using moo_cube_delete().

Definition at line 66 of file moo_cube.c.

Referenced by moo_cube_merge().

◆ moo_cube_normalise()

cpl_error_code moo_cube_normalise ( moo_cube *  self,
moo_saturate_map *  map 
)

Normalise a moo_cube using saturate map.

Parameters
selfmoo_cube to normalise
mapSATURATE MAP to use
Returns
CPL_ERROR_NONE or the relevant cpl_error_code on error

Definition at line 238 of file moo_cube.c.

◆ moo_cube_save()

void moo_cube_save ( moo_cube *  self,
const char *  filename 
)

Save a moo_cube to a FITS file.

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

Definition at line 191 of file moo_cube.c.

References moo_detector_get_extname(), and moo_fits_write_extension_cube().

Referenced by moo_products_add_cube().

◆ moo_cube_set_data()

cpl_error_code moo_cube_set_data ( moo_cube *  self,
moo_detector_type  type,
int  ntas,
cpl_imagelist *  data,
cpl_propertylist *  header 
)

set cube data for relevant extension

Parameters
self
typethe detector type
ntasnumber of TAS
datathe cube data
headerthe cube header
Returns
error code

Definition at line 119 of file moo_cube.c.

Referenced by moo_cube_add_data().