{"id":673,"date":"2015-03-04T11:07:28","date_gmt":"2015-03-04T11:07:28","guid":{"rendered":"http:\/\/blog.stratus.org.uk\/?p=673"},"modified":"2020-10-04T11:14:19","modified_gmt":"2020-10-04T10:14:19","slug":"soundings-replot-utility-for-rasp","status":"publish","type":"post","link":"https:\/\/blog.stratus.org.uk\/?p=673","title":{"rendered":"Soundings Replot Utility for RASP"},"content":{"rendered":"\r\n<p>Having been asked to add some RASP sounding plots in Northern Ireland, it became apparent that a script to just test just the ones added would make life easier (than replotting sounding by hour from the command line).Then it became an idea to just have this to replot all soundings (as potentially to do them later on a differnet host).<\/p>\r\n<p>The script below is the result, fixed for one model with fixed start end points. These can of course be extended\/changed as approriate.<\/p>\r\n\r\n\r\n\r\n<pre>#!\/bin\/bash<br \/># Script expects a model as the first parameter, <br \/>#  e.g. \"sound_plot.sh EI12\"<br \/># Also expects \"replot\" to be available in $HOMEDIR\/GM and it works<br \/><br \/># Set where the RASP setup lives<br \/>HOMEDIR=\/home\/rasp<br \/><br \/># Set where are commands are ... useful to put full path if run<br \/>#  from a cron job. Ensure they exist, or add a check for it.<br \/>REPLOT_CMD=$HOMEDIR\/GM\/replot<br \/>SEQ_CMD=\/usr\/bin\/seq<br \/><br \/># Check we got a model and date to plot<br \/>if [ $# -eq 2 ]<br \/>then<br \/>    echo \"Using input as '$1'\"<br \/>    echo \"Using '$REPLOT_CMD' to replot\"<br \/>    echo \"Using date as '$2'\"<br \/>else<br \/>    echo \"Provide a model to try. E.g. UK12 2015-04-03\"<br \/>    exit<br \/>fi<br \/><br \/>case $1 in<br \/>    EI12) # We'll do just the one here<br \/>        # Set the start and end sounding number (as in soundingXX)<br \/>        val1=1<br \/>        val2=19<br \/>        SEQ1=$(SEQ_CMD -s \" \" $val1 $val2)<br \/>        # Set the start end of hours to use<br \/>        val3=7<br \/>        val4=19<br \/>        SEQ2=$(SEQ_CMD -f \"%02g\" -s \" \" $val3 $val4)<br \/>        # Set the model to use and clear out the temp folder where <br \/>        #  we will put the results<br \/>        MODEL=$1<br \/>        ;;<br \/>    *)<br \/>        echo \"Don't know this model to work out start and finish: $1\"<br \/>        exit<br \/>        ;;<br \/>esac<br \/><br \/># Now sort out the results folder ...<br \/>MODEL_FOLDER=$HOMEDIR\/$MODEL<br \/>TMP_FOLDER=$HOMEDIR\/$MODEL\/tmp<br \/># Clear it out<br \/>rm -rf $TMP_FOLDER<br \/>mkdir $TMP_FOLDER<br \/><br \/># Output what we set<br \/>START_SND=$(printf '%d' \"$val3\")<br \/>END_SND=$(printf '%d' \"$val4\")<br \/>START_HR=$(printf '%02d' \"$val1\")<br \/>END_HR=$(printf '%02d' \"$val2\")<br \/><br \/>echo \"Sounding sequence: sounding$SEQ1\"<br \/>echo \"Hour sequence: $SEQ2\"<br \/>echo \"Sending results to: $TMP_FOLDER\"<br \/>echo \"Using date of: $2\"<br \/><br \/>#Now do plots, assuming no gaps though<br \/>for SND_NAME in $SEQ1<br \/>do<br \/>    SOUNDING_NAME=sounding$SND_NAME<br \/>    for PROC_HR in $SEQ2<br \/>    do<br \/>        echo \"$REPLOT_CMD -r $MODEL -d $TMP_FOLDER -p $SOUNDING_NAME -l $TMP_FOLDER -w $MODEL_FOLDER\/wrfout_d02_$2_$PROC_HR\\:00\\:00\"<br \/>        $HOMEDIR\/GM\/replot -r $MODEL -d $TMP_FOLDER -p $SOUNDING_NAME -l $TMP_FOLDER -w $MODEL_FOLDER\/wrfout_d02_$2_$PROC_HR\\:00\\:00<br \/>    done<br \/>done<br \/><code>\r\n<\/code><\/pre>\r\n\r\n\r\n\r\n<p>\u00a0<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>Having been asked to add some RASP sounding plots in Northern Ireland, it became apparent that a script to just test just the ones added would make life easier (than replotting sounding by hour from the command line).Then it became &hellip; <a href=\"https:\/\/blog.stratus.org.uk\/?p=673\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,19],"tags":[],"class_list":["post-673","post","type-post","status-publish","format-standard","hentry","category-programming","category-rasp"],"_links":{"self":[{"href":"https:\/\/blog.stratus.org.uk\/index.php?rest_route=\/wp\/v2\/posts\/673","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.stratus.org.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.stratus.org.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.stratus.org.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.stratus.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=673"}],"version-history":[{"count":19,"href":"https:\/\/blog.stratus.org.uk\/index.php?rest_route=\/wp\/v2\/posts\/673\/revisions"}],"predecessor-version":[{"id":693,"href":"https:\/\/blog.stratus.org.uk\/index.php?rest_route=\/wp\/v2\/posts\/673\/revisions\/693"}],"wp:attachment":[{"href":"https:\/\/blog.stratus.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=673"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.stratus.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=673"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.stratus.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=673"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}