# [Met_help] [rt.rap.ucar.edu #96463] History for calculate multiple variables in config file

John Halley Gotway via RT met_help at ucar.edu
Thu Aug 27 14:01:27 MDT 2020

```----------------------------------------------------------------
Initial Request
----------------------------------------------------------------

Hello,

I am wondering how to get new variables by using multiple known variables
in the config file? e.g:

I have "UGRD' and "VGRD" defined in the ensemble_stat as below, but I want
to get WIND instead of the U/V component by using sqrt(UGRD^2+VGRD^2), how
to do that in the config file?

name       = "UGRD";
level      = [ "P850", "P250" ];
cat_thresh = [ <=5, >5&&<=10, >10&&<=15, >15&&<=20, >20&&<=25,
>25&&<=30, >30&&<=35, >35&&<=40, >40&&<=45, >45&&<=50, > 50 ];
},

{
name       = "VGRD";
level      = [ "P850", "P250" ];
cat_thresh = [ <=5, >5&&<=10, >10&&<=15, >15&&<=20, >20&&<=25,
>25&&<=30, >30&&<=35, >35&&<=40, >40&&<=45, >45&&<=50, > 50 ];

The MET document only talks about how to do the conversion for a single
variable, but not multiple ones.

Thank you.
Binyu

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

Subject: calculate multiple variables in config file
From: John Halley Gotway
Time: Thu Aug 27 13:28:45 2020

Binyu,

In general, MET does not provide a way of reading multiple input
variables
and deriving a new field in the configuration file. However, we did
support for python-embedding with this use in mind. Generally
speaking, you
can write a python script to read data in whatever way you'd like...
compute whatever sort of values you'd like... and then pass the result
to
the MET tools via memory. So that's the recommended way of deriving
new
datasets for MET to process.

However, python-embedding is not required for WIND speed. You've
stumbled
across a very particular derivation type that is already supported
directly
in MET. When using input GRIB1 or GRIB2 files, if you request the
"WIND"
variable, MET will first try to read that from the input data file. If
and
VGRD records and use them to derive WIND speed on the fly.

I'd recommend running the plot_data_plane tool to try that out:

plot_data_plane in.grb wind_speed.ps 'name="WIND"; level="P850";' -v 4

And then look closely at the log messages that are printed to screen.
It
should tell you that it's deriving WIND speed for you on the fly.

Thanks,
John

On Wed, Aug 26, 2020 at 3:28 PM George McCabe via RT
<met_help at ucar.edu>
wrote:

>
> Wed Aug 26 15:27:36 2020: Request 96463 was acted upon.
> Transaction: Given to johnhg (John Halley Gotway) by mccabe
>        Queue: met_help
>      Subject: calculate multiple variables in config file
>        Owner: johnhg
>   Requestors: binyu.wang at noaa.gov
>       Status: new
>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=96463 >
>
>
> This transaction appears to have no content
>

------------------------------------------------
Subject: calculate multiple variables in config file
From: binyu.wang at noaa.gov
Time: Thu Aug 27 13:51:41 2020

Cool, that works. It seems it works for WDIR as well!

Thank you very much.

On Thu, Aug 27, 2020 at 3:28 PM John Halley Gotway via RT
<met_help at ucar.edu>
wrote:

> Binyu,
>
> In general, MET does not provide a way of reading multiple input
variables
> and deriving a new field in the configuration file. However, we did
> support for python-embedding with this use in mind. Generally
speaking, you
> can write a python script to read data in whatever way you'd like...
> compute whatever sort of values you'd like... and then pass the
result to
> the MET tools via memory. So that's the recommended way of deriving
new
> datasets for MET to process.
>
> However, python-embedding is not required for WIND speed. You've
stumbled
> across a very particular derivation type that is already supported
directly
> in MET. When using input GRIB1 or GRIB2 files, if you request the
"WIND"
> variable, MET will first try to read that from the input data file.
If
and
> VGRD records and use them to derive WIND speed on the fly.
>
> I'd recommend running the plot_data_plane tool to try that out:
>
> plot_data_plane in.grb wind_speed.ps 'name="WIND"; level="P850";' -v
4
>
> And then look closely at the log messages that are printed to
screen. It
> should tell you that it's deriving WIND speed for you on the fly.
>
> Thanks,
> John
>
> On Wed, Aug 26, 2020 at 3:28 PM George McCabe via RT
<met_help at ucar.edu>
> wrote:
>
> >
> > Wed Aug 26 15:27:36 2020: Request 96463 was acted upon.
> > Transaction: Given to johnhg (John Halley Gotway) by mccabe
> >        Queue: met_help
> >      Subject: calculate multiple variables in config file
> >        Owner: johnhg
> >   Requestors: binyu.wang at noaa.gov
> >       Status: new
> >  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=96463 >
> >
> >
> > This transaction appears to have no content
> >
>
>

------------------------------------------------
```