output file name does not reflect to the valid time format in stat_analysis #2636
-
I use stat analysis (METplus v5.1.0) to read data through a Python embedded script.
I want my output file to be named with a 10-digit valid time, however, it always names |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 11 replies
-
@weiwilliam I see you're having issues getting the Stat-Analysis METplus wrapper to configure the output file name how you'd like. I did adapt/run this StatAnalysis Wrapper Example to test. I updated the
And it did indeed write to the expected output file name:
Inspecting the code in stat_analysis_wrapper.py, I note the You're setting obviously doesn't include a I'd recommend re-running METplus, and look in the log output for the path to
Can you confirm it's present in your final config file as well? Or does the final have something like |
Beta Was this translation helpful? Give feedback.
-
Thank you, @JohnHalleyGotway Here are two sets of final conf and log files. 12Z cycle: |
Beta Was this translation helpful? Give feedback.
-
Hi @weiwilliam: I've done a lot of work with Stat-Analysis so am adding some information here that may help get these settings working as desired. For the time labeling issue at 00Z, Stat-Analysis has inconsistent behavior when using the init and valid time templates. This is because it is designed to aggregate statistics over time, so often there isn't a single init or valid time for a Stat-Analysis run. To mitigate this, several additional tags can be used in the time templates when running Stat-Analysis. These additional time template tags are listed in the documentation. I would suggest changing the time template in STAT_ANALYSIS_OUTPUT_TEMPLATE to use one of these special tags and see if that fixes the timing issue. So, you could change STAT_ANALYSIS_OUTPUT_TEMPLATE = {valid?fmt=%Y%m%d%H}.out to STAT_ANALYSIS_OUTPUT_TEMPLATE = {valid_end?fmt=%Y%m%d%H}.out. This template will tell Stat-Analysis to label the file using the the valid time at the end of the aggregation period for each Stat-Analysis run. There are many other tags we can use if this doesn't produce the desired labeling. Does this fix the issue or does it still label with ALL? For timing controls, Stat-Analysis has two options, the STAT_ANALYSIS_RUNTIME_FREQ and the LOOP_LIST_ITEMS and GROUP_LIST_ITEMS variables. From the metplus_final configuration files, it looks like you have FCST_LEAD_LIST in the LOOP_LIST_ITEMS. Are you wanting to run stat analysis once for each lead time and for the 0, 12, and 18 UTC valid times (skipping 6Z)? If so, you could set the following: FCST_VALID_HOUR_LIST = 1, 12, 18 This should run stat analysis once fore each lead time in LEAD_SEQ and for the 1, 12, and 18 valid times. For this setup, you can omit the STAT_ANALYSIS_RUNTIME_FREQ variable. Is this how you want Stat-Analysis to run or should it be doing something different? Christina |
Beta Was this translation helpful? Give feedback.
-
@CPKalb @JohnHalleyGotway
I also pass the empty list of mpr_data which can generate output file without any stat line inside. It works great now. |
Beta Was this translation helpful? Give feedback.
Hi @weiwilliam:
I've done a lot of work with Stat-Analysis so am adding some information here that may help get these settings working as desired.
For the time labeling issue at 00Z, Stat-Analysis has inconsistent behavior when using the init and valid time templates. This is because it is designed to aggregate statistics over time, so often there isn't a single init or valid time for a Stat-Analysis run. To mitigate this, several additional tags can be used in the time templates when running Stat-Analysis. These additional time template tags are listed in the documentation.
I would suggest changing the time template in STAT_ANALYSIS_OUTPUT_TEMPLATE to use one of these special tags and se…