#!/usr/bin/csh -f
# This script will extract the csv files posted on the STEREO Internal Web page to make the offset files used in the IDL routines.
# run format:
#     make_offset_scale_factor_dat.csh 15 2007
#

if ( $#argv != 2) then
echo "usage: make_offset_scale_factor_dat.csh doy yyyy"
echo "examples:"
echo "    make_offset_scale_factor_dat.csh 50 2007"
exit 1
endif

# We only have 1 range (r0) now
awk -F, -f make_offset_dat.awk doy=$1 year=$2 offset_data_A_csv.csv > offset_A_r0.dat
awk -F, -f make_offset_dat.awk doy=$1 year=$2 offset_data_B_csv.csv > offset_B_r0.dat
awk -F, -f make_scale_dat.awk doy=$1 year=$2 offset_data_A_csv.csv > scale_A_r0.dat
awk -F, -f make_scale_dat.awk doy=$1 year=$2 offset_data_B_csv.csv > scale_B_r0.dat
