Repository navigation
ISIStoPhase
Eric E Palmer edited this page Oct 23, 2026
·
1 revision
- NOTE: We generate the emission data first since that shell script first initializes the LROC NAC EDR, which is then ready for incidence and I/F. That script can be found here. ISIStoEmission
- The shell script below generates phoP.IMG.
file=$1
out=$2
if [ '$file' == '' ]
then
echo "Usage $0 <calibratedIMG> <last4L>"
fi
if [ '$out' == '' ]
then
echo "Usage $0 <calibratedIMG> <last4L>"
fi
echo "File: $file"
echo "Outfile: $out"
if [ 'two' == 'two' ]
then
phocube FROM=$file.cub TO=phoP-$out.cub EMISSION=false I=false PHASE=true LAT=false LON=false
isis2pds FROM=phoP-$out.cub to=phoP-$out.img BITTYPE=u16bit STRETCH=linear MINPER=0 MAXPER=100
rm phoP-$out.cub
fi
calFile=`echo $file | tr E C`
echo "calFile: $calFile"
- Generating the IMG takes awhile, so we have a wrapper to run all the images at once. NOTE: This wrapper requires directory setup. Each image is placed in its own folder; the folder name is the last 5 digits of the NAC, plus the L or R for left/right. The wrapper should be placed in the directory containing all the image folders.
file=$1
list=`cat $file`
for i in $list
do
strLength=`echo $i | wc | cut -c23-24`
if [ "$strLength" != "13" ]
then
if [ "$strLength" != "14" ]
then
echo "string length not supported"
exit
fi
fi
if [ "$strLength" == "13" ]
then
lastFive=`echo $i | cut -c6-11`
fi
if [ "$strLength" == "14" ]
then
lastFive=`echo $i | cut -c7-12`
fi
cd img-$lastFive
../ISISp.sh $i $lastFive
cd ..
done
- With the emission IMG in hand, now attach the original image header. The source code is mergePhase.c
- Below is a wrapper to run the "merge" software.
file=$1
list=`cat $file`
cd /Users/JW/LDAP16/IMG_RG2
for i in $list
do
strLength=`echo $i | wc | cut -c23-24`
if [ "$strLength" != "13" ]
then
if [ "$strLength" != "14" ]
then
echo "string length not supported"
exit
fi
fi
if [ "$strLength" == "13" ]
then
lastFive=`echo $i | cut -c6-11`
echo $lastFive
fi
if [ "$strLength" == "14" ]
then
lastFive=`echo $i | cut -c7-12`
echo $lastFive
fi
echo "$i.IMG" > emmTmp
echo "/Users/JW/LDAP16/CubesReinerGamma2/img-$lastFive/phoP-$lastFive.img" >> emmTmp
~/Dropbox/Ingenii/src/t.mergePhase < emmTmp
\mv -f MP* /Users/JW/LDAP16/CubesReinerGamma2/working/NEW_IMAGES/
done
rm emmTmp