procedure twavelengths (Zstart, Zinc, Zend, slope, intercept, both, slices, outFile, combPairs, overlap, offAxis, Xc, Yc, CCDused, useDef, Xj, Yj) real Zstart {prompt="Start of Z-step sequence"} real Zinc {prompt="Z-increment"} real Zend {prompt="End of Z-step sequence"} real slope {prompt="Calibration slope (angstroms/z-unit)"} real intercept {prompt="Calibration intercept (angstroms)"} bool both {yes, prompt="Output only wavelengths (no Z-values)?"} bool slices {no, prompt="If writing Z-values, incl slice numbers?"} string outFile {"wave2.jnk", prompt="Name of output file"} bool combPairs {no, prompt="Combine slice wavelengths in pairs?"} bool overlap {no, prompt=" Overlap combined pairs?"} bool offAxis {yes, prompt="Apply correction for an off-axis calibn ?"} real Xc {500, prompt=" -> X locn of optical axis (raw, unflipped)"} real Yc {500, prompt=" -> Y locn of optical axis (raw, unflipped)"} string CCDused {"1KTEK", prompt=" -> CCD used (1KTEK or MITLL)"} bool useDef {yes, prompt=" -> Use default sampling locn (for that CCD)?"} real Xj {0, prompt=" -> IF NOT: X of calibn locn (raw, unflipped)"} real Yj {0, prompt=" -> Y of calibn locn (raw, unflipped)"} begin # Variable Declarations: real Zcurr # current Z-value int sliceNum # current slice number real currWave # current wavelength real prevWave # previous wavelength (only if combPairs==yes) string c1 # first character of all filenames (for checking, since # FORTRAN will not read filenames beginning with a no.) real pixScale # CCD pixel scale at AAT f/8 real fcolONftel # fcol/ftel ratio for f/8 at the AAT real Xd, Yd # default values for calibn locn (from chip) real R, phi # off-axis radius and sky angle real theta # instrument angle real centWave, offWave # central and off-axis (calibn) wavelengths real delWave # wavelength correction real thet2on2 # theta^2/2 real pie # pi # Checking for numeric starters in supplied file names: # (FORTRAN will not read such names if given as input!!) c1 = substr(outFile, 1, 1) if ((c1=="0")||(c1=="1")||(c1=="2")||(c1=="3")|| (c1=="4")||(c1=="5")||(c1=="6")||(c1=="7")||(c1=="8")||(c1=="9")) { print("** ERROR: first character of 'outFile' ("//outFile//") is numeric **") print(" ") print(" --> Please change incorrect file name and re-run") print(" ") print (" Done.") print (" ") print (" ") bye } pie = 3.1415927 if (Zend Try again.") print (" ") bye } print (" ") print ("- - - - - - - - - - - - - - - - - - - - - - - - - - -") # Calculations for off-axis correction (if requested): if (offAxis==yes) { if ((CCDused!="1KTEK")&&(CCDused!="MITLL")) { print (" ") print (" *** Incorrect specification of CCDused !! ***") print (" ----> Try again.") print (" ") bye } if (CCDused=="1KTEK") { pixScale = 0.594 Xd = 514 Yd = 856 # wavelength sampling locn (raw, unflipped) from # TEK_TTF_ON_OFF window. (514,856) are coords # rel to full 1x1K chip, which also happens to be # the full imaging region. # We measure all (X,Y)s relative to imaging region # in this script. } if (CCDused=="MITLL") { pixScale = 0.371 Xd = 1026-(201-1) Yd = 2050-(1301-1) # wavelength sampling locn (raw, unflipped) from # MITLL_ON_OFF window. (1026,2050) are coords # rel to full 2x4K chip; (201,1301) are offsets # of lower LH corner for imaging region. # We measure all (X,Y)s relative to imaging region # in this script. } print ("Correcting for an off-axis calibration...") print (" ") print (" CCD: "//CCDused//" pixScale: "//pixScale//" arcsec/pix") print (" centre of optical axis: ("//Xc//","//Yc//")") # Calculating wavelength offset: if (useDef==yes) { R=sqrt((Xc-Xd)*(Xc-Xd)+(Yc-Yd)*(Yc-Yd)) print (" Using DEFAULT position --") print (" calibration location: ("//Xd//","//Yd//")") } else { R=sqrt((Xc-Xj)*(Xc-Xj)+(Yc-Yj)*(Yc-Yj)) print (" Using SPECIFIED position") print (" calibration location: ("//Xj//","//Yj//")") } fcolONftel = 15.39e-3 # at f/8 (AAT) phi = R*pixScale theta = (phi/3600)*(pie/180)/fcolONftel thet2on2 = theta*theta/2 print (" ") printf (" radius: %6f pix\n", R) printf (" phi: %6f arcsec\n", phi) printf (" theta: %6f radian\n", theta) print (" ") print ("- - - - - - - - - - - - - - - - - - - - - - - - - - -") print (" ") } sliceNum = 0 Zcurr = Zstart delete (files=outFile, verify=no,default=yes,go_ahead=yes) print (" ") print ("centWave offaxisWave delWave") print (" ") if (combPairs==yes) { prevWave = slope*Zcurr + intercept Zcurr = Zcurr+Zinc } while (Zcurr<=Zend) { currWave = slope*Zcurr + intercept if (combPairs==yes) { currWave = 0.5*(currWave+prevWave) # i.e. mean wavelength prevWave = slope*Zcurr + intercept } if (offAxis==yes) { offWave=currWave centWave=offWave/(1-thet2on2) delWave=centWave-offWave currWave=centWave printf ("%8f %8f %4f\n", centWave, offWave, delWave) } if (both==yes) { printf ("%8f \n", currWave, >> outFile) # ** have only done formatting for this output version } if ((both==no)&&(slices==no)) { print (Zcurr, currWave, >> outFile) } if ((both==no)&&(slices==yes)) { print (sliceNum, Zcurr, currWave, >> outFile) } Zcurr = Zcurr+Zinc if (combPairs==yes) { if (overlap==no) { prevWave = slope*Zcurr + intercept Zcurr = Zcurr+Zinc } } sliceNum = sliceNum+1 } print (" ") print (" ") print (" ") print (" There are "//sliceNum//" slices ...") print (" ") print (outFile//":") print (" ") type (input_fi=outFile,map_cc+,device="terminal") print (" ") print ("- - - - - - - - - - - - - - - - - - - - - - - - - - -") print (" ") print (" Done. ") print (" ") end