#!/bin/ksh

# This is the main IASI processing script.


# First, run the IASI ftp script which will transfer all
# of the IASI files on the DDS server from yesterday that
# have not already been transfered.

perl $ANCHOR/apps/soundings/nprovs/scripts/ftp_iasi.perl 1


# Run the script that copies all of the IASI granules into
# a one-day IASI Daily Data File (IDDF).

perl $ANCHOR/apps/soundings/nprovs/scripts/process_iasi_granules.perl



# Create an EDGEIS file from the IDDF

cd $ANCHOR/apps/soundings/nprovs/source/iasi


ln -s $ANCHOR/apps/soundings/nprovs/files/daily_input/iasi.iddf                 in.file
ln -s $ANCHOR/apps/soundings/nprovs/source/iasi/iasi.edge                       out.file
ln -s $ANCHOR/apps/soundings/nprovs/source/iasi/capture/iasi.xml                parm.file
ln -s $ANCHOR/apps/soundings/nprovs/source/iasi/capture/edgeparm_iasi_iddf.txt  fileparm.file

$ANCHOR/apps/soundings/nprovs/source/iasi/capture/IDDF_to_Edgeis.x "NOAA IASI"


\rm in.file
\rm out.file
\rm parm.file
\rm fileparm.file



# Transfer the edgeis file to nukajda1

sftp nukajda1.nesdis.noaa.gov << EOD
cd /data/OPDB/Edgeis/iasi
put $ANCHOR/apps/soundings/nprovs/source/iasi/iasi.edge  iasi.edge
quit
EOD


# Remove the edgeis file

rm $ANCHOR/apps/soundings/nprovs/source/iasi/iasi.edge


# end of file
