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

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:
Tue Aug 2 02:49:22 2005
Author:
Yannick Copin <y.copin@ipnl.in2p3.fr>

Author
ycopin
Version:
Revision
1.28
Id
proc_config.c,v 1.28 2005/08/02 14:41:42 ycopin Exp

Note:
PSF-related procedures (read_PSFgeo_param, read_PSFglobal_param, read_PSFlocal_ng) are now in proc_psf.c (from 1.28).

Definition in file proc_config.c.


Define Documentation

#define ERROR_DESC  ) 
 

Value:

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

Referenced by read_snifs_config_from_mask(), and write_snifs_config_to_mask().

#define ERROR_DESC  ) 
 

Value:

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


Function Documentation

float read_lbdaref void *  anyfile  ) 
 

Read reference wavelength in descriptor MPUP_LBDAPUP.

Definition at line 33 of file proc_config.c.

References MPUP_LBDAPUP.

Referenced by main().

Channel read_channel void *  anyfile  ) 
 

Read channel in descriptor CHANNEL.

Definition at line 60 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 106 of file proc_config.c.

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

Referenced by main().

Here is the call graph for this function:

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 163 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 344 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 387 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 438 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, ERROR_DESC, 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().

Here is the call graph for this function:

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 550 of file proc_config.c.

References Telescope::aperture, SnifsConfig::ccd, CCD_NAME, Telescope::central_obscuration, SnifsOptics::channel, CONFIG_NAME, SnifsDetector::dark, dval2optics(), ERROR_DESC, 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().

Here is the call graph for this function:

void print_snifs_optics const SnifsOptics Optics  ) 
 

Print out a Tiger_optics structure elements.

Definition at line 649 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 702 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 716 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 731 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().

Here is the call graph for this function:


Generated on Thu Oct 27 00:00:04 2005 for Snifs by doxygen 1.3.5