MOONS Pipeline Reference Manual 0.13.1
Modules | Functions
LOC format

Modules

 LOC_SINGLE format
 

Functions

moo_loc * moo_loc_new (void)
 Create a new moo_loc.
 
moo_loc * moo_loc_create (const char *filename)
 Create a new empty LOC filename.
 
moo_loc * moo_loc_load (const cpl_frame *locframe)
 Load a LOC frame and create a moo_loc.
 
moo_loc_single * moo_loc_get_single (moo_loc *self, moo_detector_type type, int ntas)
 Get the type part in LOC and return it.
 
cpl_error_code moo_loc_set_single (moo_loc *self, moo_detector_type type, int ntas, moo_loc_single *single)
 assign moo_loc_single structure in moo_loc structure
 
cpl_error_code moo_loc_add_single (moo_loc *self, moo_loc_single *single, moo_detector_type type, int ntas, int keep_points)
 Add LOC_SINGLE extension to LOC filename and update moo_loc structure.
 
cpl_error_code moo_loc_add_fibre_table (moo_loc *self, cpl_table *fibre_table)
 Add fibre table to LOC filename and update moo_loc structure.
 
cpl_table * moo_loc_get_fibre_table (moo_loc *self)
 Get the FIBRE TABLE in LOC.
 
void moo_loc_delete (moo_loc *self)
 Delete a moo_loc.
 
void moo_loc_save (moo_loc *self, const char *filename, int keep_points)
 Save a moo_loc to a FITS file.
 
cpl_error_code moo_loc_dump (const moo_loc *self, FILE *stream)
 Dump structural information of LOC.
 

Detailed Description

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

Functionality include:

Synopsis:
#include "moo_loc.h"

Function Documentation

◆ moo_loc_add_fibre_table()

cpl_error_code moo_loc_add_fibre_table ( moo_loc *  self,
cpl_table *  fibre_table 
)

Add fibre table to LOC filename and update moo_loc structure.

Parameters
selfmoo_loc structure to update
fibre_tablefibre table to store on LOC file

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

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 271 of file moo_loc.c.

◆ moo_loc_add_single()

cpl_error_code moo_loc_add_single ( moo_loc *  self,
moo_loc_single *  single,
moo_detector_type  type,
int  ntas,
int  keep_points 
)

Add LOC_SINGLE extension to LOC filename and update moo_loc structure.

Parameters
selfmoo_loc structure to update
typetype of detector
ntasnumber of spectrographs
keep_pointskeep measured points
singleLOC_SINGLE extension to store on LOC file

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

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 234 of file moo_loc.c.

References moo_loc_set_single(), and moo_loc_single_save().

◆ moo_loc_create()

moo_loc * moo_loc_create ( const char *  filename)

Create a new empty LOC filename.

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

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

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 83 of file moo_loc.c.

References moo_loc_new().

◆ moo_loc_delete()

void moo_loc_delete ( moo_loc *  self)

Delete a moo_loc.

Parameters
selfmoo_loc to delete
Returns
void

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

Definition at line 332 of file moo_loc.c.

References moo_loc_single_delete().

Referenced by moo_localise().

◆ moo_loc_dump()

cpl_error_code moo_loc_dump ( const moo_loc *  self,
FILE *  stream 
)

Dump structural information of LOC.

Parameters
selfLOC 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 413 of file moo_loc.c.

References moo_loc_single_dump().

◆ moo_loc_get_fibre_table()

cpl_table * moo_loc_get_fibre_table ( moo_loc *  self)

Get the FIBRE TABLE in LOC.

Parameters
selfthe LOC
Returns
The FIBRE TABLE

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 306 of file moo_loc.c.

Referenced by moo_compute_p2p(), moo_extract(), moo_model_flat(), and moo_reproject_model().

◆ moo_loc_get_single()

moo_loc_single * moo_loc_get_single ( moo_loc *  self,
moo_detector_type  type,
int  ntas 
)

Get the type part in LOC and return it.

Parameters
selfthe LOC
typethe type of detector to get
ntasthe TAS number [1,2]
Returns
the loc_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 155 of file moo_loc.c.

References MOO_TYPE_H, MOO_TYPE_RI, and MOO_TYPE_YJ.

Referenced by moo_compute_p2p(), moo_compute_slitoffset(), moo_extract(), moo_flat_shift_compute(), moo_model_flat(), and moo_reproject_model().

◆ moo_loc_load()

moo_loc * moo_loc_load ( const cpl_frame *  locframe)

Load a LOC frame and create a moo_loc.

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

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

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 109 of file moo_loc.c.

References moo_detector_get_extname(), moo_loc_new(), moo_loc_single_create(), MOO_TYPE_H, MOO_TYPE_RI, and MOO_TYPE_YJ.

Referenced by moo_localise().

◆ moo_loc_new()

moo_loc * moo_loc_new ( void  )

Create a new moo_loc.

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

The returned object must be deallocated using moo_det_delete().

Definition at line 66 of file moo_loc.c.

Referenced by moo_loc_create(), and moo_loc_load().

◆ moo_loc_save()

void moo_loc_save ( moo_loc *  self,
const char *  filename,
int  keep_points 
)

Save a moo_loc to a FITS file.

Parameters
selfmoo_loc to write to disk or NULL
filenameName of the file to write
keep_points1 to save the localise points use for the fit or 0 if not
Returns
CPL_ERROR_NONE or the relevant cpl_error_code on error

This function saves a moo_loc to a FITS file, using cfitsio. Only not NULL extensions are written.

Definition at line 372 of file moo_loc.c.

References moo_loc_single_save().

Referenced by moo_products_add_loc().

◆ moo_loc_set_single()

cpl_error_code moo_loc_set_single ( moo_loc *  self,
moo_detector_type  type,
int  ntas,
moo_loc_single *  single 
)

assign moo_loc_single structure in moo_loc structure

Parameters
selfmoo_loc structure to update
typetype of detector
ntasnumber of spectrographs
singlemoo_loc_single structure

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

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 188 of file moo_loc.c.

References MOO_TYPE_H, MOO_TYPE_RI, and MOO_TYPE_YJ.

Referenced by moo_loc_add_single().