[Met_help] [rt.rap.ucar.edu #77367] History for point stat question

John Halley Gotway via RT met_help at ucar.edu
Fri Aug 12 11:45:21 MDT 2016


----------------------------------------------------------------
  Initial Request
----------------------------------------------------------------

So I am trying to verify data files against forecast files. I am having an
issue. I have to go through day by day for the data file. So for example
lets say the data file is for March 25, 2016. In that file are all the
points specified with the correct time. I have to check this for forecast 48
hours preceding and following the 25th to cover the 00, 12, 15, etc hour
forecasts. So the files are produced, with some files having nothing. 

The issue I'm having is when I process the 26th of March files are getting
overwritten, for example  the file
point_stat_GALWEM_120000L_20160325_120000V_mpr.txt which has data gets
overwritten because the file of 26th March doesn't have any data for that
period when it checks against the forecast. Is there a way to have the
program point_stat not print out files that have no matches? Right now I
have to run each day and keep the files with data in a separate directory so
as to not overwrite them. I am not sure if I am making any sense, but here
is an example of a python script I have to run many files at once ( I have
also attached my config file for point_stat):

import os
import subprocess as sp

START_MONTH = 3
END_MONTH = 3

def main():
    cycles = ['00', '12']
    arg = ["/h/WXQC/met-5.1/bin/point_stat", None,
"/home/bliujuss/Dust_Eval/Original_Files/Data/HDF/March_25_2016.nc",
"/home/bliujuss/config/PointStatConfig_MODIS"]

    for cycle in cycles:
        for fcst_hr in range(12, 51, 3):
            for month in range(START_MONTH, END_MONTH + 1):
                for day in range(22, 28):
                    fname =
"/home/stronghs/dust_study/GALWEM/{0:02}{1:02}/GALWEM_2016{0:02}{1:02}_CY{2}
_FH{3:02}.GR2".format(month, day, cycle, fcst_hr)
                    if os.path.isfile(fname):
                        arg[1] = fname
                        sp.call(arg)
                        print fname
                    else:
                        print "Could not find file {0}".format(fname)


if __name__ == "__main__":
    main()


V/R,

STEVEN D. BLIUJUS, GS-07, DAFC
16 WS/WXE
DSN: 272-7151
COMM: 402-232-7151




----------------------------------------------------------------
  Complete Ticket History
----------------------------------------------------------------

Subject: point stat question
From: John Halley Gotway
Time: Thu Jul 28 12:27:31 2016

Steve,

I don't understand all the details of the issue you're having, but I
do
understand that you have non-unqiue output filenames.  Your output
files
are being overwritten so you have to shuffle them around to different
directories.

I would suggest using the Point-Stat configuration file option named
"output_prefix".  I see that you already have it set as follows:
   output_prefix  = "GALWEM";

The MET configuration files support the use of environment variables.
Looking at the sample script you sent, you might consider defining the
current cycle and forecast hour as environment variables within your
loops
prior to calling Point-Stat.  And then set:
   output_prefix = "GALWEM_${cycle}_F${fcst_hr}";

As I said, I don't understand all the details, but hopefully you can
figure
out what combination of environment variables will result in the
creation
of unique output file names.

Hope that helps.

Thanks,
John Halley Gotway


On Thu, Jul 28, 2016 at 10:37 AM, BLIUJUS, STEVEN D GS-07 USAF ACC 16
WS/WXE via RT <met_help at ucar.edu> wrote:

>
> Thu Jul 28 10:37:06 2016: Request 77367 was acted upon.
> Transaction: Ticket created by steven.bliujus.1 at us.af.mil
>        Queue: met_help
>      Subject: point stat question
>        Owner: Nobody
>   Requestors: steven.bliujus.1 at us.af.mil
>       Status: new
>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=77367 >
>
>
> So I am trying to verify data files against forecast files. I am
having an
> issue. I have to go through day by day for the data file. So for
example
> lets say the data file is for March 25, 2016. In that file are all
the
> points specified with the correct time. I have to check this for
forecast
> 48
> hours preceding and following the 25th to cover the 00, 12, 15, etc
hour
> forecasts. So the files are produced, with some files having
nothing.
>
> The issue I'm having is when I process the 26th of March files are
getting
> overwritten, for example  the file
> point_stat_GALWEM_120000L_20160325_120000V_mpr.txt which has data
gets
> overwritten because the file of 26th March doesn't have any data for
that
> period when it checks against the forecast. Is there a way to have
the
> program point_stat not print out files that have no matches? Right
now I
> have to run each day and keep the files with data in a separate
directory
> so
> as to not overwrite them. I am not sure if I am making any sense,
but here
> is an example of a python script I have to run many files at once (
I have
> also attached my config file for point_stat):
>
> import os
> import subprocess as sp
>
> START_MONTH = 3
> END_MONTH = 3
>
> def main():
>     cycles = ['00', '12']
>     arg = ["/h/WXQC/met-5.1/bin/point_stat", None,
> "/home/bliujuss/Dust_Eval/Original_Files/Data/HDF/March_25_2016.nc",
> "/home/bliujuss/config/PointStatConfig_MODIS"]
>
>     for cycle in cycles:
>         for fcst_hr in range(12, 51, 3):
>             for month in range(START_MONTH, END_MONTH + 1):
>                 for day in range(22, 28):
>                     fname =
>
>
"/home/stronghs/dust_study/GALWEM/{0:02}{1:02}/GALWEM_2016{0:02}{1:02}_CY{2}
> _FH{3:02}.GR2".format(month, day, cycle, fcst_hr)
>                     if os.path.isfile(fname):
>                         arg[1] = fname
>                         sp.call(arg)
>                         print fname
>                     else:
>                         print "Could not find file
{0}".format(fname)
>
>
> if __name__ == "__main__":
>     main()
>
>
> V/R,
>
> STEVEN D. BLIUJUS, GS-07, DAFC
> 16 WS/WXE
> DSN: 272-7151
> COMM: 402-232-7151
>
>
>
>

------------------------------------------------


More information about the Met_help mailing list