procedure tmodap (cpAcross, fldCode, oldPref, inPref, inScaleFile, ApmodFile1, ApmodFile2, addTop, inWaveFile, inRawFile, xx, yy, fluxConst, normSlice, inApertFile, threshCol, sigdvcut, corrLim, fitTol, Nmin, rej, fOverlap, fTrough, sgn, inCRfile, verbOut, exclEnd, exclNonAdj, exclBrtEnd, brtLimit) bool cpAcross {no, prompt="Copy and compile modap.f?"} string fldCode {"13e7",prompt=" Field code (extn on all files here)"} string oldPref {"c",prompt=" Input file tag to make (tag)+(fldCode)"} string inPref {"g",prompt=" Output file tag to make (tag)+(fldCode)"} string inScaleFile {"scaleCoeff.a", prompt=" Sorted file of scale coefficients"} bool addTop {yes, prompt=" -> Add a top 1.000 0.000 line to scaleCoeff?"} string ApmodFile1 {"twoApmod.d", prompt=" 1 or 2-detect EL-cands in ApmodFile form"} string ApmodFile2 {"contApmod.d", prompt=" contin-detect EL-cands in ApmodFile form"} string inWaveFile {"wave1.", prompt=" Sorted wavelengths file (from TWAVELENGTHS)"} string inRawFile {"outRaw.a", prompt=" File of raw flux data (from TESPECT)"} real xx {788, prompt=" X-coord of optical axis centre"} real yy {888, prompt=" Y-coord of optical axis centre"} real fluxConst {4.3456e-19, prompt=" Flux calibration constant"} int normSlice {1, prompt=" Slice number for stellar flux normalisations"} string inApertFile {"apsUS.", prompt=" Aperture sizes/flux threshold file (from TNOISE)"} int threshCol {12, prompt=" Flux thresh column (>=2 => mean values used)"} real sigdvcut {2, prompt=" Sigma deviation threshold to select continuum-ELGs by"} real corrLim {2.0, prompt=" =======> Upper limit imposed on aperture correction factors"} real fitTol {1.0, prompt=" Initial fit tolerance (% of flux rel uncertainty)"} int Nmin {5, prompt=" Minimum number of fit pts (all situations)"} int rej {2, prompt=" Maximum number of reject points"} real fOverlap {1.0, prompt=" Flux scale factor (overlap regions)"} real fTrough {1.0, prompt=" Flux scale factor (centre trough)"} real sgn {+1.0, prompt=" Side of fit to reject on (1=abv;-1=blw)"} string inCRfile {"cray1.", prompt=" CR/ghost location file (or dummy file)"} bool verbOut {yes, prompt=" Verbose output?"} bool exclEnd {no, prompt=" Exclude end-point deviations?"} bool exclNonAdj {no, prompt=" Exclude non-adjacent double-deviations?"} bool exclBrtEnd {yes, prompt=" Exclude bright-end?"} real brtLimit {7000, prompt=" -> bright-end cut-off in EL sample"} begin # Variable declarations: string file1 # file name 1 string file2 # file name 2 string fldStr # string containing field numbers string outFile1 # output file 1 string outFileOLD # copy of old output file int j # current slice number (starts at 2) int col # current column number # Running modap on fit output: ----------------------------- print (" ") print ("================================================") print (" 2. Running modap.f ...") print (" ") if (cpAcross==yes) { print (" ") print ("-------------------------------") print (" Copying modap.f across...") !cp /home/dhj/iraf/TFred/modap.f . print (" ") print (" Compiling...") # !f77 modap.f -o modap !f77 -C modap.f -o modap # the -C compile option detects out-of-bounds # array numbers print (" ") } if ((abs(sgn))!=1.0) { print ("*******************************") print (" ERROR: sgn is not +/-1.0") print (" Please try again.") print (" ") print (" Done.") bye } if (inCRfile=="dummy") { print (" ") print (" --> Dummy CR/ghost file requested: generating") delete (files="dummy",go_ahea+,ver-) print ("0.0 0.0 1", > "dummy") print (" ") } if (addTop==yes) { print ("Adding a 1.00 0.00 top line to "//inScaleFile//fldCode//"MOD for use...") delete (files=inScaleFile//fldCode//"MOD", ver-, def+, allvers+, subfile+, go_ahead+) print ("1.00000000 0.0000000", > inScaleFile//fldCode//"MOD") type (input_fi=inScaleFile//fldCode, map_cc+, device="terminal", >> inScaleFile//fldCode//"MOD") } # Creating modap.in: print (" ") print (" Creating modap.in and running modap...") !/bin/rm modap.in print (oldPref//fldCode, > "modap.in") print (inPref//fldCode, >> "modap.in") if (addTop==yes) { print (inScaleFile//fldCode//"MOD", >> "modap.in") } else { print (inScaleFile//fldCode, >> "modap.in") } print (ApmodFile1//fldCode, >> "modap.in") print (ApmodFile2//fldCode, >> "modap.in") print (inWaveFile//fldCode, >> "modap.in") print (inApertFile//fldCode, >> "modap.in") print (inRawFile//fldCode, >> "modap.in") print (xx, >> "modap.in") print (yy, >> "modap.in") print (fluxConst, >> "modap.in") print (threshCol, >> "modap.in") print (sigdvcut, >> "modap.in") print (corrLim, >> "modap.in") print (fitTol, >> "modap.in") print (Nmin, >> "modap.in") print (rej, >> "modap.in") print (fOverlap, >> "modap.in") print (fTrough, >> "modap.in") print (sgn, >> "modap.in") print (inCRfile//fldCode, >> "modap.in") if (verbOut==yes) { print (2, >> "modap.in") } else { print (1, >> "modap.in") } if (exclEnd==yes) { print (1.0, >> "modap.in") } else { print (0.0, >> "modap.in") } if (exclNonAdj==yes) { print (1.0, >> "modap.in") } else { print (0.0, >> "modap.in") } if (exclBrtEnd==yes) { print (brtLimit, >> "modap.in") } else { print (0.0, >> "modap.in") } !modap # Plotting star-gal classification in SI if requested: ------------ # if (plotStrGal==yes) { # print (" ") # print ("================================================") # print (" ") # print (" Copying si across and plotting star-gal class...") # print (" ") # print (" (executable in temp_tscale1; will save this)") # print (" ") # !cp /home/dhj/iraf/TFred/si . # !/bin/rm temp_tscale1 # print ("si xc=12 yc=8 fi=elgRed."//inPref//" xti=flux yti=star_gal tit="//inPref//" xlog", > "temp_tscale1") # !chmod 777 temp_tscale1 # !temp_tscale1 # } print (" ") print ("================================================") # print (" ") # print (" Done.") print (" ") print (" ") end