[Met_help] [rt.rap.ucar.edu #61504] History for MODE: question regarding automating the configuration file setup
John Halley Gotway via RT
met_help at ucar.edu
Thu May 23 13:17:55 MDT 2013
----------------------------------------------------------------
Initial Request
----------------------------------------------------------------
Hi John,
Had a question regarding automating the MODE configuration file. We need to make the output_prefix variable dynamic in the MODE configuration file, such as
output_prefix = "m3o3MODELsitehtvar_${ctnum}_"
where the user updates the string "ctnum" each time MODE is run via an interactive script.
Specifically, is this possible?
1) Can the configuration file take in a variable (ie, $ctnum=$1)?
2) Can the output_prefix ?
Thanks,
Gail
----------------------------------------------------------------
Complete Ticket History
----------------------------------------------------------------
Subject: Re: [rt.rap.ucar.edu #61504] MODE: question regarding automating the configuration file setup
From: John Halley Gotway
Time: Thu May 23 09:50:58 2013
Gail,
Yes, the configuration files within MET support the use of environment
variables.
output_prefix = "m3o3MODELsitehtvar_${ctnum}_"
So the above setting should work fine as long as the environment
variable "ctnum" has been defined prior to calling MODE.
Please do give it a try first to make sure it's working exactly how
you expect.
Thanks,
John
On 05/22/2013 03:08 PM, gail.t.vaucher.civ at mail.mil via RT wrote:
>
> Wed May 22 15:08:57 2013: Request 61504 was acted upon.
> Transaction: Ticket created by gail.t.vaucher.civ at mail.mil
> Queue: met_help
> Subject: MODE: question regarding automating the configuration
file setup
> Owner: Nobody
> Requestors: gail.t.vaucher.civ at mail.mil
> Status: new
> Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=61504 >
>
>
> Hi John,
>
> Had a question regarding automating the MODE configuration file. We
need to make the output_prefix variable dynamic in the MODE
configuration file, such as
>
> output_prefix = "m3o3MODELsitehtvar_${ctnum}_"
>
> where the user updates the string "ctnum" each time MODE is run via
an interactive script.
>
> Specifically, is this possible?
> 1) Can the configuration file take in a variable (ie, $ctnum=$1)?
> 2) Can the output_prefix ?
>
> Thanks,
> Gail
>
------------------------------------------------
Subject: MODE: question regarding automating the configuration file setup
From: gail.t.vaucher.civ at mail.mil
Time: Thu May 23 09:57:33 2013
Classification: UNCLASSIFIED
Caveats: NONE
Hi John,
"Prior to calling MODE".... not sure where that would be (so that the
config
file uses the variable)?
We've determined that
ctnum = "290.0";
can't be used in the config file.
Gail
-----Original Message-----
From: John Halley Gotway via RT [mailto:met_help at ucar.edu]
Sent: Thursday, May 23, 2013 9:51 AM
To: Vaucher, Gail T CIV (US)
Cc: Raby, John W CIV USARMY ARL (US); Raby, Yasmina R CTR USARMY ARL
(US)
Subject: Re: [rt.rap.ucar.edu #61504] MODE: question regarding
automating the
configuration file setup
Gail,
Yes, the configuration files within MET support the use of environment
variables.
output_prefix = "m3o3MODELsitehtvar_${ctnum}_"
So the above setting should work fine as long as the environment
variable
"ctnum" has been defined prior to calling MODE.
Please do give it a try first to make sure it's working exactly how
you
expect.
Thanks,
John
On 05/22/2013 03:08 PM, gail.t.vaucher.civ at mail.mil via RT wrote:
>
> Wed May 22 15:08:57 2013: Request 61504 was acted upon.
> Transaction: Ticket created by gail.t.vaucher.civ at mail.mil
> Queue: met_help
> Subject: MODE: question regarding automating the configuration
file
> setup
> Owner: Nobody
> Requestors: gail.t.vaucher.civ at mail.mil
> Status: new
> Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=61504 >
>
>
> Hi John,
>
> Had a question regarding automating the MODE configuration file. We
need to
> make the output_prefix variable dynamic in the MODE configuration
file, such
> as
>
> output_prefix = "m3o3MODELsitehtvar_${ctnum}_"
>
> where the user updates the string "ctnum" each time MODE is run via
an
> interactive script.
>
> Specifically, is this possible?
> 1) Can the configuration file take in a variable (ie, $ctnum=$1)?
> 2) Can the output_prefix ?
>
> Thanks,
> Gail
>
Classification: UNCLASSIFIED
Caveats: NONE
------------------------------------------------
Subject: MODE: question regarding automating the configuration file setup
From: John Halley Gotway
Time: Thu May 23 11:11:23 2013
Gail,
If you're calling MODE from a script, just set that variable in your
script prior to executing the call to MODE.
Does that make sense?
Here's an example using the attached config file and some sample data
include in the METv4.0 release:
> setenv ctnum 290.0
> METv4.0/bin/mode \
METv4.0/out/pcp_combine/sample_fcst_12L_2005080712V_12A.nc \
METv4.0/out/pcp_combine/sample_obs_2005080712V_12A.nc \
MODEConfig_testing_env_var
And here's what's printed to the screen. As you can see, setting
ctnum to 290.0 does have the desired effect in the output_prefix
parameter.
DEBUG 1: Default Config File:
/d1/johnhg/MET/MET_releases/METv4.0/data/config/MODEConfig_default
DEBUG 1: Match Config File: MODEConfig_testing_env_var
DEBUG 1: Merge Config File: MODEConfig_testing_env_var
DEBUG 1: Forecast File:
METv4.0/out/pcp_combine/sample_fcst_12L_2005080712V_12A.nc
DEBUG 1: Observation File:
METv4.0/out/pcp_combine/sample_obs_2005080712V_12A.nc
DEBUG 1: Forecast Field: APCP_12 at A12
DEBUG 1: Observation Field: APCP_12 at A12
DEBUG 2: Identifying objects in the forecast and observation fields...
DEBUG 2: Computing contingency table statistics...
DEBUG 2: Identified: 6 forecast objects and 5 observation objects.
DEBUG 2: Performing merging (THRESH) in the forecast field.
DEBUG 2: Performing merging (THRESH) in the observation field.
DEBUG 2: Remaining: 6 forecast objects and 5 observation objects.
DEBUG 2: Performing matching (MERGE_BOTH) between the forecast and
observation fields.
DEBUG 1: Creating Fcst-Obs Object Statistics file:
./mode_test_env_var_290.0_120000L_20050807_120000V_120000A_obj.txt
DEBUG 1: Creating Contingency Table Statistics file:
./mode_test_env_var_290.0_120000L_20050807_120000V_120000A_cts.txt
DEBUG 1: Creating Object NetCDF file:
./mode_test_env_var_290.0_120000L_20050807_120000V_120000A_obj.nc
DEBUG 1: Loading forecast raw color table:
/d1/johnhg/MET/MET_releases/METv4.0/data/colortables/met_default.ctable
DEBUG 1: Loading observation raw color table:
/d1/johnhg/MET/MET_releases/METv4.0/data/colortables/met_default.ctable
DEBUG 1: Creating postscript file:
./mode_test_env_var_290.0_120000L_20050807_120000V_120000A.ps
Hope that helps.
Thanks,
John
On 05/23/2013 09:57 AM, gail.t.vaucher.civ at mail.mil via RT wrote:
>
> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=61504 >
>
> Classification: UNCLASSIFIED
> Caveats: NONE
>
> Hi John,
>
> "Prior to calling MODE".... not sure where that would be (so that
the config
> file uses the variable)?
>
> We've determined that
>
> ctnum = "290.0";
>
> can't be used in the config file.
>
> Gail
>
> -----Original Message-----
> From: John Halley Gotway via RT [mailto:met_help at ucar.edu]
> Sent: Thursday, May 23, 2013 9:51 AM
> To: Vaucher, Gail T CIV (US)
> Cc: Raby, John W CIV USARMY ARL (US); Raby, Yasmina R CTR USARMY ARL
(US)
> Subject: Re: [rt.rap.ucar.edu #61504] MODE: question regarding
automating the
> configuration file setup
>
> Gail,
>
> Yes, the configuration files within MET support the use of
environment
> variables.
>
> output_prefix = "m3o3MODELsitehtvar_${ctnum}_"
>
> So the above setting should work fine as long as the environment
variable
> "ctnum" has been defined prior to calling MODE.
>
> Please do give it a try first to make sure it's working exactly how
you
> expect.
>
> Thanks,
> John
>
> On 05/22/2013 03:08 PM, gail.t.vaucher.civ at mail.mil via RT wrote:
>>
>> Wed May 22 15:08:57 2013: Request 61504 was acted upon.
>> Transaction: Ticket created by gail.t.vaucher.civ at mail.mil
>> Queue: met_help
>> Subject: MODE: question regarding automating the
configuration file
>> setup
>> Owner: Nobody
>> Requestors: gail.t.vaucher.civ at mail.mil
>> Status: new
>> Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=61504 >
>>
>>
>> Hi John,
>>
>> Had a question regarding automating the MODE configuration file.
We need to
>> make the output_prefix variable dynamic in the MODE configuration
file, such
>> as
>>
>> output_prefix = "m3o3MODELsitehtvar_${ctnum}_"
>>
>> where the user updates the string "ctnum" each time MODE is run via
an
>> interactive script.
>>
>> Specifically, is this possible?
>> 1) Can the configuration file take in a variable (ie, $ctnum=$1)?
>> 2) Can the output_prefix ?
>>
>> Thanks,
>> Gail
>>
>
>
> Classification: UNCLASSIFIED
> Caveats: NONE
>
>
>
------------------------------------------------
Subject: MODE: question regarding automating the configuration file setup
From: John Halley Gotway
Time: Thu May 23 11:11:23 2013
////////////////////////////////////////////////////////////////////////////////
//
// MODE configuration file.
//
// For additional information, see the MET_BASE/data/config/README
file.
//
////////////////////////////////////////////////////////////////////////////////
//
// Output model name to be written
//
model = "WRF";
////////////////////////////////////////////////////////////////////////////////
//
// Approximate grid resolution (km)
//
grid_res = 40;
////////////////////////////////////////////////////////////////////////////////
//
// Forecast and observation fields to be verified
//
fcst = {
field = {
name = "APCP_12";
level = "(*,*)";
};
raw_thresh = >=0.0;
conv_radius = 5;
conv_thresh = >=2.5;
vld_thresh = 0.5;
area_thresh = >=0.0;
inten_perc_value = 100;
inten_perc_thresh = >=0.0;
merge_thresh = >=1.25;
merge_flag = THRESH;
};
obs = fcst;
//
// Handle missing data
//
mask_missing_flag = BOTH;
//
// Match objects between the forecast and observation fields
//
match_flag = MERGE_BOTH;
//
// Maximum centroid distance for objects to be compared
//
max_centroid_dist = 800.0/grid_res;
////////////////////////////////////////////////////////////////////////////////
//
// Verification masking regions
//
mask = {
grid = "";
grid_flag = NONE; // Apply to NONE, FCST, OBS, or BOTH
poly = "";
poly_flag = NONE; // Apply to NONE, FCST, OBS, or BOTH
};
////////////////////////////////////////////////////////////////////////////////
//
// Fuzzy engine weights
//
weight = {
centroid_dist = 2.0;
boundary_dist = 4.0;
convex_hull_dist = 0.0;
angle_diff = 1.0;
area_ratio = 1.0;
int_area_ratio = 2.0;
complexity_ratio = 0.0;
inten_perc_ratio = 0.0;
inten_perc_value = 50;
}
////////////////////////////////////////////////////////////////////////////////
//
// Fuzzy engine interest functions
//
interest_function = {
centroid_dist = (
( 0.0, 1.0 )
( 60.0/grid_res, 1.0 )
( 600.0/grid_res, 0.0 )
);
boundary_dist = (
( 0.0, 1.0 )
( 400.0/grid_res, 0.0 )
);
convex_hull_dist = (
( 0.0, 1.0 )
( 400.0/grid_res, 0.0 )
);
angle_diff = (
( 0.0, 1.0 )
( 30.0, 1.0 )
( 90.0, 0.0 )
);
corner = 0.8;
ratio_if = (
( 0.0, 0.0 )
( corner, 1.0 )
( 1.0, 1.0 )
);
area_ratio = ratio_if;
int_area_ratio = (
( 0.00, 0.00 )
( 0.10, 0.50 )
( 0.25, 1.00 )
( 1.00, 1.00 )
);
complexity_ratio = ratio_if;
inten_perc_ratio = ratio_if;
}
////////////////////////////////////////////////////////////////////////////////
//
// Total interest threshold for determining matches
//
total_interest_thresh = 0.7;
//
// Interest threshold for printing output pair information
//
print_interest_thresh = 0.0;
////////////////////////////////////////////////////////////////////////////////
//
// Plotting information
//
met_data_dir = "MET_BASE/data";
fcst_raw_plot = {
color_table = "MET_BASE/data/colortables/met_default.ctable";
plot_min = 0.0;
plot_max = 0.0;
colorbar_spacing = 1;
};
obs_raw_plot = {
color_table = "MET_BASE/data/colortables/met_default.ctable";
plot_min = 0.0;
plot_max = 0.0;
colorbar_spacing = 1;
};
object_plot = {
color_table = "MET_BASE/data/colortables/mode_obj.ctable";
};
//
// Number of grid boxes to fill with bad data values along the edge of
the field
// to avoid edge effects.
//
zero_border_size = 1;
//
// Boolean for plotting on the region of valid data within the domain
//
plot_valid_flag = FALSE;
//
// Plot polyline edges using great circle arcs instead of straight
lines
//
plot_gcarc_flag = FALSE;
////////////////////////////////////////////////////////////////////////////////
//
// NetCDF matched pairs, PostScript, and contingency table output
files
//
ps_plot_flag = TRUE;
nc_pairs_flag = TRUE;
ct_stats_flag = TRUE;
////////////////////////////////////////////////////////////////////////////////
output_prefix = "test_env_var_${ctnum}";
version = "V4.0";
////////////////////////////////////////////////////////////////////////////////
------------------------------------------------
Subject: MODE: question regarding automating the configuration file setup
From: gail.t.vaucher.civ at mail.mil
Time: Thu May 23 11:26:17 2013
Classification: UNCLASSIFIED
Caveats: NONE
John G,
That does help. Thank you!
-Gail
P.S. John R and I were able to implement the suggested method for
bracketing
a variable[#61428]. It worked right away (and has identified objects
that
will be useful to our project). We appreciate your guidance!!
-----Original Message-----
From: John Halley Gotway via RT [mailto:met_help at ucar.edu]
Sent: Thursday, May 23, 2013 11:11 AM
To: Vaucher, Gail T CIV (US)
Cc: Raby, John W CIV USARMY ARL (US); Raby, Yasmina R CTR USARMY ARL
(US)
Subject: Re: [rt.rap.ucar.edu #61504] MODE: question regarding
automating the
configuration file setup (UNCLASSIFIED)
Gail,
If you're calling MODE from a script, just set that variable in your
script
prior to executing the call to MODE.
Does that make sense?
Here's an example using the attached config file and some sample data
include
in the METv4.0 release:
> setenv ctnum 290.0
> METv4.0/bin/mode \
METv4.0/out/pcp_combine/sample_fcst_12L_2005080712V_12A.nc \
METv4.0/out/pcp_combine/sample_obs_2005080712V_12A.nc \
MODEConfig_testing_env_var
And here's what's printed to the screen. As you can see, setting
ctnum to
290.0 does have the desired effect in the output_prefix parameter.
DEBUG 1: Default Config File:
/d1/johnhg/MET/MET_releases/METv4.0/data/config/MODEConfig_default
DEBUG 1: Match Config File: MODEConfig_testing_env_var DEBUG 1: Merge
Config
File: MODEConfig_testing_env_var DEBUG 1: Forecast File:
METv4.0/out/pcp_combine/sample_fcst_12L_2005080712V_12A.nc
DEBUG 1: Observation File:
METv4.0/out/pcp_combine/sample_obs_2005080712V_12A.nc
DEBUG 1: Forecast Field: APCP_12 at A12
DEBUG 1: Observation Field: APCP_12 at A12 DEBUG 2: Identifying
objects in the
forecast and observation fields...
DEBUG 2: Computing contingency table statistics...
DEBUG 2: Identified: 6 forecast objects and 5 observation objects.
DEBUG 2: Performing merging (THRESH) in the forecast field.
DEBUG 2: Performing merging (THRESH) in the observation field.
DEBUG 2: Remaining: 6 forecast objects and 5 observation objects.
DEBUG 2: Performing matching (MERGE_BOTH) between the forecast and
observation
fields.
DEBUG 1: Creating Fcst-Obs Object Statistics file:
./mode_test_env_var_290.0_120000L_20050807_120000V_120000A_obj.txt
DEBUG 1: Creating Contingency Table Statistics file:
./mode_test_env_var_290.0_120000L_20050807_120000V_120000A_cts.txt
DEBUG 1: Creating Object NetCDF file:
./mode_test_env_var_290.0_120000L_20050807_120000V_120000A_obj.nc
DEBUG 1: Loading forecast raw color table:
/d1/johnhg/MET/MET_releases/METv4.0/data/colortables/met_default.ctable
DEBUG 1: Loading observation raw color table:
/d1/johnhg/MET/MET_releases/METv4.0/data/colortables/met_default.ctable
DEBUG 1: Creating postscript file:
./mode_test_env_var_290.0_120000L_20050807_120000V_120000A.ps
Hope that helps.
Thanks,
John
On 05/23/2013 09:57 AM, gail.t.vaucher.civ at mail.mil via RT wrote:
>
> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=61504 >
>
> Classification: UNCLASSIFIED
> Caveats: NONE
>
> Hi John,
>
> "Prior to calling MODE".... not sure where that would be (so that
the
> config file uses the variable)?
>
> We've determined that
>
> ctnum = "290.0";
>
> can't be used in the config file.
>
> Gail
>
> -----Original Message-----
> From: John Halley Gotway via RT [mailto:met_help at ucar.edu]
> Sent: Thursday, May 23, 2013 9:51 AM
> To: Vaucher, Gail T CIV (US)
> Cc: Raby, John W CIV USARMY ARL (US); Raby, Yasmina R CTR USARMY ARL
> (US)
> Subject: Re: [rt.rap.ucar.edu #61504] MODE: question regarding
> automating the configuration file setup
>
> Gail,
>
> Yes, the configuration files within MET support the use of
environment
> variables.
>
> output_prefix = "m3o3MODELsitehtvar_${ctnum}_"
>
> So the above setting should work fine as long as the environment
> variable "ctnum" has been defined prior to calling MODE.
>
> Please do give it a try first to make sure it's working exactly how
> you expect.
>
> Thanks,
> John
>
> On 05/22/2013 03:08 PM, gail.t.vaucher.civ at mail.mil via RT wrote:
>>
>> Wed May 22 15:08:57 2013: Request 61504 was acted upon.
>> Transaction: Ticket created by gail.t.vaucher.civ at mail.mil
>> Queue: met_help
>> Subject: MODE: question regarding automating the
configuration
>> file setup
>> Owner: Nobody
>> Requestors: gail.t.vaucher.civ at mail.mil
>> Status: new
>> Ticket <URL:
>> https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=61504 >
>>
>>
>> Hi John,
>>
>> Had a question regarding automating the MODE configuration file.
We
>> need to make the output_prefix variable dynamic in the MODE
>> configuration file, such as
>>
>> output_prefix = "m3o3MODELsitehtvar_${ctnum}_"
>>
>> where the user updates the string "ctnum" each time MODE is run via
>> an interactive script.
>>
>> Specifically, is this possible?
>> 1) Can the configuration file take in a variable (ie, $ctnum=$1)?
>> 2) Can the output_prefix ?
>>
>> Thanks,
>> Gail
>>
>
>
> Classification: UNCLASSIFIED
> Caveats: NONE
>
>
>
Classification: UNCLASSIFIED
Caveats: NONE
------------------------------------------------
More information about the Met_help
mailing list