#!/bin/csh -f #+ # observe_flux_standard -- acquire spectra for monthly DEIMOS throughput test # # Purpose: # Take a series of exposures required for the DEIMOS monthly # throughput check using the current grating. # # Usage: # observe_flux_standard [-q | -v ] # # Arguments: # -q = query mode (ask before running) # -v = verify the telescope setup (starname, pa, instrument) and # do not execute data acquisiition and instr and tel moves. # Procedure: # - verifies that the telescope is pointed to a known DEIMOS # flux standard star by checking DCS keyword TARGNAME # - check the current grating and build appropriate exposure list # - save current DEIMOS configuration # - check that SKYPA is correct for this star # - set pointing origin to SLIT # - configure for slitless spectroscopy # - acquire exposures # - restore configuration # # Restrictions: # - before starting the script, you must set the SKYPA to the # correct value for the star you plan to observe. See the following # table # - a grating must be in place when the script is started # # Valid targets: # Starname PA RA Dec Equinox # -------- -- ------------ ------------ ------- # G191B2B 0 05:05:30.600 +52:49:54.00 2000.0 # Feige34 90 10:39:36.700 +43:06:10.00 2000.0 # HZ44 90 13:23:35.400 +36:08:00.00 2000.0 # BD+33 2642 0 15:51:59.9 +32:56:55 2000 # BD+28 4211 90 21:51:11.100 +28:51:52.00 2000.0 # Feige110 90 23:19:58.400 -05:09:56.00 2000.0 # # Note: This information is in starlist # /kroot/starlists/0000_Throughput_standards.list # # Exit values: # 0 = normal completion # 1 = wrong number of arguments # 2 = current star is not a valid DEIMOS flux standard # 3 = no exposures defined for current grating # 4 = number of filters and wavelengths don't match # 5 = SKYPA is wrong # # Note: # SKYPA must currently be set manually prior to running the script, # since it is not possible currently to ensure that it can be set # automatically to a value not near the limits. # # Example: # 1) To acquire exposures on the star G191B2B with the 1200G grating: # - point the telescope to G191B2B (any pointing origin) # - set the SKYPA to the 0 deg (see table above) # - move the 1200G grating into position # - execute the command: # observe_flux_standard # Assuming that the GG400, GG455, and OG550 filters are installed, # the script will acquire 3 60s exposures: # 1200G/5000A + GG400 # 1200G/7000A + GG455 # 1200G/8000A + OG550 #- # Modification history: # 2003-Jul-31 GDW Original version # 2004-Jun-19 GDW Changed all references to BAL12 -> GG400 # (filter removed from service because of # scratching) # 2008-Dec-23 GDW Added -q option # 2009-Mar-30 GDW Added new star BD+33 2642 # 2010-Feb-22 MK Added verify flag and changed all # WARNINGS to ERRORS so that the IDL # script will handle errors appropriately # 2010-Mar-11 GDW Changed verify logic # 2010-Jun-12 MK Changed Filter Error to a Warning because # the script skips filters if they are not # installed in the instrument. #----------------------------------------------------------------------- set buf = $0 set cmd = $buf:t set usage = "Usage: $cmd" set debug = 0 set do_verify = 0 if ( $debug ) then set cmd = echo else set cmd = "" endif # parse flags... while ( $#argv > 0 ) # check for -no_init flag... if ( "$1" =~ -q* ) then set do_query = 1 shift continue endif # check if verify flag is set if ( "$1" =~ -v* ) then set do_verify = 1 shift continue endif # exit flag check if no flags remain... break end # verify args... if ( $#argv > 0 ) then printf "$usage\n" exit 1 endif cat < $thresh ) then printf "ERROR: current SKYPA of $skypa is too far off of desired value $pa -- abort!\n\a" exit 6 endif # check the current grating... set grating = `grating` if ( $grating == "600ZD" ) then set desired_wavelengths = (5500 6500 7500) set desired_filters = (GG400 GG455 OG550) set ttime = 30 else if ( $grating == "830G" ) then set desired_wavelengths = (5000 7000 8000) set desired_filters = (GG400 GG455 OG550) set ttime = 45 else if ( $grating == "900ZD" ) then set desired_wavelengths = (5000 7000 8000) set desired_filters = (GG400 GG455 OG550) set ttime = 45 else if ( $grating == "1200G" ) then set desired_wavelengths = (5000 7000 8000) set desired_filters = (GG400 GG455 OG550) set ttime = 60 else printf "ERROR -- can't take data with grating $grating!\n\a" exit 3 endif # exclude unavailable filters... set filter_list = ( `consort -fn` ) set wavelengths = () set filters = () @ i=1 while ( $i <= $#desired_filters ) # add the requested filter to the list of to-be-observed filters # only if it is loaded... set found = 0 foreach filter ( $filter_list ) if ( "$desired_filters[$i]" == "$filter" ) then set filters = ( $filters $desired_filters[$i]) set wavelengths = ( $wavelengths $desired_wavelengths[$i]) set found = 1 break endif end # warn if not available... if ( ! $found ) then printf "WARNING: desired filter %s not available; skipping...\n\a" \ "$desired_filters[$i]" endif @ i++ end # verify that the number of filters and wavelengths matches... if ( $#wavelengths != $#filters ) then printf "ERROR -- number of filters and wavelengths don't match!\n\a" exit 4 endif # if the verify flag is set, then do not execute any moves. if ( $do_verify ) then exit endif # save current configuration... $cmd save_state $cmd poname Slit # configure instrument for slitless spectroscopy... $cmd modify -s deimot hatchpos=open $cmd lamps off $cmd slitmask None $cmd modify -s deiccd obstype=Object $cmd spectral $cmd tint $ttime # ensure shutter is working... cycle_shutter -10 if ( $status != 0 ) then printf "ERROR: couldn't open shutter -- abort\n\a" exit 1 endif # loop over configurations... @ i=1 while ( $i <= $#wavelengths ) $cmd filter $filters[$i] $cmd wavelen $wavelengths[$i] $cmd object DEIMOS flux standard $targname $grating/$wavelengths[$i]A + $filters[$i] $cmd goi @ i++ end # restore original configuration... $cmd restore_state exit