procedure mosaic (fobjeto) file fobjeto {"",prompt="Object file:"} begin string objeto file text objeto=mosaic.fobjeto noao noao.artdata noao.imred noao.imred.bias images.imgeom #ctio #stsdas #toolbox #imgtools if (access("CCD1.fits")){ imdel("CCD1.fits",ver-) } if (access("CCD2.fits")){ imdel("CCD2.fits",ver-) } print("") print("**Copying original frames...") print("") imcopy(objeto//"[1]","CCD1.fits") imcopy(objeto//"[2]","CCD2.fits") ##########Overscan reduction. Added by AB 09/21/13 print(" ") print("**Reducing by overscan...") colbias(input="CCD1.fits",output="CCD1.fits",bias="[3:22,5:2051]",trim="[]",median=no,interac=no,functio="legendre",order=9,low_rej=3.,high_re=3.,niterat=10,logfile="") colbias(input="CCD2.fits",output="CCD2.fits",bias="[3:22,5:2051]",trim="[]",median=no,interac=no,functio="legendre",order=9,low_rej=3.,high_re=3.,niterat=10,logfile="") if (access("CCD1_rot.fits")){ imdel("CCD1_rot.fits",ver-) } if (access("CCD2_rot.fits")){ imdel("CCD2_rot.fits",ver-) } ##########New mosaic parameters, V5 of polynomials, solution degree=1, Updated by AB 04/08/13 ##########VALUES IN FOLLOWING TASKS MUST BE CHANGED IF MaskDesigner POLYNOMIALS ARE RECALCULATED ##########See the Polynomials Manual print(" ") print("**Geometric transformation & mosaic assembly... please, wait...") rotate(input="CCD1.fits",output="CCD1_rot.fits",rotation=0.023862826,xin=525.0,yin=1026.0,xout=525.,yout=1026.0,ncols=1049,nlines=2051,interpo="linear",boundar="constant",constan=0.,nxblock=15,nyblock=15,verbose=yes) rotate(input="CCD2.fits",output="CCD2_rot.fits",rotation=0.040671058,xin=525.0,yin=1026.0,xout=536.8201345,yout=1027.64119145,ncols=1061,nlines=2051,interpo="linear",boundar="constant",constan=0.,nxblock=15,nyblock=15,verbose=yes) if (access("CCD_mosaic.fits")){ imdel("CCD_mosaic.fits",ver-) } #imcreate(image="CCD_mosaic.fits",naxis=2,naxis1=2110,naxis2=2051,pixtype="real") mkpattern(input="CCD_mosaic.fits",pixtype="real", ndim=2, ncols=2110, nlines=2051) imcopy("CCD1_rot.fits","CCD_mosaic.fits[1:1049,1:2051]") imcopy("CCD2_rot.fits","CCD_mosaic.fits[1050:2110,1:2051]") ##########Including header in the new mosaic (PART 1) print(" ") print("**Adding header with central pixel as reference...") print(" ") if (access("OsirisMosaic.fits")){ imdel("OsirisMosaic.fits",ver-) } if (access("head.fits")){ imdel("head.fits",ver-) } imcopy("CCD_mosaic.fits","OsirisMosaic.fits") imcopy(objeto//"[0]","head.fits") mkheader("OsirisMosaic.fits","head.fits",append=no,verbose=yes) if (access("text")){ del("text",ver-) } hselect(images="CCD1.fits",fields="CD1_1",expr+,mode="h", > "text") !awk '{print "hedit OsirisMosaic.fits CTYPE1 RA---TAN add+ up+ ver- show-"}' text > mac.cl cl < mac.cl !awk '{print "hedit OsirisMosaic.fits CTYPE2 DEC---TAN add+ up+ ver- show-"}' text > mac.cl cl < mac.cl !awk '{print "hedit OsirisMosaic.fits RADESYS FK5 add+ up+ ver- show-"}' text > mac.cl cl < mac.cl if (access("text")){ del("text",ver-) } hselect(images="CCD1.fits",fields="CD1_1",expr+,mode="h", > "text") !awk '{print "hedit OsirisMosaic.fits CD1_1 "$1" add+ up+ ver- show-"}' text > mac.cl cl < mac.cl if (access("text")){ del("text",ver-) } hselect(images="CCD1.fits",fields="CD1_2",expr+,mode="h", > "text") !awk '{print "hedit OsirisMosaic.fits CD1_2 "$1" add+ up+ ver- show-"}' text > mac.cl cl < mac.cl if (access("text")){ del("text",ver-) } hselect(images="CCD1.fits",fields="CD2_1",expr+,mode="h", > "text") !awk '{print "hedit OsirisMosaic.fits CD2_1 "$1" add+ up+ ver- show-"}' text > mac.cl cl < mac.cl if (access("text")){ del("text",ver-) } hselect(images="CCD1.fits",fields="CD2_2",expr+,mode="h", > "text") !awk '{print "hedit OsirisMosaic.fits CD2_2 "$1" add+ up+ ver- show-"}' text > mac.cl cl < mac.cl if (access("text")){ del("text",ver-) } #########Including polynomial-dependent WCS parameters: new center (1059.2764,994.966) #########and corresponding celestial coordinates #########THESE VALUES MUST BE CHANGED IF MaskDesigner POLYNOMIALS ARE RECALCULATED #########See the Polynomials Manual print(1059.2764,994.966, > "text") !awk '{print "hedit OsirisMosaic.fits CRPIX1 "$1" add+ up+ ver- show-"}' text > mac.cl cl < mac.cl cl < mac.cl !awk '{print "hedit OsirisMosaic.fits CRPIX2 "$2" add+ up+ ver- show-"}' text > mac.cl cl < mac.cl cl < mac.cl if (access("field")){ del("field",ver-) } skyctran(input="text",output="field",insystem="CCD1.fits [logical]",outsyste="fk5",transfo=yes,lngcolu=1,latcolu=2,olnguni="degrees",olatuni="degrees",olngformat="%11.7f",olatformat="%11.7f",verbose=no) if (access("text")){ del("text",ver-) } fields(files="field",fields=1,lines="10-",quit_if_missing=no,print_file_names=no, > "text") !awk '{print "hedit OsirisMosaic.fits CRVAL1 "$1" add+ up+ ver- show-"}' text > mac.cl cl < mac.cl cl < mac.cl if (access("text")){ del("text",ver-) } fields(files="field",fields=2,lines="10-",quit_if_missing=no,print_file_names=no, > "text") !awk '{print "hedit OsirisMosaic.fits CRVAL2 "$1" add+ up+ ver- show-"}' text > mac.cl cl < mac.cl cl < mac.cl #########Including header in the new mosaic (PART 3) if (access("text")){ del("text",ver-) } hselect(images="CCD1.fits",fields="EQUINOX",expr+,mode="h", > "text") !awk '{print "hedit OsirisMosaic.fits EQUINOX "$1" add+ up+ ver- show-"}' text > mac.cl cl < mac.cl #########Deleting temp. files if (access("head.fits")){ imdel("head.fits",ver-) } if (access("CCD1.fits")){ imdel("CCD1.fits",ver-) } if (access("CCD2.fits")){ imdel("CCD2.fits",ver-) } if (access("CCD1_rot.fits")){ imdel("CCD1_rot.fits",ver-) } if (access("CCD2_rot.fits")){ imdel("CCD2_rot.fits",ver-) } if (access("CCD_mosaic.fits")){ imdel("CCD_mosaic.fits",ver-) } if (access("text")){ del("text",ver-) } if (access("mac.cl")){ del("mac.cl",ver-) } if (access("field")){ del("field",ver-) } print(" ") print("**Ready. Rename OsirisMosaic.fits file if required.") print(" ") end