/* FILE: /mxtools/src/psfstar/psf_open.c * PURPOSE: Open a PSFSTAR PsfS * AUTHOR: Kenneth J. Mighell (mighell@noao.edu) * LANGUAGE: ANSI C * DATE: 2001NOV07 * COPYRIGHT: (C) 2001 Assoc. of Universities for Research in Astronomy Inc. */ #include #include "inc.h" int inc_PsfS_Open_i2 ( inc_ParS *ParS, inc_PsfS *PsfS ){ char mxfunc[] = "inc_PsfS_Open_i2"; int mxstatus=0; int status; IRAFPointer ifp; int debug = MX_TRUE; #define DEBUG (debug==MX_FALSE) strcpy( PsfS->ifn, ParS->psf); mxstatus++; status = mxiraf_image_s_open_f3 (&PsfS->mxIrafImage, PsfS->ifn, IRAF_READ_ONLY); if (status) goto mx_error; ifp = PsfS->mxIrafImage->ptr; PsfS->llx0i = PsfS->mxIrafImage->data->llx0i; PsfS->lly0i = PsfS->mxIrafImage->data->lly0i; PsfS->xdimi = PsfS->mxIrafImage->data->nxi; PsfS->ydimi = PsfS->mxIrafImage->data->nyi; PsfS->nxi = PsfS->xdimi; PsfS->nyi = PsfS->ydimi; PsfS->psf0 = PsfS->mxIrafImage->data; mxstatus++; status = ip_image_s_copy_i2( PsfS->psf0, &PsfS->psf ); if (status) goto mx_error; mxstatus++; status = ip_image_s_copy_i2( PsfS->psf0, &PsfS->PSF ); if (status) goto mx_error; mxstatus++; PsfS->PSF_CPXJ = c_imgeti( ifp, "PSF_CPXJ" ); if ( mxiraf_cvos_error_check_f0() ) goto mx_error; if (DEBUG) printf ("PSF_CPXJ is %d\n", PsfS->PSF_CPXJ); mxstatus++; PsfS->PSF_CPYJ = c_imgeti( ifp, "PSF_CPYJ" ); if ( mxiraf_cvos_error_check_f0() ) goto mx_error; if (DEBUG) printf ("PSF_CPYJ is %d\n", PsfS->PSF_CPYJ); mxstatus++; PsfS->PSF_CPXF = c_imgetd( ifp, "PSF_CPXF" ); if ( mxiraf_cvos_error_check_f0() ) goto mx_error; if (DEBUG) printf ("PSF_CPXF is %g\n", PsfS->PSF_CPXF); mxstatus++; PsfS->PSF_CPYF = c_imgetd( ifp, "PSF_CPYF" ); if ( mxiraf_cvos_error_check_f0() ) goto mx_error; if (DEBUG) printf ("PSF_CPYF is %g\n", PsfS->PSF_CPYF); mxstatus++; PsfS->PSF_CPXP = c_imgetd( ifp, "PSF_CPXP" ); if ( mxiraf_cvos_error_check_f0() ) goto mx_error; if (DEBUG) printf ("PSF_CPXP is %g\n", PsfS->PSF_CPXP); mxstatus++; PsfS->PSF_CPYP = c_imgetd( ifp, "PSF_CPYP" ); if ( mxiraf_cvos_error_check_f0() ) goto mx_error; if (DEBUG) printf ("PSF_CPYP is %g\n", PsfS->PSF_CPYP); mxstatus++; PsfS->PSF_CPXI = c_imgetd( ifp, "PSF_CPXI" ); if ( mxiraf_cvos_error_check_f0() ) goto mx_error; if (DEBUG) printf ("PSF_CPXI is %g\n", PsfS->PSF_CPXI); mxstatus++; PsfS->PSF_CPYI = c_imgetd( ifp, "PSF_CPYI" ); if ( mxiraf_cvos_error_check_f0() ) goto mx_error; if (DEBUG) printf ("PSF_CPYI is %g\n", PsfS->PSF_CPYI); mxstatus++; PsfS->PSF_CWXI = c_imgetd( ifp, "PSF_CWXI" ); if ( mxiraf_cvos_error_check_f0() ) goto mx_error; if (DEBUG) printf ("PSF_CWXI is %g\n", PsfS->PSF_CWXI); mxstatus++; PsfS->PSF_CWYI = c_imgetd( ifp, "PSF_CWYI" ); if ( mxiraf_cvos_error_check_f0() ) goto mx_error; if (DEBUG) printf ("PSF_CWYI is %g\n", PsfS->PSF_CWYI); mxstatus++; PsfS->PSF_NX = c_imgeti( ifp, "PSF_NX" ); if ( mxiraf_cvos_error_check_f0() ) goto mx_error; if (DEBUG) printf ("PSF_NX is %d\n", PsfS->PSF_NX); mxstatus++; PsfS->PSF_NY = c_imgeti( ifp, "PSF_NY" ); if ( mxiraf_cvos_error_check_f0() ) goto mx_error; if (DEBUG) printf ("PSF_NY is %d\n", PsfS->PSF_NY); mxstatus++; PsfS->PSF_MX = c_imgeti( ifp, "PSF_MX" ); if ( mxiraf_cvos_error_check_f0() ) goto mx_error; if (DEBUG) printf ("PSF_MX is %d\n", PsfS->PSF_MX); mxstatus++; PsfS->PSF_MY = c_imgeti( ifp, "PSF_MY" ); if ( mxiraf_cvos_error_check_f0() ) goto mx_error; if (DEBUG) printf ("PSF_MY is %d\n", PsfS->PSF_MY); mxstatus++; if ( PsfS->PSF_MX != PsfS->PSF_MY ) goto mx_error; PsfS->mpxi = PsfS->PSF_MX; printf("PsfS->mpxi is %d\n",PsfS->mpxi); printf("PsfS->PSF_NX is %d\n",PsfS->PSF_NX); printf("PsfS->PSF_NY is %d\n",PsfS->PSF_NY); ok: status = 0; goto bye; mx_error: mxp_errmsg_append_f3 (mxfunc, mxstatus, ""); goto bye; mx_error2: mxp_errmsg_append_f3 (mxfunc, mxstatus, MX.tmpmsg); goto bye; bye: return(status); } #undef DEBUG /* end-of-file */