Files for the CDS Command Preparation Tool ------------------------------------------ 19/2/96 Incorporated update_dex routine. Re-instated dexwin_id database. 2/2/96 Fixed string array problem in fileout causing PSLOAD errors. 31/1/96 Incorporated changes to GSET database. Made initialization of series_id, raster_id, vdswin_id databases safer. 29/1/96 Added ADJUST_ALLOWED keyword to CPT. 17/1/96 Added 1 second delays between GIS commands to try to cure CNA problem. 16/1/96 Shortened command delay after GIS LUT command. Created macro_wait. 15/1/96 Removed RBOTH command from each study. Added 2 second wait after GIS checksum calculation command. Only output OPS and slitn commands in TTC file if necessary, 2/1/96 Modified cp_get_load for special cases. Checked which GIS detectors in use for each raster and for each GSET ID. Tidied up flag study logic. 14/12/95 Incorporated reverse study processing. Renamed do_previous to do_following. 13/12/95 Added routine do_gset_ttc to wr_ttc_file. 12/12/95 Added do_flag_receiver, do_flag_master to wr_series_file. Added do_gset_on, do_gset_off. 6/12/95 Added engineering stuff to wr_series_file, cpt_details. Created routine do_engineering, do_gset_init. Added deferred pointing to series_id database and series_structure -- cpt, cpt_details, cpt_flags, get_series_info, get_series_id, wr_series_file. 5/12/95 Added mirror and slit positions to wr_series_file, do_raster. Changed to mirror and slit spans : cpt_details, cpt_flags, cpt, wr_series_file. do_raster : Changed so that does not send OPS or slit number commands if already at required location. Created get_slitp_delay. get_slitn_delay : modified state database indices. 1/12/95 Added range to series stable structure : cpt. 29/11/95 Removed dexiwn_id database and associated get_dexwin_id.pro, get_cdhs_dexwin.pro routines and retrieved old version of get_dexwin_info. Modified init_cp_db and fini_cp_db. Added engineering studies database. 24/11/95 Modified so that CVT files have .dt extension : wr_series_file, wr_raster_file, wr_dexwin_file, wr_vdswin_file, do_previous, init_cp_db. wr_series_file : Modified format for series table commands. do_raster : Modified format for series table commands. do_previous : Modified format for series table commands. 23/11/905 cpt_details : Fixed bug in raster span calculation. Fixed bug in initializing current_state. Removed state from argument list. cpt_flags : Fixed bug in raster span calculation cpt : Removed state from argument list. Put initial state into SERIES_STRUCTURE. cp_get_load : Changed format of update file. 21/11/95 cpt : Modified so that VDS_STATE is part of vdswin structure and vdswin_id database. cpt_details : Modified so that VDS_STATE is part of vdswin structure and vdswin_id database. Added so that IEF scheme only used for right detector. cpt_flags : Modified so that VDS_STATE is part of vdswin structure and vdswin_id database. wr_vdswin_file : Fixed bug due to table length not being written out. init_cp_db : Added dexwin and vdswin databases fini_cp_db : Added dexwin and vdswin databases 7/11/95 Wrote routine cp_get_entry.pro. Added GSET_ID to the current state structure and to series_id database. Fiddled with logic of repeat studies and repeat pointings. Created routine do_previous.pro . Improved add_ief. Re-instated vdswin_id and dexwin_id databases. Added routines get_vdswin_id and get_dexwin_id to access them. cpt : Add mechanism for clearing out macro stores prior to load. Added gset_id. Removed .dur tag from SERIES_STRUCTURE. Added emergency to wr_ttc_file. op_ltb_file : Added new input to allow clearing of all macro table IDs. emergency_study : Modified to use cp_get_entry. get_home_pos : Modified to use cp_get_entry. Added gset_id. get_ops_delay : Modified to use cp_get_entry. get_ops_pos : Modified to use cp_get_entry. get_slitn_delay : Modified to use cp_get_entry. wr_raster_file : Modified to use cp_get_entry. Changed so that will write out table if already loaded. cpt_details : Added gset_id to state structure and series_id database. Used fstate to carry the current_state to wr_series_file. Removed .dur tag from series. Updated .time tag to incorporate timings within repeats. Changed to hard fail on bad .repn wr_series_file : Added gset_id to state structure. Added position commands to previous study and update of istate if non time-tagged study. Removed check on usable study. Added do_previous. Added extra length to study with nsfs. Added flag_master_info. wr_vdswin_file : Modified printout. Changed so that will write out table if already loaded. Added flag_master_info. wr_dexwin_file : Modified printout. Changed so that will write out table if already loaded. do_raster : Added gset_id. Modified treatment of pointing. get_series_info : Added gsetid. get_series_id : Added gsetid. cpt_flags : Added checks on study. Removed .dur tag from SERIES_STRUCTURE. Changed to hard fail on bad .repn add_ief : Added logic to deal with IEFWIN_ID set wr_ttc_file : Modified sequential study printout. Modified sequential study calculation and mechanism for repeats. Added emergency keyword. get_vdswin_info : Added get_vdswin_id. get_dexwin_info : Added get_dexwin_id. 6/11/95 Modified way in which init_cp_db initializes databases. Introduced routines start_db and end_db into init_cp_db and fini_cp_db. Fixed some of the series commands in wr_series_file and do_raster which did not have CB5SICs associated with them. Modified way in which deals with flag receiver state. 3/11/95 get_home_pos : Changed so that detector is now a character. cpt_flags : Changed so that returns only the flag study array. cpt : Changed argument list for cpt_flags and flag study logic. wr_series_file : Changed flag receiver logic so that does not assume flag study uses same detector as current study (but not commands). Changed so that CB5FILSE uses hex rather than mnemonic. get_raster_info : Modified printout so that masks of IEF bits in repn. get_cdhs_index : Added /silent keyword to dbbuild. get+series_info : modified printout. Added compile.pro to compile all code. Noted that have previously moved get_cdhs_series and get_cdhs_raster to general access directory. 2/11/95 cpt : Added logic for flag repointing and changed emergency study logic slightly. cpt_details : Changed emergency study logic slightly. wr_series_file : Explicitly disabled SFT if not used. Added logic for dealing with IEF repointing. Added flag master logic for getting IEF table. 23/10/95 Renamed environment variables in : cp_get_load, init_cp_db, op_ltb_file, wr_dexwin_file, wr_raster_file, wr_series_file, wr_ttc_file, wr_vdswin_file. Added routines add_ief, add_iefwin, add_ieftab, get_ief, get_iefwin, get_ieftab, def_ief. Added /silent to dbbuild in get_series_id, get_raster_id. 31/10/95 Added /emergency keyword to cpt and cpt_details. 1/11/95 Added logic to recognize full VDS CCD frame and not add in VDS offsets : cpt_details ; cpt_flags. 18/10/95, MKC Added VDS centre line to VDS_STATE and corrected bug in code to do with how offsets added in. cpt_details : Corrected addition of VDS_OFFSETS and vds_centre tag logic. cpt_flags : Corrected addition of VDS_OFFSETS and vds_centre tag logic. cp_get_study : Added VDS_CENTRE tag to structure. Changed state database name to cp_state from cp_input_wd. cp_state : Added check that pnumber and numberp are consistent when data saved and retrieved. cp_add_mnemonic : Added check that pnumber and numberp are consistent. cp_get_mnemonic : Added check that pnumber and numberp are consistent. Created databases : IEFTAB and IEFWIN. 12/10/95, MKC Corrected flag study behaviour. wr_series_file : Added flag study tag to do_raster call. do_raster : Added flag study flag to argument list. 11/10/95, MKC Correct bugs in GIS exposure time and slit number. cpt_details : Corrected bug dealing with GIS exposure time. cpt_flags : Corrected bug dealing with GIS exposure time. set_exposure : Added GIS exposure time. wr_ttc_file : Modified so that printout for non time tagged studies better reflects the true state of things 28/11/94 This software version is that used for the first EOF integration test at Goddard in November 1994. 30/11/94 Included proforma in each routine. 6/2/95 DJP reported bug in getnextperiod.pro when endofperiod not specified. Bug corrected. Changed startofperiod in wr_ltb_file and wr_ttc_file arguments to be in string format and changed cpt to reflect this. Corrected bug in proforma of wr_series_file.pro. Changed init_cp_db.pro so that only deletes CVT file when initializing. 16/02/95 Changed series table overflow warning in fileout.pro Changed get_chds_id.pro so that IDs start at some offset. Changed comments slightly in do_raster.pro Removed non time-tagged study option from cpt.pro, chk_fund_series.pro, wr_series_file.pro Changed so that outputs study ID rather than study number to series files. 20/2/95 Changed comments slightly in do_raster.pro Set number of times raster to be run to n_repeat_r for now. 2/3/95 Changed raster tag .ntimes to .repn and added .repn, .sft tags to each cpt table structure : affects cpt, wr_raster_file, do_raster, get_table_info, get_table_id. Modified tableID database to include REPN and SFT elements. Changed get_cdhs_info, get_cdhs_id to reflect database change. Removed chk_fund_raster and changed chk_fund_series. Changed get_table_info and get_cdhs_id to remove dexwin and vdswin tables from tableID database. Removed .var tag from dexwin and vdswin structures : cpt, wr_vdswin_file, wr_dexwin_file. Changed wr_vdswin_file to use routine get_vds_win. 6/3/95 Added NOW keyword to cpt and getnextperiod. Added state structure to cpt, wr_series_file and do_raster. Added raster.exptm and raster.expunits to raster info : cpt, wr_series_file, do_raster, wr_raster_file. Implemented the solar feature tracking commands in do_raster. Calculated delay for ops and slitn movements using get_ops_delay and get_slitn_delay in do_raster. Added print out of files deleted with /new. 14/3/95 Used NINT rather than FIX for real to int conversion. 15/3/95 Corrected VDS exposure command to use CB5SIC. 21/3/95 cpt.pro : Re-incorporated var_rasters code. Incorporated series repeat number : n_repeat_s. Removed indeces store for series and rasters. wr_ttc_file.pro : Incorporated n_repeat_s. get_table_info.pro : Modified printout. 23/3/95 wr_dexwin_file : removed ll_title from display. wr_raster_file : removed ll_title from display. do_raster : corrected vds exposure command. 27/3/95 do_raster, wr_series_file : Added CB5SIC command mnemonic init_cp_db : changed to allow commprep and tableID databases to be referenced separately from other databases chk_fund_series : changed to reflect new study database tags. cpt : Incorporated changes to database with regards to var_raster 18-21/4/95 Updated software to comply with the new planning databases. Split tableID into two new databases seriesID and rasterID. Implemented the deferred and offset pointing options. Added new procedures : get_series_info, get_series_id, get_raster_info, get_raster_id, get_vdswin_info, get_dexwin_info. Removed procedures : get_cdhs_info, get_cdhs_id. Specific changes : cpt : Used details structure as well as details_list structure since need pointings. Split tableID database into three different databases. Split get_table_info into four different routines. Changed series and raster structure tags. Changed state tags to solarx and solary. Added deferred pointing logic. Modified calls to get_raster_info, wr_raster_file, get_dexwin_info, wr_dexwin_file, get_vdswin_info, wr_vdswin_file, get_series_info, wr_series_file. Changed use of state structure. wr_series_file : Added deferred pointing structure and updated do_raster. Removed variable rasters and n_pointings tags in study details from display. Used new versions of get_series_id and get_cdhs_index. Changed output lay out. Modified argument list. Removed fundamental flag in do_raster. Removed state structure from argument list. Used STRTRIM. wr_raster_file : Modified argument list. wr_dexwin_file : Modified argument list. wr_vdswin_file : Modified argument list. wr_ttc_file : Removed series.repn tag. Inputted sciplan details list. Incorporated deferred pointing. Included state structure in input list. get_cdhs_index : Separated table type into another input. init_cp_db : Split tableID database into two : seriesID and rasterID. Changed directory logic. get_ops_delay : Removed maximum flag. get_slitn_delay: Removed maximum flag. get_version : Separated type from structure. Modified argument list. chk_fund_series: Changed to reflect new database tags. 28/4/95 Added -nosend option to CB5SIC in do_raster.pro. 15/5/95 Added time_tagged option back in : chk_fund_series. 17/5/95 Added non time tagged studies back in. Offset mirror and slit from home positions. Add check for invalid slit numbers. Fixed bug with not setting up slit numbers properly. cpt : Added time tagged flag back in. Changed chk_fund_series to procedure. Added initial and final state structures to series structure. Added slit and mirror positions to raster structure. Added check that slit number is within valid range. Initialized slitn in series structure in cpt. do_raster : Added mirror and slit offsets to raster start position. Added initial state structure to argument list. wr_raster_file : Stored mirror and slit offsets from home positions in raster structure. chk_fund_series : Added time_tagged option back in. Changed to procedure. wr_series_file : Added non time tagged studies back in with new mechanism. Forced processing of each table even if already loaded so that keeps track of current position and slit number properly. Added initial study state and final states to series structure. wr_ttc_file : Added more study info. Modified series state structure. fileout : Modified waring message. get_series_info : Modified series structure to include state. get_series_id : Modified series structure to include state. 24/5/95, MKC Fixed GIS bank switch. Added checks for vdswin and dexwin table overflows. Added VDS window command terminator. Removed non time tagged studies from defrred store. Coded so that non time tagged studies use current state as label. Added slitn to series database. wr_raster_file : Switched GIS banks 1 and 2 around. wr_vdswin_file : Added check for too many windows. Added command terminator. wr_dexwin_file : Added check on table length. wr_ttc_file : Removed non time tagged studies from defrred store. get_series_id : Modified seriesID database to include slitn. get_series_info : Modified seriesID database to include slitn. cpt : Added explicit wait to reach initial position in case of non time tagged study. get_slitn_delay : Changed definition of invalid slitn_start Changed output to LONG. get_ops_delay : Changed definition of invalid ops_start Changed output to LONG. 25/5/95, MKC Added CDHS state database routines. Prelimary versions. 31/5/95, MKC Changed series_ID and rasterID databases to series_id and raster_id 1/6/95, MKC Corrected bug to do with passing empty lists to wr_ltb_file and wr_ttc_file. Affected : cpt, wr_ltb_file. wr_series_file : Added printout of initial and final solar x and y. Changed do_raster argument list. do_raster : Added more printout. Changed argument list so that structures not passed by value. 6/6/95, MKC Corrected bug in pointings loop. Added CB5ABORT to any time tagged study. 9/6/95, MKC Added routines get_cdhs_series_id, get_cdhs_raster_id for querying series_id and raster_id databases about a particular CDHS ID. 1/8/95, MKC fileout : made warning slightly more comprehensible. cpt : Fixed bug due to generation of multiple series tables for study. 10/8/95, MKC wr_series_file : Set BYTE study ID in series table to zero, was set to planning study ID. Corrected bug which crashes code when study spanning more than one series table already exists in database. Added series structure rpt tag. do_raster : Adjusted relative poitning to be relative to istate rather than fstate. cpt : Added rpt tag to series structure to use for emergency series. Added call to emergency_study. Added set_vds_exposure. get_series_info: Added rpt tag to series structure. get_series_id : Added rpt tag to series structure. fileout : Removed warning message. wr_ttc_file : Added emergency study note. get_ops_delay : Added CDHS state database values for constants used. get_ops_pos : Added interrogation of CDHS state database for pointing parameters. cp_input_wd : Changed active and default to I*4. Added comment field. Stopped history being displayed if no entries. Added print option. cp_get_history : If no entries returns Unknown mnemonic Added comment field to parameter. cp_add_mnemonic: Added comment field to structure. cp_get_all : Added comment field to structure. Changed active and default to I*4. cp_get_history : Added comment field to structure. Explicitly extracted mnemonic from database. cp_get_load : Added comment field to structure. cp_get_mnemonic: Added comment field to structure. Changed active and default to I*4. Updated series_id database. Updated cdhs state database to store LONGs. Created routines emergency_study.pro, set_exposure, cp_chk_data, cp_dsp_strarr. 14/8/95, MKC Modified routine get_ops_delay to be specific to left and right movements. get_ops_delay : Changed to left and right specific. do_raster : Modified get_ops_delay argument list. wr_ttc_file : Modified get_ops_delay argument list. get_slitn_delay : Adapted to use CDHS state database. cpt : Added more information. Added routine get_home_pos Modified state structure. Created routine get_home_pos.pro 25/8/95, MKC Created routine cp_get_state.pro to read VDS parameters from CDHS state database in place of routine get_state.pro. cp_get_history : Modified so that accepts reduced structure as input. cpt : Added VDS window offset from state database. 4/9/95, MKC Fixed on idea that any modification to the CDHS state database should result in the commprep database being re-initialized ie /new option. This is not done automatically at present. Dealt with things like VDS mode in the state database. Added RDYBOTH to start of each study to deal with flare event recovery. Fixed bug affecting behaviour when CDHS tables all used. get_home_pos : Changed so that uses short ints in state structure. wr_raster_file : Retrieved a number of previously hard-coded parameters from the CDHS state database ie. VDS mode. fileout : Modified to deal with RDY BOTH command in series table. wr_series_file : Added READYBOTH command to start of each series to allow recovery after health module action. cpt : Wrote out more study information. get_cdhs_index : Fixed bug. 8/9/95, MKC Updated CDHS state database -- changed VDS_PCMP to VDS_PMCP cp_get_state : Changed vds_pcmp tag to vds_pmcp. 25/9/95, MKC Added error treatment to routines. cp_input_wd : Set ON_ERROR=2 to return to calling routine on error. cp_get_indeces : Corrected so that issues error message rather than returning warning flags. cpt : Added explicit call to ON_ERROR=0. Added creation of duplicate databases in case of CPT crash. Created new procedure fini_cp_db.pro to move database files back to original version. init_cp_db : Added commands to copy databases. cpt Modified so that always calls init_cp_db. Now always deletes previous CVT files. Calls routine fini_cp_db. get_raster_id : Pointed SW at duplicate database. get_series_id : Pointed SW at duplicate database. get_cdhs_index : Pointed SW at dupliacte database. Modified treatment of SFTs so only turns on and off once per study rather than for individual rasters. do_raster : Removed start and end SFT. wr_series_file : Added start and end SFT. 28/9/95, MKC Added ERRMSG keyword but still retaining hard errors if keyword not used for : cp_get_state, cp_get_indeces, cp_get_mnemonic, get_ops_delay, get_ops_pos. Modified way table lists incremented. cpt : Modified way increments table lists. wr_ltb_file : Modifies way uses table lits. wr_series_file : Modified so that does increments arrays differently. fileout : Change dcommon block and modified way increments arrays. Altered so that init_cp_db only deletes CVT files if commprep database recreated as previously was the case. 29/9/95, MKC Split cpt into cpt and cpt_details.pro. Added cpt_flags.pro to load the table srequired for flag studies. Split wr_ltb_file into wr_ltb_file and op_ltb_file. Added field to series_id database. Removed chk_fund_series.pro . cpt : Added routines cpt_details, cpt_flags. Added .repn tag to series. wr_ltb_file : Opened and closed LTB file separately and changed argument list accordingly. Removed. get_series_info : Added .repn tag to series. wr_series_file : Added flag study ID to argument list and modified series table output. Added flag master logic. do_raster : Output slit position for NIS raster also. ========================================================================== Files are: Directory: /sohos1/solg2/cds/soft/ops/plan/command/ CPT - Prepares CDS commands from science plan. CPT_DETAILS - Deals with sci_details database studies. CPT_FLAGS - Deals with sci_flags database studies. EMERGENCY_STUDY - Returns details of emergency study. GETNEXTPERIOD() - Returns start/end times for next CDS science plan period. INIT_CP_DB - Initializes databases/directories used by CPT software. FINI_CP_DB - Copies database file sback to official directory. GET_HOME_POS() - Returns home position from CDHS state database. GET_SERIES_ID() - Returns an internal CDHS ID for a series table. GET_RASTER_ID() - Returns an internal CDHS ID for a raster table. GET_DEXWIN_ID() - Returns an internal CDHS ID for a dexwin table. GET_VDSWIN_ID() - Returns an internal CDHS ID for a vdswin table. GET_CDHS_INDEX() - Returns an internal CDHS index for a table. GET_SERIES_INFO - Gets version numbers and internal IDs for CDHS series tables. GET_RASTER_INFO - Gets version numbers and internal IDs for CDHS raster tables. GET_DEXWIN_INFO - Gets version numbers and internal IDs for CDHS dexwin tables. GET_VDSWIN_INFO - Gets version numbers and internal IDs for CDHS vdswin tables. GET_VERSION - Gets s/w version number of code used to create CDS table. DO_RASTER - Writes out raster part of CDS SERIES tables. DO_FOLLOWING - Appends commands for follwoing study to current study tables. DO_ENGINEERING - Creates engineering series table. DO_GSET_INIT - Does initialization commands for GSET. DO_GSET_ON - Does commands to switch on GIS. DO_GSET_OFF - Does commands to switch off GIS. DO_GSET_TTC - Puts commands to set up GIS lookup tables in TTC file. DO_FLAG_MASTER - Does flag master commands. DO_FLAG_RECEIVER - Does flag receiver commands. FILEOUT - Writes out CDS SERIES tables to array or file. GET_OPS_DELAY - Returns delay in ms for given OPS movement. GET_OPS_POS - Calculates the CDS OPS positions for a given solar (x,y). GET_SLITN_DELAY - Returns delay in ms for given slit number movement. GET_SLITP_DELAY - Returns delay in ms for given slit movement. MACRO_WAIT - Outputs macro wait command. OP_LTB_FILE - Opens LTB file. SET_EXPOSURE - Sets up VDS exposure units and time. WR_SERIES_FILE - Writes out CDS SERIES tables to file. WR_RASTER_FILE - Writes out a CDS RASTER table to file. WR_DEXWIN_FILE - Writes out a CDS DEXWIN table to file. WR_VDSWIN_FILE - Writes out a CDS VDSWIN table to file. WR_LTB - Writes out the command preparation LTB file. WR_TTC_FILE - Writes out the command preparation TTC file. REM_FST - Returns last occurring unique elements of an array CP_ADD_MNEMONIC - Adds an entry to the CDHS state database CP_DSP_STRARR - Displays string array in text widget with print option. CP_GET_INDECES - Checks database output. CP_GET_HISTORY - Returns history of given parameter mnemonic and number from the CDHS state database CP_GET_ALL - Returns all unique entries in the CDHS state database CP_GET_LOAD - Produces update file and returns the entries to be loaded in database CP_GET_MNEMONIC - Returns specific item in database CP_GET_STATE - Reads VDS parameters from the CDHS state database. CP_INIT_STDB - Initializes the CDHS state database CP_GET_ENTRY - Retrieves entries associated with mnemonic and list of indeces. CP_STATE - CDHS state database tool ADD_IEF - Adds IEF table and window parameters to databases. ADD_IEFTAB - Adds IEF table parameters to database. ADD_IEFWIN - Adds IEF window parameters to database. GET_IEF - Retrieves IEF table and window parameters from databases. GET_IEFTAB - Retrieves IEF table parameters from database. GET_IEFWIN - Retrieves IEF window parameters from database. DEF_IEF - Sets up default IEF parameter structure. SET_IEF - Translates IEF table structure into a loadable IEF MEMDUMP - Searches memory dump for string. BOOTINFO - Interprets bootstrap area of memory dump. COMPILE - Compiles all the above code.