pro driftmap_planner,start_ra=start_ra,start_dec=start_dec,$ drift_time=drift_time,obs_time=obs_time,$ obs_date=obs_date,number_of_scans=number_of_scans,$ extra=extra, ast=ast,plot=plot,oplot=oplot,row=row,ascan_only=ascan_only ;this takes the starting ra and dec, date and time of obs, and ;caculates the AZs and rot-angs for the requested number of scans. ;The default time for the observations is LST time, unless AST is switched ;Unless the switch ascan_only is =1, the scans will be ;interleaved by one half the beam separation ;the scan offsets will be 7* the beam spacing. ;The tracks can be output onto a new display plot (use /plot) or overplot on an existing one (use /oplot). ;you can use the /oplot to refine the observing planning, useful if the observing stretches over more ;than one day, use in conjunction with 'plot_track' to see what is done, and what is planned. ;keyword ROW is the start number to use to name rows, default starts at row 1. ;The rows are incremented from north to south!! (high dec to lower dec). ;So, to start plan observations of an object at ra=12:34:56 dec= 45:56:00, at 23:00 AST ;on january 5th, 2010, it is necesary to figure out what size map is desired. ; you might want to plot tracks for a map which is 8 min in ra, and 2 deg in dec, centred on the object, ;to do this, use the following call and offset the starting ra by -4 min (i.e. half the range in ra) ;and offset the starting dec by +1 deg (i.e. half the range in dec): ;driftmap_planner,start_ra=123056,start_dec=455700,drift_time=8,$ ;obs_time=230000,obs_date=100105,number_of_scans=16,/plot ;if you want to create the three output files (see below), include the 'extra' field: ;driftmap_planner,start_ra=123056,start_dec=455700,drift_time=8,$ ;obs_time=230000,obs_date=100105,number_of_scans=16,/plot,extra=['dummy','j',string(1200),'HELIO','VOPT'] ;(see below for some more info on the /extra field) ;the number of scans can be estimated from the approximate size of the footprint ~13 amin. ; so for an area with 2deg in deg, the number_of_scan=2deg/13amin ~16 ;Note that 'one scan' actually means two interleaved tracks (i.e. the first track, followed ;by an interleaved track consitute a 'scan' - nyquist sampled). ;extra holds other info for the arecibo scheduler. If this is set, ;then it should hold: [name,epoch,vel,frame,type] these must all be of string type. ;If this field is set, then three files will be output (see below), otherwise, nothing is written. ;e.g. ;['Drift_N628_1a','j',string(8500.00),'HELIO','VOPT'] ;OUTPUTS ;This script has THREE output files, which are written ONLY if the 'extra' field is switched: ;command_drift - the actual script which CIMA understands. ;time_list - an english form of the targets, ra, dec and start time. ;drift.cat - a single-line text file which contains the position of the start ; of the first scan, to be used to position the telescope for, say, a SFS ; calibration run. ;command_drift makes explicit calls to a config file, IT MUST BE CHANGED! ;command_drift makes 'EXEC' command calls to run the fixed_driftmap mode, ;an example is below ;EXEC fixed_driftmap 276.57420 G36p18w_4b276 j 175400 103728 89.434498 truly 270 1 1 loopend-ON+OFF 1 hcal 0 first ;the parameters of the fixed_drfitmap are: ;AZ ;sourcename ;epoch ;ra ;dec ;rotang ;drift type (i.e. in current epoch, or some klugey and pointless attempt to track in J2004 by ALFALFA) ;drift time (s) ;Loops number (probably best to leave this at one...) ;new fits file (probably also better to leave this at one). ;pattern (scan, then cal, for example) ;cal time(s) ;cal type ;async seconds (this is used for ALFALFA only.. or unless you also want to use asynchronous cal. ;when to adjust power ;the result from this is that the telescope opens a new file, ;moves to the start_ra and start_de, drifts for the specified time, fires a cal on, fires a cal off, ;then closes the file and goes to the next line. ;-----------------START THE SCRIPT!!!------------------ ;-----------------SET UP SOME DEFAULTS------------------ if not keyword_set(number_of_scans) then number_of_scans=1 if not keyword_set(drift_time) then drift_time=1. if not keyword_set(row) then row=0 else row=row-1 dec=start_dec ;-----OPEN UP THE OUTPUT FILES IF NECESSARY------- if keyword_set(extra) then begin openw,outlun,"time_list.txt",/get_lun openw,catlun,"drift.cat",/get_lun openw,commlun,"command_drift",/get_lun outstring=strjoin(extra(1:4)," ") printf,commlun,"RECEIVER alfa" printf,commlun,"LOADIF config_2may05.gui" printf,commlun,"WAPPCONFIG" printf,commlun,"EXEC newfits" endif if keyword_set(extra) then printf,outlun,$ " # time ra dec az el angle sep" $ else print," # time ra dec az el angle sep" ;--------------LOOP THROUGH THE REQUESTED NUMBER OF SCANS for i=0, number_of_scans-1 do begin if keyword_set(ast) then this_scan=rotang_emuller(obs_date,start_ra,dec,obs_time,/ast) $ else this_scan=rotang_emuller(obs_date,start_ra,dec,obs_time,/lst) ;-----------the above line is the guts of this program, everything else is just display---- if keyword_set(plot) or keyword_set(oplot) then begin ras=this_scan(7:13) decs=this_scan(14:20) xrange=[max(ras)+drift_time/60.,min(ras)] yrange=[max(decs(0))-(number_of_scans)*13/60.-0.2,max(decs(0))+0.2] if keyword_set(plot) and i eq 0 then plot,[ras(0),ras(0)+drift_time/60.],[decs(0),decs(0)],$ xrange=xrange,yrange=yrange,xstyle=1,ystyle=1 for j=0,6 do oplot,[ras(j),ras(j)+drift_time/60.],[decs(j),decs(j)] endif this_sep=this_scan(6) ;NB. THIS IS IN AMIN! az_el_ang_sep_string=strjoin(string(this_scan[3:6]),/single) ;-----------write first scan to screen print,strcompress(string(i+1+row)+"a "+$ dms_format(sixty(ddmmss2dec(obs_time)),/colon)+" "+$ string(dms_format(sixty(hhmmss2dec(start_ra)),/colon))+" "+$ string(dms_format(sixty(ddmmss2dec(dec)),/colon))+" "+$ az_el_ang_sep_string) ;--------- write first scan to file if keyword_set(extra) then begin ;need to construct the string for the schedule file ; it goes: ;az source epoch ra dec rotang ;drifttype secs loop newf calmod ;calsecs caltype calmult addjpwr printf,commlun,strcompress("EXEC fixed_driftmap"+$ string(this_scan(3))+" "+strcompress(extra(0)+"_"+string(i+1+row)+"a"+$ string(fix(this_scan(3))),/remove_all)+" j "+$ string(dms_format(sixty(hhmmss2dec(start_ra))))+" "+$ string(dms_format(sixty(ddmmss2dec(dec))))+" "+$ string(this_scan(5))+" truly "+string(fix(drift_time*60))+$ " 1 1 loopend-ON+OFF 1 hcal 0 first") printf,outlun,strcompress(string(i+1+row)+"a "+$ dms_format(sixty(ddmmss2dec(obs_time)),/colon)+" "+$ string(dms_format(sixty(hhmmss2dec(start_ra)),/colon))+" "+$ string(dms_format(sixty(ddmmss2dec(dec)),/colon))+" "+$ az_el_ang_sep_string) if i eq 0 then begin ; name_str=strcompress(extra(0)+"_"+string(i+1+row)+"a",/remove_all) printf,catlun,strcompress("sfs_position"+" "+$ string(dms_format(sixty(hhmmss2dec(start_ra))))+" "+$ string(dms_format(sixty(ddmmss2dec(dec))))+" "+$ outstring) endif endif ;--------make the calcs for the interleave ; slew_time=1.2 ;of drift time. obs_time=long(dms_format(sixty(ddmmss2dec(obs_time)+drift_time*slew_time/60.))) dec_IL=long(dms_format(sixty(ddmmss2dec(dec)-this_sep/(2.*60.)))) if keyword_set(ast) then this_scan=rotang_emuller(obs_date,start_ra,dec_IL,obs_time,/ast) $ else this_scan=rotang_emuller(obs_date,start_ra,dec_IL,obs_time,/lst) this_sep=this_scan(6) ;NB. THIS IS IN AMIN! az_el_ang_sep_string=strjoin(string(this_scan[3:6]),/single) if not(keyword_set(ascan_only)) then begin ;-------CHECK IF ASCAN ONLY IS SELECTED.----------------- if keyword_set(plot) or keyword_set(oplot) then begin ras=this_scan(7:13) decs=this_scan(14:20) for j=0,6 do oplot,[ras(j),ras(j)+drift_time/60.],[decs(j),decs(j)] endif ;---------write interleave to screen print,strcompress(string(i+1+row)+"b "+$ dms_format(sixty(ddmmss2dec(obs_time)),/colon)+" "+$ string(dms_format(sixty(hhmmss2dec(start_ra)),/colon))+" "+$ string(dms_format(sixty(ddmmss2dec(dec_IL)),/colon))+" "+$ az_el_ang_sep_string) ;---------write the interleave to file if keyword_set(extra) then begin printf,commlun,strcompress("EXEC fixed_driftmap"+$ string(this_scan(3))+" "+strcompress(extra(0)+"_"+string(i+1+row)+"b"+$ string(fix(this_scan(3))),/remove_all)+" j "+$ string(dms_format(sixty(hhmmss2dec(start_ra))))+" "+$ string(dms_format(sixty(ddmmss2dec(dec_IL))))+" "+$ string(this_scan(5))+" truly "+string(fix(drift_time*60))+$ " 1 1 loopend-ON+OFF 1 hcal 0 first") printf,outlun,strcompress(string(i+1+row)+"b "+$ dms_format(sixty(ddmmss2dec(obs_time)),/colon)+" "+$ string(dms_format(sixty(hhmmss2dec(start_ra)),/colon))+" "+$ string(dms_format(sixty(ddmmss2dec(dec_IL)),/colon))+" "+$ az_el_ang_sep_string) endif endif ;--------make the calcs for the next scan obs_time=long(dms_format(sixty(ddmmss2dec(obs_time)+drift_time*slew_time/60.))) dec=long(dms_format(sixty(ddmmss2dec(dec)-7.*this_sep/60.))) print," " endfor close,/all end