#!/bin/sh

cd $DATA
#
#     Use Image Magick to convert the GIF to TIF    
#        format
#

  export PATH=$PATH:/usrx/local/ncar401/bin:/usrx/local/imajik/bin:.
  export LIBPATH="$LIBPATH":/usrx/local/imajik/lib
  export DELEGATE_PATH=/usrx/local/imajik/share/ImageMagick

  outname=out.tif                            

  convert gif:$input fax:$outname                            

#
#  Add the ntc heading: 
# 

WMO=QTUA11
ORIG=KWBC
PDYHH=${PDY}${cyc}

if [ $HEADER = "YES" ] 
then
   INPATH=$DATA/$outname
   SUB=DFAX1064       
   $USHutil/make_NTC_file.pl $WMO $ORIG $PDYHH $SUB $INPATH $OUTPATH   
#
#  Send the graphic to TOC

   cp $OUTPATH ${pcom}/gfs_500_hgt_tmp_nh_anl_${cyc}.tif  

   $DBNROOT/bin/dbn_alert GRIB_LOW ${NET} ${job} ${pcom}/gfs_500_hgt_tmp_nh_anl_${cyc}.tif

fi

