MOONS Pipeline Reference Manual 0.13.2
Modules | Functions
PSF format

Modules

 PSF_SINGLE format
 

Functions

moo_psf * moo_psf_new (void)
 Create a new moo_psf

 
moo_psf * moo_psf_create (const char *filename)
 Create a new empty PSF filename.
 
moo_psf * moo_psf_load (const cpl_frame *psfframe)
 Load a PSF frame and create a moo_psf.
 
moo_psf_single * moo_psf_get_single (moo_psf *self, moo_detector_type type, int ntas)
 Get a PSF single from PSF.
 
cpl_error_code moo_psf_set_single (moo_psf *self, moo_detector_type type, int ntas, moo_psf_single *single)
 assign moo_psf_single structure in moo_psf structure
 
cpl_error_code moo_psf_add_single (moo_psf *self, moo_psf_single *single, moo_detector_type type, int ntas)
 Add PSF_SINGLE extension to PSF filename and update moo_psf structure.
 
void moo_psf_delete (moo_psf *self)
 Delete a moo_psf.
 
void moo_psf_save (moo_psf *self, const char *filename)
 Save a moo_psf to a FITS file.
 
cpl_error_code moo_psf_dump (const moo_psf *self, FILE *stream)
 Dump structural information of PSF.
 

Detailed Description

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

Functionality include:

Synopsis:
#include "moo_psf.h"

Function Documentation

◆ moo_psf_add_single()

cpl_error_code moo_psf_add_single ( moo_psf *  self,
moo_psf_single *  single,
moo_detector_type  type,
int  ntas 
)

Add PSF_SINGLE extension to PSF filename and update moo_psf structure.

Parameters
selfmoo_psf structure to update
typetype of detector
ntasnumber of spectrographs
singlePSF_SINGLE extension to store on PSF file

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

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 228 of file moo_psf.c.

References moo_psf_set_single(), and moo_psf_single_save().

Referenced by moo_model_flat().

◆ moo_psf_create()

moo_psf * moo_psf_create ( const char *  filename)

Create a new empty PSF filename.

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

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

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 82 of file moo_psf.c.

References moo_fits_create(), and moo_psf_new().

Referenced by moo_model_flat().

◆ moo_psf_delete()

void moo_psf_delete ( moo_psf *  self)

Delete a moo_psf.

Parameters
selfmoo_psf to delete
Returns
void

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

Definition at line 264 of file moo_psf.c.

References moo_psf_single_delete().

◆ moo_psf_dump()

cpl_error_code moo_psf_dump ( const moo_psf *  self,
FILE *  stream 
)

Dump structural information of PSF.

Parameters
selfPSF 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 333 of file moo_psf.c.

◆ moo_psf_get_single()

moo_psf_single * moo_psf_get_single ( moo_psf *  self,
moo_detector_type  type,
int  ntas 
)

Get a PSF single from PSF.

Parameters
selfmoo_psf structure to use
typetype of detector
ntasnumber of spectrographs
Returns
PSF_SINGLE

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

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 151 of file moo_psf.c.

References MOO_TYPE_H, MOO_TYPE_RI, and MOO_TYPE_YJ.

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

◆ moo_psf_load()

moo_psf * moo_psf_load ( const cpl_frame *  psfframe)

Load a PSF frame and create a moo_psf.

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

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

References moo_detector_get_extname(), moo_psf_new(), moo_psf_single_create(), MOO_TYPE_H, MOO_TYPE_RI, and MOO_TYPE_YJ.

◆ moo_psf_new()

moo_psf * moo_psf_new ( void  )

Create a new moo_psf

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

The returned object must be deallocated using moo_psf_delete().

Definition at line 65 of file moo_psf.c.

Referenced by moo_psf_create(), and moo_psf_load().

◆ moo_psf_save()

void moo_psf_save ( moo_psf *  self,
const char *  filename 
)

Save a moo_psf to a FITS file.

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

Definition at line 300 of file moo_psf.c.

References moo_psf_single_save().

◆ moo_psf_set_single()

cpl_error_code moo_psf_set_single ( moo_psf *  self,
moo_detector_type  type,
int  ntas,
moo_psf_single *  single 
)

assign moo_psf_single structure in moo_psf structure

Parameters
selfmoo_psf structure to update
typetype of detector
ntasnumber of spectrographs
singlemoo_psf_single structure

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

  • CPL_ERROR_NULL_INPUT if an input pointer is NULL

Definition at line 183 of file moo_psf.c.

References MOO_TYPE_H, MOO_TYPE_RI, and MOO_TYPE_YJ.

Referenced by moo_psf_add_single().