[Met_help] [rt.rap.ucar.edu #80842] History for Use of separate masks for FCST and OBS in MODE

John Halley Gotway via RT met_help at ucar.edu
Wed Jun 14 09:54:13 MDT 2017


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

Hello,


I am using MODE to verify HRRR reflectivities for snowfall events. I would like to mask the HRRR forecast with its 2 m temp, and the observed radar with the observed 2 m temp (using the RTMA). This will allow me to verify only the areas where it might be reasonably expected that snowfall is occurring in both the model and the atmosphere. Am I able to use separate masks for each field? I haven't been able to get it to work using mask - poly and mask - poly_flag.


Thanks,


Marty

_____________________________
Marty Baxter, Ph.D.
Associate Professor of Meteorology
Department of Earth and Atmospheric Sciences
Central Michigan University
(989) 774-2055


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

Subject: Use of separate masks for FCST and OBS in MODE
From: John Halley Gotway
Time: Mon Jun 12 16:02:25 2017

Hello Marty,

I see that you have a question about applying masks in the MODE tool.
You'd like to apply one mask to the forecast field and a *different*
mask
to the observation field.  That's a great question.

The short answer is no, you can't define different masks for the
forecast
and observation fields.  MODE only lets you define a single mask (a
masking
grid or polyline) and then you choose whether your want to apply it to
the
FCST, OBS, or BOTH of them.

However, there is a way you can accomplish this logic using the
gen_vx_mask
tool.  You'd run it once to pre-process the forecast field and a
second
time to pre-process the observation field.  And then pass those output
files to MODE.

I'll use sample data that's included with the MET release tarball to
illustrate... here I'm assuming met-6.0.  I'm reading 3-hour precip
and
2-meter temperature and resetting the precip at any grid point where
the
temperature is less than 290 K to a value of 0:

cd met-6.0
bin/gen_vx_mask \
data/sample_fcst/2005080700/wrfprs_ruc13_12.tm00_G212 \
data/sample_fcst/2005080700/wrfprs_ruc13_12.tm00_G212 \
APCP_03_where_2m_TMPge290.nc \
-type data \
-input_field 'name="APCP"; level="A3";' \
-mask_field 'name="TMP"; level="Z2";' \
-thresh 'lt290&&ne-9999' -v 4 -value 0

So this is a bit confusing.  Here's what I'm doing...

- The first argument is the input file which defines the grid.
- The second argument is used to define the masking region... and
since I'm
reading data from the same input file, I've listed that file twice.
- The third argument is the output file name.
- The type of masking is "data" masking where we read a 2D field of
data
and apply a threshold.
- By default, gen_vx_mask initializes each grid point to a value of 0.
Specifying "-input_field" tells it to initialize each grid point to
the
value of that field (in my example 3-hour precip).
- The "-mask_field" option defines the data field that should be
thresholded.
- The "-thresh" option defines the threshold to be applied.
- The "-value" option tells it what "mask" value to write to the
output...
and I've chosen 0.

I chose my threshold as less than 290 and not -9999 (which is MET's
internal missing data value).  So any grid point where the 2 meter
temperature is less than 290 K and is not bad data will be replaced by
a
value of 0.

To more easily demonstrate this, I changed to using "-value 10" and
ran the
output through plot_data_plane:
bin/plot_data_plane \
APCP_03_where_2m_TMPge290.nc APCP_03_where_2m_TMPge290.ps \
'name="data_mask"; level="(*,*)";'

I attached the resulting plot.  Anywhere you see the pink value of 10,
that's where gen_vx_mask has masked out the grid point.

Hopefully you can see how this logic could be adapted to your data.

Hope that helps.

Thanks,
John Halley Gotway


On Mon, Jun 12, 2017 at 2:24 PM, Baxter, Martin A via RT
<met_help at ucar.edu>
wrote:

>
> Mon Jun 12 14:24:24 2017: Request 80842 was acted upon.
> Transaction: Ticket created by baxte1ma at cmich.edu
>        Queue: met_help
>      Subject: Use of separate masks for FCST and OBS in MODE
>        Owner: Nobody
>   Requestors: baxte1ma at cmich.edu
>       Status: new
>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=80842 >
>
>
> Hello,
>
>
> I am using MODE to verify HRRR reflectivities for snowfall events. I
would
> like to mask the HRRR forecast with its 2 m temp, and the observed
radar
> with the observed 2 m temp (using the RTMA). This will allow me to
verify
> only the areas where it might be reasonably expected that snowfall
is
> occurring in both the model and the atmosphere. Am I able to use
separate
> masks for each field? I haven't been able to get it to work using
mask -
> poly and mask - poly_flag.
>
>
> Thanks,
>
>
> Marty
>
> _____________________________
> Marty Baxter, Ph.D.
> Associate Professor of Meteorology
> Department of Earth and Atmospheric Sciences
> Central Michigan University
> (989) 774-2055
>
>

------------------------------------------------
Subject: Use of separate masks for FCST and OBS in MODE
From: Baxter, Martin A
Time: Wed Jun 14 07:49:01 2017

Hi John,


Thank you for your quick reply. I was able to follow your process to
achieve what I wanted.


Marty


_____________________________
Marty Baxter, Ph.D.
Associate Professor of Meteorology
Department of Earth and Atmospheric Sciences
Central Michigan University
(989) 774-2055
________________________________
From: John Halley Gotway via RT <met_help at ucar.edu>
Sent: Monday, June 12, 2017 6:02:26 PM
To: Baxter, Martin A
Subject: Re: [rt.rap.ucar.edu #80842] Use of separate masks for FCST
and OBS in MODE

Hello Marty,

I see that you have a question about applying masks in the MODE tool.
You'd like to apply one mask to the forecast field and a *different*
mask
to the observation field.  That's a great question.

The short answer is no, you can't define different masks for the
forecast
and observation fields.  MODE only lets you define a single mask (a
masking
grid or polyline) and then you choose whether your want to apply it to
the
FCST, OBS, or BOTH of them.

However, there is a way you can accomplish this logic using the
gen_vx_mask
tool.  You'd run it once to pre-process the forecast field and a
second
time to pre-process the observation field.  And then pass those output
files to MODE.

I'll use sample data that's included with the MET release tarball to
illustrate... here I'm assuming met-6.0.  I'm reading 3-hour precip
and
2-meter temperature and resetting the precip at any grid point where
the
temperature is less than 290 K to a value of 0:

cd met-6.0
bin/gen_vx_mask \
data/sample_fcst/2005080700/wrfprs_ruc13_12.tm00_G212 \
data/sample_fcst/2005080700/wrfprs_ruc13_12.tm00_G212 \
APCP_03_where_2m_TMPge290.nc \
-type data \
-input_field 'name="APCP"; level="A3";' \
-mask_field 'name="TMP"; level="Z2";' \
-thresh 'lt290&&ne-9999' -v 4 -value 0

So this is a bit confusing.  Here's what I'm doing...

- The first argument is the input file which defines the grid.
- The second argument is used to define the masking region... and
since I'm
reading data from the same input file, I've listed that file twice.
- The third argument is the output file name.
- The type of masking is "data" masking where we read a 2D field of
data
and apply a threshold.
- By default, gen_vx_mask initializes each grid point to a value of 0.
Specifying "-input_field" tells it to initialize each grid point to
the
value of that field (in my example 3-hour precip).
- The "-mask_field" option defines the data field that should be
thresholded.
- The "-thresh" option defines the threshold to be applied.
- The "-value" option tells it what "mask" value to write to the
output...
and I've chosen 0.

I chose my threshold as less than 290 and not -9999 (which is MET's
internal missing data value).  So any grid point where the 2 meter
temperature is less than 290 K and is not bad data will be replaced by
a
value of 0.

To more easily demonstrate this, I changed to using "-value 10" and
ran the
output through plot_data_plane:
bin/plot_data_plane \
APCP_03_where_2m_TMPge290.nc APCP_03_where_2m_TMPge290.ps \
'name="data_mask"; level="(*,*)";'

I attached the resulting plot.  Anywhere you see the pink value of 10,
that's where gen_vx_mask has masked out the grid point.

Hopefully you can see how this logic could be adapted to your data.

Hope that helps.

Thanks,
John Halley Gotway


On Mon, Jun 12, 2017 at 2:24 PM, Baxter, Martin A via RT
<met_help at ucar.edu>
wrote:

>
> Mon Jun 12 14:24:24 2017: Request 80842 was acted upon.
> Transaction: Ticket created by baxte1ma at cmich.edu
>        Queue: met_help
>      Subject: Use of separate masks for FCST and OBS in MODE
>        Owner: Nobody
>   Requestors: baxte1ma at cmich.edu
>       Status: new
>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=80842 >
>
>
> Hello,
>
>
> I am using MODE to verify HRRR reflectivities for snowfall events. I
would
> like to mask the HRRR forecast with its 2 m temp, and the observed
radar
> with the observed 2 m temp (using the RTMA). This will allow me to
verify
> only the areas where it might be reasonably expected that snowfall
is
> occurring in both the model and the atmosphere. Am I able to use
separate
> masks for each field? I haven't been able to get it to work using
mask -
> poly and mask - poly_flag.
>
>
> Thanks,
>
>
> Marty
>
> _____________________________
> Marty Baxter, Ph.D.
> Associate Professor of Meteorology
> Department of Earth and Atmospheric Sciences
> Central Michigan University
> (989) 774-2055
>
>


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


More information about the Met_help mailing list