[Met_help] [rt.rap.ucar.edu #92694] History for Python embedding with prob = TRUE

John Halley Gotway via RT met_help at ucar.edu
Thu Oct 17 12:50:35 MDT 2019


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

Hi met-help!

I have a quick question on the python embedding capability.

With a forecast file in GRIB format, I can do some probabilistic
verification (with point-stat) with following configuration:

fcst = {
   cat_thresh = [ ==0.1 ];
   field = [
      { name = "TCDC"; prob = TRUE;
        GRIB_lvl_typ = 10;
        GRIB_lvl_val1 = 0;
      }
   ];
}



To do the same thing with NetCDF forecast file, I uses a python embedding
with following configuration:

fcst = {
   cat_thresh = [ ==0.1 ];
   field = [
      { name = "./python_embedding.py"; prob = TRUE; }
   ];
}

However, this does not produce "PCT" (Contingency Table counts for
Probabilistic forecasts). It seems that with above configurations, the
variable is not processed as probabilistic variable.

So my question is ... can we treat a given forecast variable as a
probabilistic variable WITH python embedding?

Thank you,

BJ

-- 

Byoung-Joo (BJ) Jung

National Center for Atmospheric Research

Mesoscale and Microscale Meteorology Laboratory

PO Box 3000, Boulder CO 80307

Phone: 303-497-8151


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

Subject: Python embedding with prob = TRUE
From: John Halley Gotway
Time: Thu Oct 17 11:19:34 2019

BJ,

Thanks for alerting us to this issue.  I tested this out myself and
found
the same behavior you did.  I tested with grid_stat instead of
point_stat,
but it calls the same library code.

I found the issue in the source code and see that it was a small
oversight
in the VarInfoPython::set_dict() function.  Unfortunately, this will
require a code change to fix.  I wrote up a GitHub issue describing
this:
https://github.com/NCAR/MET/issues/1210

I'll fix it today and that'll be included in the next bugfix release
of
MET, met-8.1.2.

I've attached an updated version of the file that needs to be updated:
   src/libcode/vx_data2d_python/var_info_python.cc

If you'd like, you could overwrite the existing version of that file
with
the attached one.  And then do a "make clean" and "make install" of
MET.

And that should fix the problem.  Please let me know how all of that
goes.

Thanks,
John


On Thu, Oct 17, 2019 at 9:34 AM bjung at ucar.edu via RT
<met_help at ucar.edu>
wrote:

>
> Thu Oct 17 09:34:18 2019: Request 92694 was acted upon.
> Transaction: Ticket created by bjung at ucar.edu
>        Queue: met_help
>      Subject: Python embedding with prob = TRUE
>        Owner: Nobody
>   Requestors: bjung at ucar.edu
>       Status: new
>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=92694 >
>
>
> Hi met-help!
>
> I have a quick question on the python embedding capability.
>
> With a forecast file in GRIB format, I can do some probabilistic
> verification (with point-stat) with following configuration:
>
> fcst = {
>    cat_thresh = [ ==0.1 ];
>    field = [
>       { name = "TCDC"; prob = TRUE;
>         GRIB_lvl_typ = 10;
>         GRIB_lvl_val1 = 0;
>       }
>    ];
> }
>
>
>
> To do the same thing with NetCDF forecast file, I uses a python
embedding
> with following configuration:
>
> fcst = {
>    cat_thresh = [ ==0.1 ];
>    field = [
>       { name = "./python_embedding.py"; prob = TRUE; }
>    ];
> }
>
> However, this does not produce "PCT" (Contingency Table counts for
> Probabilistic forecasts). It seems that with above configurations,
the
> variable is not processed as probabilistic variable.
>
> So my question is ... can we treat a given forecast variable as a
> probabilistic variable WITH python embedding?
>
> Thank you,
>
> BJ
>
> --
>
> Byoung-Joo (BJ) Jung
>
> National Center for Atmospheric Research
>
> Mesoscale and Microscale Meteorology Laboratory
>
> PO Box 3000, Boulder CO 80307
>
> Phone: 303-497-8151
>
>

------------------------------------------------
Subject: Python embedding with prob = TRUE
From: bjung at ucar.edu
Time: Thu Oct 17 11:28:15 2019

Thank you for your explanation, John!

I am doing it with other path now, but will try your bugfix later. I
am
happy to see more convenient features (especially through python
embedding)
in MET !
Thanks for your help!

BJ

On Thu, Oct 17, 2019 at 11:19 AM John Halley Gotway via RT <
met_help at ucar.edu> wrote:

> BJ,
>
> Thanks for alerting us to this issue.  I tested this out myself and
found
> the same behavior you did.  I tested with grid_stat instead of
point_stat,
> but it calls the same library code.
>
> I found the issue in the source code and see that it was a small
oversight
> in the VarInfoPython::set_dict() function.  Unfortunately, this will
> require a code change to fix.  I wrote up a GitHub issue describing
this:
> https://github.com/NCAR/MET/issues/1210
>
> I'll fix it today and that'll be included in the next bugfix release
of
> MET, met-8.1.2.
>
> I've attached an updated version of the file that needs to be
updated:
>    src/libcode/vx_data2d_python/var_info_python.cc
>
> If you'd like, you could overwrite the existing version of that file
with
> the attached one.  And then do a "make clean" and "make install" of
MET.
>
> And that should fix the problem.  Please let me know how all of that
goes.
>
> Thanks,
> John
>
>
> On Thu, Oct 17, 2019 at 9:34 AM bjung at ucar.edu via RT
<met_help at ucar.edu>
> wrote:
>
> >
> > Thu Oct 17 09:34:18 2019: Request 92694 was acted upon.
> > Transaction: Ticket created by bjung at ucar.edu
> >        Queue: met_help
> >      Subject: Python embedding with prob = TRUE
> >        Owner: Nobody
> >   Requestors: bjung at ucar.edu
> >       Status: new
> >  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=92694 >
> >
> >
> > Hi met-help!
> >
> > I have a quick question on the python embedding capability.
> >
> > With a forecast file in GRIB format, I can do some probabilistic
> > verification (with point-stat) with following configuration:
> >
> > fcst = {
> >    cat_thresh = [ ==0.1 ];
> >    field = [
> >       { name = "TCDC"; prob = TRUE;
> >         GRIB_lvl_typ = 10;
> >         GRIB_lvl_val1 = 0;
> >       }
> >    ];
> > }
> >
> >
> >
> > To do the same thing with NetCDF forecast file, I uses a python
embedding
> > with following configuration:
> >
> > fcst = {
> >    cat_thresh = [ ==0.1 ];
> >    field = [
> >       { name = "./python_embedding.py"; prob = TRUE; }
> >    ];
> > }
> >
> > However, this does not produce "PCT" (Contingency Table counts for
> > Probabilistic forecasts). It seems that with above configurations,
the
> > variable is not processed as probabilistic variable.
> >
> > So my question is ... can we treat a given forecast variable as a
> > probabilistic variable WITH python embedding?
> >
> > Thank you,
> >
> > BJ
> >
> > --
> >
> > Byoung-Joo (BJ) Jung
> >
> > National Center for Atmospheric Research
> >
> > Mesoscale and Microscale Meteorology Laboratory
> >
> > PO Box 3000, Boulder CO 80307
> >
> > Phone: 303-497-8151
> >
> >
>
>

--

Byoung-Joo (BJ) Jung

National Center for Atmospheric Research

Mesoscale and Microscale Meteorology Laboratory

PO Box 3000, Boulder CO 80307

Phone: 303-497-8151

------------------------------------------------
Subject: Python embedding with prob = TRUE
From: John Halley Gotway
Time: Thu Oct 17 12:43:20 2019

BJ,

OK, I'll go ahead and resolve this ticket.  But please let me know if
you
run into any problems with the bugfix.

Thanks,
John

On Thu, Oct 17, 2019 at 11:28 AM bjung at ucar.edu via RT
<met_help at ucar.edu>
wrote:

>
> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=92694 >
>
> Thank you for your explanation, John!
>
> I am doing it with other path now, but will try your bugfix later. I
am
> happy to see more convenient features (especially through python
embedding)
> in MET !
> Thanks for your help!
>
> BJ
>
> On Thu, Oct 17, 2019 at 11:19 AM John Halley Gotway via RT <
> met_help at ucar.edu> wrote:
>
> > BJ,
> >
> > Thanks for alerting us to this issue.  I tested this out myself
and found
> > the same behavior you did.  I tested with grid_stat instead of
> point_stat,
> > but it calls the same library code.
> >
> > I found the issue in the source code and see that it was a small
> oversight
> > in the VarInfoPython::set_dict() function.  Unfortunately, this
will
> > require a code change to fix.  I wrote up a GitHub issue
describing this:
> > https://github.com/NCAR/MET/issues/1210
> >
> > I'll fix it today and that'll be included in the next bugfix
release of
> > MET, met-8.1.2.
> >
> > I've attached an updated version of the file that needs to be
updated:
> >    src/libcode/vx_data2d_python/var_info_python.cc
> >
> > If you'd like, you could overwrite the existing version of that
file with
> > the attached one.  And then do a "make clean" and "make install"
of MET.
> >
> > And that should fix the problem.  Please let me know how all of
that
> goes.
> >
> > Thanks,
> > John
> >
> >
> > On Thu, Oct 17, 2019 at 9:34 AM bjung at ucar.edu via RT
<met_help at ucar.edu
> >
> > wrote:
> >
> > >
> > > Thu Oct 17 09:34:18 2019: Request 92694 was acted upon.
> > > Transaction: Ticket created by bjung at ucar.edu
> > >        Queue: met_help
> > >      Subject: Python embedding with prob = TRUE
> > >        Owner: Nobody
> > >   Requestors: bjung at ucar.edu
> > >       Status: new
> > >  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=92694
> >
> > >
> > >
> > > Hi met-help!
> > >
> > > I have a quick question on the python embedding capability.
> > >
> > > With a forecast file in GRIB format, I can do some probabilistic
> > > verification (with point-stat) with following configuration:
> > >
> > > fcst = {
> > >    cat_thresh = [ ==0.1 ];
> > >    field = [
> > >       { name = "TCDC"; prob = TRUE;
> > >         GRIB_lvl_typ = 10;
> > >         GRIB_lvl_val1 = 0;
> > >       }
> > >    ];
> > > }
> > >
> > >
> > >
> > > To do the same thing with NetCDF forecast file, I uses a python
> embedding
> > > with following configuration:
> > >
> > > fcst = {
> > >    cat_thresh = [ ==0.1 ];
> > >    field = [
> > >       { name = "./python_embedding.py"; prob = TRUE; }
> > >    ];
> > > }
> > >
> > > However, this does not produce "PCT" (Contingency Table counts
for
> > > Probabilistic forecasts). It seems that with above
configurations, the
> > > variable is not processed as probabilistic variable.
> > >
> > > So my question is ... can we treat a given forecast variable as
a
> > > probabilistic variable WITH python embedding?
> > >
> > > Thank you,
> > >
> > > BJ
> > >
> > > --
> > >
> > > Byoung-Joo (BJ) Jung
> > >
> > > National Center for Atmospheric Research
> > >
> > > Mesoscale and Microscale Meteorology Laboratory
> > >
> > > PO Box 3000, Boulder CO 80307
> > >
> > > Phone: 303-497-8151
> > >
> > >
> >
> >
>
> --
>
> Byoung-Joo (BJ) Jung
>
> National Center for Atmospheric Research
>
> Mesoscale and Microscale Meteorology Laboratory
>
> PO Box 3000, Boulder CO 80307
>
> Phone: 303-497-8151
>
>

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


More information about the Met_help mailing list