MOONS Pipeline Reference Manual 0.13.2
Macros | Functions
RESP format

Macros

#define MOO_RESP_EXT_RI   "RI"
 RESPONSE format.
 

Functions

moo_resp * moo_resp_new (void)
 Create a new moo_resp.
 
cpl_error_code moo_resp_set_table (moo_resp *self, moo_detector_type type, cpl_table *t)
 assign table in moo_resp
 
cpl_table * moo_resp_get_table (moo_resp *self, moo_detector_type type)
 Get a reponse table from RESP.
 
moo_resp * moo_resp_create (moo_scilist *scilist, int badpix_level)
 Prepare RESP for SCI frame.
 
void moo_resp_delete (moo_resp *self)
 Delete a moo_resp.
 
void moo_resp_save (moo_resp *self, const char *filename)
 Save a moo_resp to a FITS file.
 
moo_resp * moo_resp_load (const cpl_frame *frame)
 Load a RESP frame and create a moo_resp.
 
const char * moo_resp_get_colname (moo_resp *self, int idrbn, int fspectro)
 Get the name of the response colname for a given indexrbn.
 

Detailed Description

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

Functionality include:

Synopsis:
#include "moo_resp.h"

Function Documentation

◆ moo_resp_create()

moo_resp * moo_resp_create ( moo_scilist *  scilist,
int  badpix_level 
)

Prepare RESP for SCI frame.

Parameters
scilistthe SCI list from where we computed the rsponse
badpix_levellevel of bad pixel
Returns
create table for response

Error code:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 158 of file moo_resp.c.

References moo_pfits_get_cd1_1(), moo_pfits_get_crpix1(), moo_pfits_get_crval1(), moo_resp_new(), moo_resp_set_table(), moo_sci_get_target_table(), moo_sci_load_single(), moo_sci_single_get_header(), moo_sci_single_get_image(), moo_scilist_get(), moo_scilist_get_size(), and moo_target_table_find_target().

Referenced by moo_compute_resp().

◆ moo_resp_delete()

void moo_resp_delete ( moo_resp *  self)

Delete a moo_resp.

Parameters
selfmoo_resp to delete
Returns
void

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

Definition at line 320 of file moo_resp.c.

Referenced by moo_resp_load().

◆ moo_resp_get_colname()

const char * moo_resp_get_colname ( moo_resp *  self,
int  idrbn,
int  fspectro 
)

Get the name of the response colname for a given indexrbn.

Parameters
selfthe response
idrbnthe indexrbn of the spectra
fspectrothe SPECTRO (1, 2)
Returns
CPL_ERROR_NONE or the relevant cpl_error_code on error

Definition at line 454 of file moo_resp.c.

Referenced by moo_calib_flux().

◆ moo_resp_get_table()

cpl_table * moo_resp_get_table ( moo_resp *  self,
moo_detector_type  type 
)

Get a reponse table from RESP.

Parameters
selfmoo_resp structure
typetype of detector
Returns
cpl table

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 124 of file moo_resp.c.

References MOO_TYPE_H, MOO_TYPE_RI, and MOO_TYPE_YJ.

Referenced by moo_calib_flux(), and moo_compute_resp().

◆ moo_resp_load()

moo_resp * moo_resp_load ( const cpl_frame *  frame)

Load a RESP frame and create a moo_resp.

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

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

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 401 of file moo_resp.c.

References moo_resp_delete(), MOO_RESP_EXT_RI, and moo_resp_new().

◆ moo_resp_new()

moo_resp * moo_resp_new ( void  )

Create a new moo_resp.

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

The returned object must be deallocated using moo_resp_delete().

Definition at line 66 of file moo_resp.c.

Referenced by moo_resp_create(), and moo_resp_load().

◆ moo_resp_save()

void moo_resp_save ( moo_resp *  self,
const char *  filename 
)

Save a moo_resp to a FITS file.

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

Definition at line 354 of file moo_resp.c.

References MOO_RESP_EXT_RI.

Referenced by moo_products_add_resp().

◆ moo_resp_set_table()

cpl_error_code moo_resp_set_table ( moo_resp *  self,
moo_detector_type  type,
cpl_table *  t 
)

assign table in moo_resp

Parameters
selfmoo_resp
typethe detcor type
tthe table

Possible cpl_error_code set in this function:

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 85 of file moo_resp.c.

References MOO_TYPE_H, MOO_TYPE_RI, and MOO_TYPE_YJ.

Referenced by moo_resp_create().