Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

extract/lib/proc_config.c File Reference

Config related procedures (cf. old tiger_utils.c). More...

Go to the source code of this file.

Defines

#define ERROR_DESC(s)
#define ERROR_DESC(s)

Functions

int read_PSFgeo_param (void *anyfile, double *geo_param[])
int read_PSFglobal_param (void *anyfile, double *psf_param[])
int read_PSFlocal_ng (void *anyfile)
float read_lbdaref (void *anyfile)
 Read reference wavelength in descriptor MPUP_LBDAPUP.

Channel read_channel (void *anyfile)
 Read channel in descriptor CHANNEL.

int read_focus (void *anyfile)
 Read camera/collimator position.

int read_default_snifs_config (const Channel channel, SnifsConfig *config)
 Read default SNIFS configuration.

void optics2dval (const SnifsOptics *Optics, double *dval)
 SnifsOptics structure to double array convertor

void dval2optics (const double dval[], SnifsOptics *Optics)
 Double array to SnifsOptics structure convertor.

int write_snifs_config_to_mask (TABLE *mask, SnifsConfig *config)
 Write configuration structures to mask.

int read_snifs_config_from_mask (TABLE *mask, SnifsConfig *config)
 Set configuration structure from mask.

void print_snifs_optics (const SnifsOptics *Optics)
 Print out a Tiger_optics structure elements.

void print_snifs_telescope (const Telescope *UHT)
 Print out a Telescope structure elements.

void print_snifs_detector (const SnifsDetector *CCD)
 Print out a Detector structure elements.

void print_snifs_config (const SnifsConfig *config)
 Print out the full SNIFS config.


Detailed Description

Config related procedures (cf. old tiger_utils.c).

Copyright:
(c) 2003 CRAL-Observatoire de Lyon
Date:
Fri Nov 12 17:14:11 2004
Author:
Yannick Copin <y.copin@ipnl.in2p3.fr>

Author
ycopin
Version:
Revision
1.23
Id
proc_config.c,v 1.23 2004/11/18 23:03:33 ycopin Exp

Definition in file proc_config.c.


Define Documentation

#define ERROR_DESC  ) 
 

Value:

print_error("Unable to write configuration to mask '%s' "\
              "(desc. '%s')",mask->name,s); return(ERR_BAD_DESC)

#define ERROR_DESC  ) 
 

Value:

print_error("Unable to read configuration from mask '%s' "\
              "(desc. '%s' missing)",mask->name,s); return(ERR_NODESC)


Function Documentation

int read_PSFgeo_param void *  anyfile,
double *  geo_param[]
 

Read the geometric PSF model from descriptors MPUP_NGGEO and MPUP_GEOPAR

Parameters:
anyfile Input file
geo_param Output parameter array (3*nggeo)
Returns:
Number of gaussian components in PSF model (nggeo>0 or -1)
geo_param
Add a description.

Definition at line 36 of file proc_config.c.

References MPUP_GEOPAR, and MPUP_NGGEO.

Referenced by main().

int read_PSFglobal_param void *  anyfile,
double *  psf_param[]
 

Read the global PSF model from descriptors MPUP_NGPSF and MPUP_PSFPAR

Parameters:
anyfile Input file
psf_param Output parameter array (1+2*ngpsf)
Returns:
Number of gaussian components in PSF model (ngpsf>0 or -1)
psf_param
psf_param[0] = geometric pupil scale

Definition at line 70 of file proc_config.c.

References MPUP_NGPSF, and MPUP_PSFPAR.

Referenced by main().

int read_PSFlocal_ng void *  anyfile  ) 
 

Read the number of component in local PSF model from descriptor MPUP_NGLOC

Parameters:
anyfile Input file
Returns:
Number of gaussian components in PSF model (ngloc or MAXINT)

Definition at line 102 of file proc_config.c.

References MPUP_NGLOC.

Referenced by main().

float read_lbdaref void *  anyfile  ) 
 

Read reference wavelength in descriptor MPUP_LBDAPUP.

Definition at line 122 of file proc_config.c.

References MPUP_LBDAPUP.

Referenced by main().

Channel read_channel void *  anyfile  ) 
 

Read channel in descriptor CHANNEL.

Definition at line 149 of file proc_config.c.

References BLUE_CHANNEL, CHANNEL, Channel, channel_names, RED_CHANNEL, and UNKNOWN_CHANNEL.

Referenced by comp_calibration_offsets(), main(), read_focus(), and read_snifs_config_from_mask().

int read_focus void *  anyfile  ) 
 

Read camera/collimator position.

If the focus position xCFOCUS (x=B or R, as read from CHANNEL descriptor) is absent, return the rank of the frame in the calling sequence

Parameters:
anyfile Input file
Returns:
Focus position

Definition at line 195 of file proc_config.c.

References Channel, channel_names, read_channel(), SPECFOC, and UNKNOWN_CHANNEL.

Referenced by main().

int read_default_snifs_config const Channel  channel,
SnifsConfig config
 

Read default SNIFS configuration.

Parameters:
channel Channel
config Configuration
Returns:
Error status
Warning:
This procedure will have to be updated according to the file specifications and headers, to include:
  • update of snifs_instrument::h, including:
    • CCD gains, RON (e.g. standard vs. quick), darks, format
    • Red MLA angle
  • update of structures in tiger_items.h (not yet):
    • Tiger_optics does not include lateral color coefficients
    • Detector does not include ReadOut Noise

Beware the definition of rotz. The dispersion orientation is "red is down, blue is up" (same as OASIS), but to keep the grism orientation rotz around 0 (and not $\pi$), we need to aff $\pi$ in optics_signature::c probably because of internal folding.

Open questions and current answers:

Bug:
In structure Tiger_optics, g_per_mm should be a DOUBLE.

Definition at line 252 of file proc_config.c.

References Grism::A, Telescope::aperture, Grism::blaze, BLUE_CHANNEL, SnifsOptics::camera, SnifsConfig::ccd, CCDB_GAIN, CCDB_NAME, CCDB_NX, CCDB_NY, CCDB_PIX, CCDB_RON, CCDR_GAIN, CCDR_NAME, CCDR_NX, CCDR_NY, CCDR_PIX, CCDR_RON, SnifsOptics::center, Telescope::central_obscuration, SnifsOptics::channel, channel_names, SnifsOptics::collimator, SnifsDetector::dark, DFLT_BLU_CFG_NAME, DFLT_RED_CFG_NAME, CameraCollimator::distor, SnifsOptics::enlarger, SnifsOptics::filter, CameraCollimator::focal, Telescope::fratio, Grism::g_per_mm, SnifsDetector::gain, Grism::grating, SnifsOptics::grism, Material::id, CameraCollimator::LateralColor, material_names, material_sellcoeffs, SnifsOptics::MLA, Material::name, SnifsDetector::name, SnifsConfig::name, SnifsDetector::nx, SnifsDetector::ny, SnifsConfig::optics, SnifsDetector::pixsize, Grism::prism, RED_CHANNEL, SnifsDetector::ron, Grism::rotz, Telescope::scale, Material::sellcoeffs, Grism::set, SNIFS_GAMMA, SNIFS_LENS_MM, SNIFSB_CAM_A1, SNIFSB_CAM_A2, SNIFSB_CAM_A3, SNIFSB_CAM_E, SNIFSB_CAM_F, SNIFSB_COLL_A1, SNIFSB_COLL_A2, SNIFSB_COLL_A3, SNIFSB_COLL_E, SNIFSB_COLL_F, SNIFSB_FILT_E, SNIFSB_FILT_H, SNIFSB_FILT_L, SNIFSB_FILT_S, SNIFSB_GRISM_ANG, SNIFSB_GRISM_BLA, SNIFSB_GRISM_D, SNIFSB_GRISM_GLA, SNIFSB_GRISM_GRA, SNIFSB_GRISM_RES, SNIFSB_LBDA_REF, SNIFSB_LENS_AN, SNIFSB_LENS_PX, SNIFSR_CAM_A1, SNIFSR_CAM_A2, SNIFSR_CAM_A3, SNIFSR_CAM_E, SNIFSR_CAM_F, SNIFSR_COLL_A1, SNIFSR_COLL_A2, SNIFSR_COLL_A3, SNIFSR_COLL_E, SNIFSR_COLL_F, SNIFSR_FILT_E, SNIFSR_FILT_H, SNIFSR_FILT_L, SNIFSR_FILT_S, SNIFSR_GRISM_ANG, SNIFSR_GRISM_BLA, SNIFSR_GRISM_D, SNIFSR_GRISM_GLA, SNIFSR_GRISM_GRA, SNIFSR_GRISM_RES, SNIFSR_LBDA_REF, SNIFSR_LENS_AN, SNIFSR_LENS_PX, SnifsConfig::telescope, Grism::tiltx, Grism::tilty, UHT_COBS, UHT_DIAM, UHT_FOCR, UHT_SCALE, and Grism::w_disp.

Referenced by main().

void optics2dval const SnifsOptics Optics,
double *  dval
 

SnifsOptics structure to double array convertor

Definition at line 433 of file proc_config.c.

References Grism::A, Grism::blaze, SnifsOptics::camera, SnifsOptics::center, SnifsOptics::collimator, CameraCollimator::distor, SnifsOptics::enlarger, SnifsOptics::filter, CameraCollimator::focal, Grism::g_per_mm, SnifsOptics::grism, CameraCollimator::LateralColor, SnifsOptics::MLA, Grism::rotz, Grism::tiltx, Grism::tilty, and Grism::w_disp.

Referenced by write_snifs_config_to_mask().

void dval2optics const double  dval[],
SnifsOptics Optics
 

Double array to SnifsOptics structure convertor.

Definition at line 476 of file proc_config.c.

References Grism::A, Grism::blaze, SnifsOptics::camera, SnifsOptics::center, SnifsOptics::collimator, CameraCollimator::distor, SnifsOptics::enlarger, SnifsOptics::filter, CameraCollimator::focal, Grism::g_per_mm, SnifsOptics::grism, CameraCollimator::LateralColor, SnifsOptics::MLA, Grism::rotz, Grism::tiltx, Grism::tilty, and Grism::w_disp.

Referenced by read_snifs_config_from_mask().

int write_snifs_config_to_mask TABLE *  mask,
SnifsConfig config
 

Write configuration structures to mask.

Parameters:
mask Output mask
config Configuration
Returns:
Status

Bug:
Could there be a bug when char *confname[lg_ident+1] while RD_desc(mask,CONFIG_NAME,CHAR,lg_ident,confname)? Does RD_desc add the null character?

Definition at line 527 of file proc_config.c.

References Telescope::aperture, SnifsConfig::ccd, CCD_NAME, Telescope::central_obscuration, SnifsOptics::channel, CHANNEL, channel_names, CONFIG_NAME, SnifsDetector::dark, DFLT_BLU_CFG_NAME, DFLT_RED_CFG_NAME, Telescope::fratio, SnifsDetector::gain, Grism::grating, SnifsOptics::grism, Material::id, MSK_DCCDPAR, MSK_DOPTPAR, MSK_DTELPAR, MSK_FCCDPAR, MSK_FTELPAR, MSK_ICCDPAR, MSK_IOPTPAR, SnifsDetector::name, SnifsConfig::name, SnifsDetector::nx, SnifsDetector::ny, SnifsConfig::optics, optics2dval(), SnifsDetector::pixsize, Grism::prism, SnifsDetector::ron, Telescope::scale, Grism::set, and SnifsConfig::telescope.

Referenced by main().

int read_snifs_config_from_mask TABLE *  mask,
SnifsConfig config
 

Set configuration structure from mask.

Parameters:
mask Mask
config Configuration
Returns:
Status

Definition at line 639 of file proc_config.c.

References Telescope::aperture, SnifsConfig::ccd, CCD_NAME, Telescope::central_obscuration, SnifsOptics::channel, CONFIG_NAME, SnifsDetector::dark, dval2optics(), Telescope::fratio, SnifsDetector::gain, Grism::grating, SnifsOptics::grism, Material::id, material_names, material_sellcoeffs, MSK_DCCDPAR, MSK_DOPTPAR, MSK_DTELPAR, MSK_FCCDPAR, MSK_FTELPAR, MSK_ICCDPAR, MSK_IOPTPAR, SnifsDetector::name, Material::name, SnifsConfig::name, SnifsDetector::nx, SnifsDetector::ny, SnifsConfig::optics, SnifsDetector::pixsize, Grism::prism, read_channel(), SnifsDetector::ron, Telescope::scale, Material::sellcoeffs, Grism::set, and SnifsConfig::telescope.

Referenced by main().

void print_snifs_optics const SnifsOptics Optics  ) 
 

Print out a Tiger_optics structure elements.

Definition at line 738 of file proc_config.c.

References Grism::A, Grism::blaze, SnifsOptics::camera, SnifsOptics::channel, channel_names, SnifsOptics::collimator, CameraCollimator::distor, SnifsOptics::enlarger, SnifsOptics::filter, CameraCollimator::focal, Grism::g_per_mm, Grism::grating, SnifsOptics::grism, CameraCollimator::LateralColor, SnifsOptics::MLA, Material::name, Grism::prism, Grism::rotz, Grism::tiltx, Grism::tilty, and Grism::w_disp.

Referenced by print_snifs_config().

void print_snifs_telescope const Telescope UHT  ) 
 

Print out a Telescope structure elements.

Definition at line 791 of file proc_config.c.

References Telescope::aperture, Telescope::central_obscuration, Telescope::fratio, and Telescope::scale.

Referenced by print_snifs_config().

void print_snifs_detector const SnifsDetector CCD  ) 
 

Print out a Detector structure elements.

Definition at line 805 of file proc_config.c.

References SnifsDetector::dark, SnifsDetector::gain, SnifsDetector::name, SnifsDetector::nx, SnifsDetector::ny, SnifsDetector::pixsize, and SnifsDetector::ron.

Referenced by print_snifs_config().

void print_snifs_config const SnifsConfig config  ) 
 

Print out the full SNIFS config.

Definition at line 820 of file proc_config.c.

References SnifsConfig::ccd, SnifsConfig::name, SnifsConfig::optics, print_snifs_detector(), print_snifs_optics(), print_snifs_telescope(), and SnifsConfig::telescope.

Referenced by main().


Generated on Tue Nov 23 18:04:21 2004 for Snifs by doxygen 1.3.3