/******************************************************************************* * E.S.O. - VLT project * * "@(#) $Id: AP_list.h,v 2.43 2004/06/17 23:04:26 vltsccm Exp $" * * who when what * -------- -------- ---------------------------------------------- * hummel 02/03/98 created * aaguayo 28/10/03 PPRS 10127 - added Simple method */ /************************************************************************ * *---------------------------------------------------------------------- */ #ifndef __cplusplus #error This is a C++ include file and cannot be used from plain C #endif #include #include "AP_mask.h" //---------------- class TARG_set : public AP_mask { //---------------- /* this class maintains a pointer array of targets the targets are defined in AP_target.h the class is able to read the target list from an external file. The purpose if this class is to compare the target list with an instrumental mask (here the VLT-UT1-FORS1-MOS mask). and find a optimum position in that way to minimize the number of matches (observing blocks). */ private: /* array of 2000 pointers */ TARG *targ[2000]; static int counter; float ra_min,ra_max,dec_mima; // CCD window in arcsec int hrcoll; // 1_hr_coll 0=sr_coll float best_ra,best_dec,best_rot; // optimized position float best_px,best_py; // optimized position float as2pix; // scale arcsec to pixel float PW_rot; // angle between pixel coords and wcs = CROTA1 float MP_rot; // position angle of the mask int flag[1000]; // contains the target list index int pmos; // 0=mos 1=pmos int kind; // 0=static 1=shift 2=rotat 3=all int exposure_counter; // as in the tcl script fims.tcl float alp0,del0; // for static method float px0,py0; // for static method int x_ra_scale; // +-1 for inverse coords float fits_x_scale, fits_y_scale;// coord orient float slit_width; // MOS/MXU slit width, parsed to output float slit_length; // MXU common slit length, used in pixel_mxu_quality float focscale; // in arcsec / mm (~1.89) int x_flag; // used by pixel_mos_quality when calling AP_mask int FORS; // 1 or 2, (FORS1 or FORS2), parsed to output float wcs_quality(float mask_ra, float mask_dec); // returns the number of matches for a // non-rotated mask (SHIFT-option); // input is the mask position float pixel_mos_quality(float mask_x, float mask_y, float mask_rot); // returns the number of matches for a // rotated mask float pixel_mxu_quality(float mask_x, float mask_y, float mask_rot, int f); // returns the number of mxu slits for a // rotated mask void Static_Method(); // just calls pixel_mos_quality with given mask // coordinates void Simple_Method(); void Rotat_Method(); // loop in position angle and // just calls pixel_mos_quality with given mask // coordinates void Shift_Method(); // simple fit method for option SHIFT // Puts the mask on the target coords of all // just calls pixel_mos_quality with given mask // coordinates void Shift_Method_ATF(); // simple fit method for option SHIFT // Puts the mask on the target coords of all // members of the pointer list // ATF= All Targets Fit void NoNameFitMethod(); // ................. //---------- public: //---------- // basic list methods void add(char* ltn, float lta, float ltd, float ltx, float lty, float ltm, int ltp); // add one target to the pointer list void print(); // print the whole pointer list; void delete_all(); // delete the whole pointer list; void set_by_index(int i, char* ltn="ds", float lta=0.0, float ltd=0.0, float ltx=0.0, float lty=0.0, float ltm=0.0, int ltp=9); // edit individual target void delete_by_index(int indax); // delete individual target from list float a_mean(); // returns the mean (average) RA value of the list float d_mean(); // returns the mean (average) DEC value of the list float x_mean(); // returns the mean (average) x pixel value of the list float y_mean(); // returns the mean (average) y pixel value of the list // particular MOS applications void load_from_file (char *filename); // open file, read control parameters, read list, create // pointer list void SaveBest(char *filename, int slits[]); // open file mos(1/2).counter.autopos.fims // use ESO-VLTSW format for target aquisition files // saves the best mask position // saves the best slit-let positions // saves the target id for each MOS-slit void SaveBest_simple(char *filename, int slits[]); void fit_list(); // selects one of the fitting methods // dependent on private variable kind // constructor TARG_set(); }; // end of class