#David Shean (David_Shean@Brown.edu) #1/20/04 #thmirmos #This tcsh script will process a series of raw RDR.QUB THEMIS Day IR files from level 0 to level 4, producing a "single-stretch" mosaic. You must enter appropriate latitude and longitude ranges for the final mosaic. You can also input different sizes for the boxfilters if desired. After entering custom lat/lon parameters, place the file in the directory with all of your RDR.QUB files. To make this file executable, type "chmod +x thmirmos" at a tcsh prompt. Then run "thmirmos". The output will be two mosaics. One processes the images using the steps of the hilev4 proc while the other uses a different series of filters. #Define boundaries of mosaic #Olympus #set lat1 = 13.0 #set lat2 = 24.5 #set lon1 = -142.5 #set lon2 = -132.2 #Arsia #set lat1 = -13.0 #set lat2 = -1.0 #set lon1 = -132.0 #set lon2 = -115.0 #Pavonis #set lat1 = -3.0 #set lat2 = 8.5 #set lon1 = -118.5 #set lon2 = -109.5 #Ascraeus set lat1 = 6.2 set lat2 = 16.2 set lon1 = -110.2 set lon2 = -100.2 set clon = 0 set box1 = 51 set box2 = 251 set numimg = 0 #Run thm2isis to convert .RDR to .cub files foreach i (*RDR.QUB) $ISISEXE/thm2isis.pl $i $i.l1 -- -- $ISISM01DATA/thm_kernels_both.def.3 -- 180 -- -- #Isolate band 9 dsk2dsk from=$i.l1 to=$i.l1.b9 sfrom='"::9"' rm $i.l1 #Run thmirmc to map project image - SIMP:0,ocentric will tie images to MOLA $ISISEXE/thmirmc.pl $i.l1.b9 -- -- -- "SIMP:$clon,ocentric" -- -- -- -- 0.1 #-- -- -- $lat1 $lat2 $lon1 $lon2 rm $i.l1.b9 end #Apply box1 HPF and box2 HPF to each image foreach i (*.irmc.cub) boxfilter from=$i to=$i.box_1 filter=HPF samp=$box1 line=$box1 band=1 boxfilter from=$i to=$i.box_2 filter=HPF samp=$box2 line=$box2 band=1 set numimg = `expr $numimg + 1` #rm $i.irmc.cub end #Clear the history label of each file foreach i (*.box*) labels from=$i list=none inithist=yes end #Mosaic the box1 HPF images set j = 0 #Ensure that history file is large enough set numimg = `expr $numimg + 2` foreach i (*.box_1) if ($j == 0) then #Initializes the mosaic with the input lat/lon range mosaic from=$i to=mos1.cub init=yes nimgs=$numimg lat="($lat1, $lat2)" lon="($lon1, $lon2)" set j = 1 else #Adds each subsequent image on top of the mosaic mosaic from=$i to=mos1.cub init=no nimgs=$numimg top=y set j = `expr $j + 1` #Clears mosaic history file for every 5 images added - prevents history file size error if (`expr $j % 5` == 0) then labels from=mos1.cub list=none inithist=yes endif endif end rm *.box_1 #Mosaic the box2 HPF images set j = 0 foreach i (*.box_2) if ($j == 0) then mosaic from=$i to=mos2.cub init=yes nimgs=$numimg lat="($lat1, $lat2)" lon="($lon1, $lon2)" set j = 1 else mosaic from=$i to=mos2.cub init=no nimgs=$numimg top=y set j = `expr $j + 1` if (`expr $j % 5` == 0) then labels from=mos2.cub list=none inithist=yes endif endif end rm *.box_2 #box2 LPF on mos1 boxfilter from=mos1.cub to=mos1_lpf_box_2.cub filter=LPFV samp=$box2 line=$box2 band=1 #box1 LPF on mos2 boxfilter from=mos2.cub to=mos2_lpf_box_1.cub filter=LPFV samp=$box1 line=$box1 band=1 #Add box1 LPF of mos2 to mos1 - hilev4 procedures add from=mos2_lpf_box_1.cub from2=mos1.cub opt=c2c to=mosaic_lev4.cub #Add box2 LPF of mos1 to mos1 - original procedure add from=mos1_lpf_box_2.cub from2=mos1.cub opt=c2c to=mosaic_HPF.cub #Convert to tif with gis headers dform.pl -t -gis=yes mosaic_lev4.cub dform.pl -t -gis=yes mosaic_HPF.cub #Remove intermediate files rm mos1* rm mos2* rm isis_param.out