Changeset 1989 in lmdz_wrf for trunk/tools


Ignore:
Timestamp:
Jul 30, 2018, 8:58:42 PM (6 years ago)
Author:
lfita
Message:

Getting new updates and improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/obs-sim_Comparison.bash

    r1984 r1989  
    167167        exit
    168168      fi
    169       mv WindRose.png ${ofign}
     169      convert -trim WindRose.png ${ofign}
    170170      echo "* "${ofign} >> ${ofilefigs}
    171171      echo python ${pyHOME}/drawing.py -o draw_WindRose -S "'"${values}"'" -v ua,va -f "'"${filen}"'" >> ${ofilefigs}
     
    207207        exit
    208208      fi
    209       mv SkewT.png ${ofign}
     209      convert -trim SkewT.png ${ofign}
    210210      echo "* "${ofign} >> ${ofilefigs}
    211211      echo python ${pyHOME}/drawing.py -o draw_SkewT -S "'"${values}"'" -v ta,tda,pres -f "'"${filen}"'" >> ${ofilefigs}
     
    248248      exit
    249249    fi
    250     mv multi_SkewT.png ${ofign}
     250    convert -trim multi_SkewT.png ${ofign}
    251251    echo "* "${ofign} >> ${ofilefigs}
    252252    echo python ${pyHOME}/drawing.py -o draw_multi_SkewT -S ${tatda_evol_values} -f ${tatda_evol_files} >> ${ofilefigs}
     
    293293        exit
    294294      fi
    295       mv multi_SkewT.png ${ofign}
     295      convert -trim multi_SkewT.png ${ofign}
    296296      echo "* "${ofign} >> ${ofilefigs}
    297297      echo python ${pyHOME}/drawing.py -o draw_multi_SkewT -S ${values} -f ${compfiles} >> ${ofilefigs}
     
    343343      exit
    344344    fi
    345     mv 2Dshad_obs-sim_comparison_time.png ${ofign}
     345    convert -trim 2Dshad_obs-sim_comparison_time.png ${ofign}
    346346    echo "* "${ofign} >> ${ofilefigs}
    347347    echo python ${pyHOME}/drawing.py -o draw_2D_shad_contdisc_time -f ${cfiles} -S ${cvalues} >> ${ofilefigs}
     
    393393        exit
    394394      fi
    395       mv lines_time.${kfig} ${ofign}
     395      convert -trim lines_time.${kfig} ${ofign}
    396396      echo "* "${ofign} >> ${ofilefigs}
    397397      echo python ${pyHOME}/drawing.py -o draw_lines_time -f ${files} -S ${values} -v ${sfcv} >> ${ofilefigs}
     
    453453        echo python ${pyHOME}/drawing.py -o draw_2D_shad_contdisc -f ${cfiles} -S ${cvalues}
    454454      fi
    455       mv 2Dshad_obs-sim_comparison.png ${ofign}
     455      convert -trim 2Dshad_obs-sim_comparison.png ${ofign}
    456456      echo "* "${ofign} >> ${ofilefigs}
    457457      echo python ${pyHOME}/drawing.py -o draw_2D_shad_contdisc -f ${cfiles} -S ${cvalues} >> ${ofilefigs}
     
    658658  stid=`echo ${stidf} | tr '@' ' ' | awk '{print $1}'`
    659659  sndorigfn=`echo ${stidf} | tr '@' ' ' | awk '{print $2}'`
     660  echo ${stid}" ..."
    660661  it=0
    661662  tatda_evol_values=''
     
    684685    timeS3=`date +%Y"-"%b -d"${Dref} ${timev} ${Tu}"`
    685686    timeS4=`date +%Y -d"${Dref} ${timev} ${Tu}"`
    686     echo ${it}" "${timev}" "${Dref}" '"${timev}"' "${Tu}" "$(echo ${timeS} | tr '!' ' ')
     687    echo "  "${it}" "${timev}" "${Dref}" '"${timev}"' "${Tu}" "$(echo ${timeS} | tr '!' ' ')
    687688    timefS=`date +%Y%m%d%H%M%S -d"${Dref} ${timev} ${Tu}"`
    688689
    689     infile=${snddir}'/sounding_uava_'${stid}'.nc'
    690690    # for now...
    691691    sndstn=${stid}
    692692
    693     WindRose_plot ${it}'#'${stid}'#'${sndstn}'#'${timeS}'#'${ofigdir}'#'${timefS}'#'${infile}
     693    WindRose_plot ${it}'#'${stid}'#'${sndstn}'#'${timeS}'#'${ofigdir}'#'${timefS}'#'${ouavasndf}
    694694
    695695    SkewT_logP_plot ${it}'#'${stid}'#'${sndstn}'#'${timeS}'#'${ofigdir}'#'${timefS}'#'${sndorigfn}
     
    725725  done
    726726
    727   vals=${sndstid}'@'${sndstn}'@'${tatda_evol_labs}'@'${tatda_evol_cols}'@'${tatda_evol_files}'@'${timeS3}'@'${ofigdir}
     727  vals=${stid}'@'${sndstn}'@'${tatda_evol_labs}'@'${tatda_evol_cols}'@'${tatda_evol_files}'@'${timeS3}'@'${ofigdir}
    728728  multi_soundings_plot ${vals}
    729729
     
    741741  sndlat=`ncdump -h ${sndorigfn} | grep Station_latitude | awk '{print $3}'`
    742742  sndts=`echo ${sndtimes} | tr ',' ' '`
     743
     744  # for now...
     745  sndstn=${stid}
    743746
    744747  # Time characteristics
     
    749752  Dref=${Dref0:0:4}${Dref0:5:2}${Dref0:8:2}
    750753
     754  obsdimt=`python ${pyHOME}/nc_var.py -o itime -S CFtime, -v time -f ${sndorigfn} |  \
     755    grep dimt | awk '{print $2-1}'`
     756
    751757  # Plotting
    752758  it=0
    753   for its in ${sndts}; do
    754 
    755     timev=`python $pyHOME/nc_var.py -o varout -S time:${it} -f ${sndorigfn} -v time | \
     759  while test ${it} -le ${obsdimt}; do
     760
     761    otimev=`python $pyHOME/nc_var.py -o varout -S time:${it} -f ${sndorigfn} -v time |\
    756762      grep NC | awk '{printf ("%d", $2)}'`
    757     dateS=`date +${figsndTfmt} -d"${Dref} ${timev} ${Tu}"`
    758     timeS2=`date +%d"$^{"%H"}$" -d"${Dref} ${timev} ${Tu}"`
    759     timeS3=`date +%Y"-"%b -d"${Dref} ${timev} ${Tu}"`
    760     timeS4=`date +%Y -d"${Dref} ${timev} ${Tu}"`
    761     datefS=`date +%Y%m%d%H%M%S -d"${Dref} ${timev} ${Tu}"`
     763    dateS=`date +${figsndTfmt} -d"${Dref} ${otimev} ${Tu}"`
     764    timeS2=`date +%d"$^{"%H"}$" -d"${Dref} ${otimev} ${Tu}"`
     765    timeS3=`date +%Y"-"%b -d"${Dref} ${otimev} ${Tu}"`
     766    timeS4=`date +%Y -d"${Dref} ${otimev} ${Tu}"`
     767    datefS=`date +%Y%m%d%H%M%S -d"${Dref} ${otimev} ${Tu}"`
    762768
    763769    iexp=1
     
    771777      simdiagsf=${odir}'/simout_snddiags_'${expl}'.nc'
    772778
    773       gridsnd=`python ${pyHOME}/nc_var.py -o get_point -f ${simjoinselvars}          \
    774         -S 'XLONG:XLAT:Time|0' -v ${sndlon}','${sndlat}`
    775       xsnd=`echo ${gridsnd} | tr ',' ' ' | awk '{print $1}'`
    776       ysnd=`echo ${gridsnd} | tr ',' ' ' | awk '{print $2}'`
    777       echo "  Equivalent simulated sounding grid point: "${gridsnd}
     779      gridsndv=`python ${pyHOME}/nc_var.py -o get_point -f ${simjoinselvars}         \
     780        -S 'XLONG:XLAT:Time|0' -v ${sndlon}','${sndlat} | tr ' ' '!'`
     781      xsnd=`echo ${gridsndv} | tr '!' ' ' | awk '{print $1}' | tr ',' ' ' |          \
     782        awk '{print $1}'`
     783      ysnd=`echo ${gridsndv} | tr '!' ' ' | awk '{print $1}' | tr ',' ' ' |          \
     784        awk '{print $2}'`
     785      dsnd=`echo ${gridsndv} | tr '!' ' ' | awk '{print $2}'`
     786      if test ${it} -eq 0 && test ${iexp} -eq 1; then
     787        echo "    Equivalent simulated sounding grid point: "${gridsnd}" distance: "\
     788          ${dsnd}
     789      fi
    778790
    779791      # Getting values at the sounding point
     
    806818
    807819      # Time step from simulated file
    808       timestep=`python ${pyHOME}/nc_var.py -o get_time -f ${simsndptf}               \
    809         -S ${its}';'${tunits} -v time`
     820      timestepv=`python ${pyHOME}/nc_var.py -o get_time -f ${simsndptf}               \
     821        -S ${otimev}';'${tunits} -v time | tr ' ' '@'`
     822      timestep=`echo ${timestepv} | tr '@' ' ' | awk '{print $1}'`
    810823      if test $? -ne 0; then
    811824        echo ${errmsg}
    812825        echo "  python failed!!"
    813826        echo python ${pyHOME}/nc_var.py -o get_time -f ${simsndptf}                  \
    814           -S ${its}';'${tunits} -v time
     827          -S ${otimev}';'${tunits} -v time
    815828        exit
    816829      fi
    817830
    818831      if test ${iexp} -eq 1; then
    819         echo "   "${its}": it="${timestep}" "$(echo ${dateS} | tr '!' ' ')" "${datefS}
     832        echo "     "${it}": it="${timestep}" "$(echo ${dateS} | tr '!' ' ')" "${datefS}
    820833        tacomplabs='$ta^{obs}$,$ta^{'${expn}'}$'
    821834        tdacomplabs='$tda^{obs}$,$tda^{'${expn}'}$'
     
    850863        cbar=`echo ${CFvarvals} | tr ':' ' ' | awk '{print $7}'`
    851864
    852         fivals=${sndstid}'#'${sndstn}'#'${sndv}'#'${ofigdir}'#'${datefS}'#'${fmtTts}
     865        fivals=${stid}'#'${sndstn}'#'${sndv}'#'${ofigdir}'#'${datefS}'#'${fmtTts}
    853866        fivals=${fivals}'#'${simsndptf}'#'${sndorigfn}'#'${expl}'#'${expn}'#'${cbar}
    854867
     
    867880    compfiles=${tacompfiles}';'${tdacompfiles}
    868881
    869     fivals=${sndstid}'@'${sndstn}'@'${complabs}'@'${compcols}'@'${compltyp}'@'
     882    fivals=${stid}'@'${sndstn}'@'${complabs}'@'${compcols}'@'${compltyp}'@'
    870883    fivals=${fivals}${compfiles}'@'${dateS}'@'${ofigdir}'@'${datefS}'@'${ofigdir}
    871884
     
    10181031    simsfcdiagf=${odir}'/simout_sfcdiags_'${expl}'.nc'
    10191032
    1020     gridsfc=`python ${pyHOME}/nc_var.py -o get_point -f ${simsfcdiagf}               \
    1021       -S 'XLONG:XLAT:Time|0' -v ${stl}','${stL}`
    1022     xgrid=`echo ${gridsfc} | tr ',' ' ' | awk '{print $1}'`
    1023     ygrid=`echo ${gridsfc} | tr ',' ' ' | awk '{print $2}'`
     1033    gridsfcv=`python ${pyHOME}/nc_var.py -o get_point -f ${simsfcdiagf}              \
     1034      -S 'XLONG:XLAT:Time|0' -v ${stl}','${stL} | tr ' ' '!'`
     1035    xgrid=`echo ${gridsfcv} | tr '!' ' ' | awk '{print $1}' | tr ',' ' ' |           \
     1036      awk '{print $1}'`
     1037    ygrid=`echo ${gridsfcv} | tr '!' ' ' | awk '{print $1}' | tr ',' ' ' |           \
     1038      awk '{print $2}'`
     1039    distgrid=`echo ${gridsfcv} | tr '!' ' ' | awk '{print $2}'`
    10241040
    10251041    sfcstats=${sti}'@'${stn}'@'${stl}'@'${stL}'@'${gridsfc}
     
    10831099
    10841100    # Looking for obs time
    1085     oit=`python ${pyHOME}/nc_var.py -o get_time -f ${obssfcfile}                     \
    1086       -S ${simtstep}';'${tunits} -v ststimes | grep -v differ`
     1101    oitv=`python ${pyHOME}/nc_var.py -o get_time -f ${obssfcfile}                    \
     1102      -S ${simtstep}';'${tunits} -v ststimes | grep -v differ | tr ' ' '@'`
     1103    oit=`echo ${oitv} | tr '@' ' ' | awk '{print $1}'`
    10871104
    10881105    for sfcnxv in ${sfcs}; do
Note: See TracChangeset for help on using the changeset viewer.