/* FILE: key_get.c * PURPOSE: Fill a KeyS from parameter values of an IRAF image. * AUTHOR: Kenneth J. Mighell (mighell@noao.edu) * LANGUAGE: ANSI C * DATE: 2001MAY23 * COPYRIGHT: (C) 2001 Assoc. of Universities for Research in Astronomy Inc. */ #include "mx.h" #include "wfpc2color.h" int wfpc2color2_KeyS_Get_i2 ( wfpc2color2_ParS *ParS, int index ){ char mxfunc[] = "wfpc2color2_KeyS_Get_i2"; int status; IRAFPointer ifp; int j; j = index; ParS->KeyS[j].filtnam1_is_INDEF = MX_TRUE; ParS->KeyS[j].exptime_is_INDEF = MX_TRUE; if ( !ParS->image_is_INDEF[j] ) { /* Open the input IRAF image */ ifp = c_immap (ParS->image[j], IRAF_READ_ONLY, 0); if ( mxiraf_cvos_error_check_f0() ) {status = 1; goto mx_error;} c_imgstr( ifp, "FILTNAM1", ParS->KeyS[j].filtnam1, sizeof(ParS->KeyS[j].filtnam1) ); if ( mxiraf_cvos_error_check_f0() ) {status = 2; goto mx_error;} ParS->KeyS[j].filtnam1_is_INDEF = MX_FALSE; ParS->KeyS[j].exptime = c_imgetd( ifp, "EXPTIME" ); if ( mxiraf_cvos_error_check_f0() ) {status = 3; goto mx_error;} ParS->KeyS[j].exptime_is_INDEF = MX_FALSE; ParS->KeyS[j].detector = c_imgeti( ifp, "DETECTOR" ); if ( mxiraf_cvos_error_check_f0() ) {status = 4; goto mx_error;} ParS->KeyS[j].detector_is_INDEF = MX_FALSE; ParS->KeyS[j].atodgain = c_imgetd( ifp, "ATODGAIN" ); if ( mxiraf_cvos_error_check_f0() ) {status = 5; goto mx_error;} ParS->KeyS[j].atodgain_is_INDEF = MX_FALSE; /* Close the input IRAF image */ c_imunmap (ifp); if ( mxiraf_cvos_error_check_f0() ) {status = 6; goto mx_error;} } ok: status = 0; goto bye; mx_error: mxp_errmsg_append_f3 (mxfunc, status, ""); goto bye; mx_error2: mxp_errmsg_append_f3 (mxfunc, status, MX.tmpmsg); goto bye; bye: return(status); } /* end-of-file */