
# This script is the main script for processing MIRS Operational data.
# The first part of the script kicks off two Perl scripts, one for NOAA
# data and one for Metop data. These scripts copy the operational EDRs
# and then run a program that combines the EDRs into a single day MDDF.
#
# The second part of the script captures the data from the MDDF and creates
# EDGEIS files.


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

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

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




# =============================================================================
# Capture the MIRS Test NOAA19 data for EDGEIS

cd $ANCHOR/apps/soundings/nprovs/source/mirs/capture



ln -s $ANCHOR/apps/soundings/nprovs/files/daily_input/mirs_test_n19.mddf           in.file
ln -s $ANCHOR/apps/soundings/nprovs/source/mirs/capture/mddf_test.edge             out.file
ln -s $ANCHOR/apps/soundings/nprovs/source/mirs/capture/mirs_capture.xml           parm.file
ln -s $ANCHOR/apps/soundings/nprovs/source/mirs/capture/edgeparm_mirs_npp_mddf.txt fileparm.file

$ANCHOR/apps/soundings/nprovs/source/mirs/capture/MDDF_to_Edgeis.x "MIRS Test - NOAA19"


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



# Transfer the file to nukajda1

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


rm $ANCHOR/apps/soundings/nprovs/source/mirs/capture/mddf_test.edge



# =============================================================================
# Capture the MIRS Test Metop data for EDGEIS

ln -s $ANCHOR/apps/soundings/nprovs/files/daily_input/mirs_test_m2.mddf        in.file
ln -s $ANCHOR/apps/soundings/nprovs/source/mirs/capture/mddf_test.edge         out.file
ln -s $ANCHOR/apps/soundings/nprovs/source/mirs/capture/mirs_capture.xml       parm.file
ln -s $ANCHOR/apps/soundings/nprovs/source/mirs/capture/edgeparm_mirs_mddf.txt fileparm.file

$ANCHOR/apps/soundings/nprovs/source/mirs/capture/MDDF_to_Edgeis.x "MIRS Test - Metop"


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



# Transfer the file to nukajda1

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


rm $ANCHOR/apps/soundings/nprovs/source/mirs/capture/mddf_test.edge




# =============================================================================
# Capture the MIRS ATMS NPP data for EDGEIS

cd $ANCHOR/apps/soundings/nprovs/source/mirs/capture

ln -s $ANCHOR/apps/soundings/nprovs/files/daily_input/mirs_atms_npp.mddf       in.file
ln -s $ANCHOR/apps/soundings/nprovs/source/mirs/capture/mddf_npp.edge          out.file
ln -s $ANCHOR/apps/soundings/nprovs/source/mirs/capture/mirs_npp_capture.xml   parm.file
ln -s $ANCHOR/apps/soundings/nprovs/source/mirs/capture/edgeparm_mirs_mddf.txt fileparm.file

$ANCHOR/apps/soundings/nprovs/source/mirs/capture/MDDF_to_Edgeis.x "MIRS ATMS NPP"


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



# Transfer the file to nukajda1

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


rm $ANCHOR/apps/soundings/nprovs/source/mirs/capture/mddf_npp.edge


# end of file
