getnewest () {
  date=`date -u -I'date'`
  newfile=`ls -t ~/goesdata/goes16/fd/$1/*/* | head -1`
  cp $newfile $1.png
}

genimg () {
width=`identify -format %w fc.png`; \
convert -background '#0008' -fill lightgray -gravity center -size ${width}x300 \
         caption:"$2" \
         $1.png +swap -gravity south -geometry +0+100 -composite $1s.png
}

cd /media/ramdisk
mkdir -p montage
cd montage

getnewest fc
getnewest ch02
getnewest ch07_enhanced
getnewest ch08_enhanced
getnewest ch09_enhanced
getnewest ch13_enhanced
getnewest ch14_enhanced
getnewest ch15_enhanced
getnewest ch15

#get goes17 ch13
date=`date -u -I'date'`
newfile=`ls -t ~/goesdata/goes17/fd/ch13_enhanced/*/* | head -1`
cp $newfile goes17.png

genimg fc "False Color"
genimg ch02 "Channel 2"
genimg ch07_enhanced "Channel 7e"
genimg ch08_enhanced "Channel 8e"
genimg ch09_enhanced "Channel 9e"
genimg ch13_enhanced "Channel 13e"
genimg ch14_enhanced "Channel 14e"
genimg ch15 "Channel 15"
genimg ch15_enhanced "Channel 15e"

montage fcs.png ch02s.png ch07_enhanceds.png ch08_enhanceds.png ch09_enhanceds.png ch13_enhanceds.png ch14_enhanceds.png ch15s.png ch15_enhanceds.png -geometry 600x600 ../latest_ALLFD.png

cd ..
#rm -rf montage
