#!/usr/bin/ksh # # call_wget_intermagnet_gmag_backfiles.ksh - This script sets the arguments # to the script which downloads INTERMAGNET gmag data # In particular this version of the script can be used to download data for a particular # year and month rather than the current year and month. # # November 16 2011 lphilpott@igpp.ucla.edu # Based heavily on: call_wget_green_gmag.ksh, call_wget_maccs_gmag.ksh, epo_ucla_rmd_mirror_batch.ksh # # NB: it is intended that this script be run on gaia2 as the wget log file formats differ between machines # and wget_intermagnet_gmag relies on information within the log file. # ## Set the environment variables # if [[ -z $THMSOC ]] then THMSOC=/disks/socware/thmsoc_dp_current export THMSOC fi . ${THMSOC}/src/config/soc_it_to_me.config # ## Determine dates to check # # thisYear=$(date -u '+%Y') # thisMonth=$(date -u '+%m') # integer ithisMonth=$thisMonth # integer ilastMonth=$(( ithisMonth - 1 )) # if (( $ilastMonth <= 0 )) # then # lastMonth=12 # lastYear=$(( $thisYear - 1 )) # else # lastYear=$thisYear # lastMonth=$(echo $ilastMonth | awk '{printf("%02d",$1)}') # fi # thisYearMonth=${thisYear}_${thisMonth} # lastYearMonth=${lastYear}_${lastMonth} # ## Step through dates/schools #### IF YOU ARE DOWNLOADED BACK DATA TAKE CARE NOT TO END UP OVERWRITING A CDF CREATED WITH DEFINIATIVE DATA WITH ONE CREATED WITH PROVISIONAL DATA### for yearMonth in 2008_07 2008_08 2008_09 2008_10 2008_11 2008_12 do year=$(echo $yearMonth | awk -F_ '{print $1}') month=$(echo $yearMonth | awk -F_ '{print $2}') while read line do site=$(echo $line | awk '{print $1}') resolution=$(echo $line | awk '{print $2}') datatype=$(echo $line | awk '{print $3}') ${THMSOC}/src/ksh/wget_intermagnet_gmag.ksh $site $year $month $resolution $datatype #done < ${CONFIGDIR}/intermagnet_site_list.txt done < /home/thmsoc/lphilpotts_stuff/intermagnet_test/intermagnet_site_list_noabk.txt done # ## Clean up # exit 0