[Met_help] [rt.rap.ucar.edu #71043] History for TC_STAT --> Summarize User-Added Columns
John Halley Gotway via RT
met_help at ucar.edu
Thu Mar 26 09:36:51 MDT 2015
----------------------------------------------------------------
Initial Request
----------------------------------------------------------------
Dear Met Help,
I'd like to add some custom columns to my filtered TCST file and summarize
these columns with TC_STAT.
Do you know if this is possible? Do I need to manually go into the code and
add the capability for TC_STAT to read custom columns?
For reference, I'm looking to add columns for the "wind intensity change"
(nicknamed *AWIND_CHG* for adeck, *BWIND_CHG* for bdeck, *WIND_CHG_ERR* for
the difference). An example of how I added these columns can be found in
the attached TCST file. I also attached a log file containing the TC_STAT
output (and error).
Thank you,
Gus
----------------------------------------------------------------
Complete Ticket History
----------------------------------------------------------------
Subject: TC_STAT --> Summarize User-Added Columns
From: John Halley Gotway
Time: Mon Mar 09 16:04:40 2015
Gus,
The code was not designed to handle extra, user-defined columns at the
end
of the TCMPR line. Enabling MET-TC to parse those additional columns
would
require several little changes in the source code. While we do have
funding to support MET-TC to the community we have essentially no
funding
in the coming year to add enhancements.
Here's a few thoughts...
- Rather than tacking those values on to the end of the line, you
could
store them in some less commonly used columns. For example, you might
store them in one of the many columns ending in "_WIND_64". You'd
just
need to remember what you put where! And you could use the existing
filtering options to process that data. I know that's less than
ideal, but
it'd get the job done.
- You could write a wrapper script for the tc_stat tool in some
scripting
language. Rather than calling tc_stat, call tc_stat_wrapper and have
it
check the filtering settings for the columns you added, subset the
lines
based on those settings, and the pass the remaining lines to tc_stat
for
filtering.
- MET-TC is open source and you are of course welcome to make
whatever
changes to the code you'd like. You could take a shot at making those
changes yourself. But I can't guarantee that we would propagate them
to
the official release since that'd require significant work in adding
tests
and documentation for those options.
Sorry I don't have a better answer for you!
John
On Mon, Mar 9, 2015 at 1:22 PM, Ghassan Alaka - NOAA Affiliate via RT
<
met_help at ucar.edu> wrote:
>
> Mon Mar 09 13:22:04 2015: Request 71043 was acted upon.
> Transaction: Ticket created by ghassan.alaka at noaa.gov
> Queue: met_help
> Subject: TC_STAT --> Summarize User-Added Columns
> Owner: Nobody
> Requestors: ghassan.alaka at noaa.gov
> Status: new
> Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=71043 >
>
>
> Dear Met Help,
>
> I'd like to add some custom columns to my filtered TCST file and
summarize
> these columns with TC_STAT.
>
> Do you know if this is possible? Do I need to manually go into the
code and
> add the capability for TC_STAT to read custom columns?
>
> For reference, I'm looking to add columns for the "wind intensity
change"
> (nicknamed *AWIND_CHG* for adeck, *BWIND_CHG* for bdeck,
*WIND_CHG_ERR* for
> the difference). An example of how I added these columns can be
found in
> the attached TCST file. I also attached a log file containing the
TC_STAT
> output (and error).
>
> Thank you,
> Gus
>
>
------------------------------------------------
Subject: TC_STAT --> Summarize User-Added Columns
From: Ghassan Alaka - NOAA Affiliate
Time: Mon Mar 09 16:49:01 2015
John,
Thanks for the reply. This gives me a good head start. It's good to
know
that I can just "hack" my new columns to existing columns that I'll
likely
never use (e.g., *_WIND_64).
I'll look into the actual source code, but I'm not sure that I have
the
time to get up to speed.
-Gus
On Mon, Mar 9, 2015 at 6:04 PM, John Halley Gotway via RT
<met_help at ucar.edu
> wrote:
> Gus,
>
> The code was not designed to handle extra, user-defined columns at
the end
> of the TCMPR line. Enabling MET-TC to parse those additional
columns would
> require several little changes in the source code. While we do have
> funding to support MET-TC to the community we have essentially no
funding
> in the coming year to add enhancements.
>
> Here's a few thoughts...
>
> - Rather than tacking those values on to the end of the line, you
could
> store them in some less commonly used columns. For example, you
might
> store them in one of the many columns ending in "_WIND_64". You'd
just
> need to remember what you put where! And you could use the existing
> filtering options to process that data. I know that's less than
ideal, but
> it'd get the job done.
>
> - You could write a wrapper script for the tc_stat tool in some
scripting
> language. Rather than calling tc_stat, call tc_stat_wrapper and
have it
> check the filtering settings for the columns you added, subset the
lines
> based on those settings, and the pass the remaining lines to tc_stat
for
> filtering.
>
> - MET-TC is open source and you are of course welcome to make
whatever
> changes to the code you'd like. You could take a shot at making
those
> changes yourself. But I can't guarantee that we would propagate
them to
> the official release since that'd require significant work in adding
tests
> and documentation for those options.
>
> Sorry I don't have a better answer for you!
>
> John
>
>
>
> On Mon, Mar 9, 2015 at 1:22 PM, Ghassan Alaka - NOAA Affiliate via
RT <
> met_help at ucar.edu> wrote:
>
> >
> > Mon Mar 09 13:22:04 2015: Request 71043 was acted upon.
> > Transaction: Ticket created by ghassan.alaka at noaa.gov
> > Queue: met_help
> > Subject: TC_STAT --> Summarize User-Added Columns
> > Owner: Nobody
> > Requestors: ghassan.alaka at noaa.gov
> > Status: new
> > Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=71043 >
> >
> >
> > Dear Met Help,
> >
> > I'd like to add some custom columns to my filtered TCST file and
> summarize
> > these columns with TC_STAT.
> >
> > Do you know if this is possible? Do I need to manually go into the
code
> and
> > add the capability for TC_STAT to read custom columns?
> >
> > For reference, I'm looking to add columns for the "wind intensity
change"
> > (nicknamed *AWIND_CHG* for adeck, *BWIND_CHG* for bdeck,
*WIND_CHG_ERR*
> for
> > the difference). An example of how I added these columns can be
found in
> > the attached TCST file. I also attached a log file containing the
TC_STAT
> > output (and error).
> >
> > Thank you,
> > Gus
> >
> >
>
>
------------------------------------------------
Subject: TC_STAT --> Summarize User-Added Columns
From: John Halley Gotway
Time: Tue Mar 10 10:28:10 2015
Gus,
Here's how you could hack it. I've attached an updated version of the
file
named "met-5.0/src/libcode/vx_tc_util/tc_columns.cc". Look for the
string
"BEGIN HACK" in the function named "write_tc_mpr_row()". The updated
version will write out the AMAX_WIND delta, BMAX_WIND delta, and their
difference into columns 54, 55, and 56 of the existing output. Those
are
the columns named:
54 AAL_WIND_64
55 BAL_WIND_64
56 ANE_WIND_64
This code just dumps out the difference between the previous line and
the
current one. So it only really makes sense when you set "match_points
=
true". Otherwise, you'll end up with a whole bunch of missing data
values. Update tc_columns.cc, do a make clean, a make install, and
then
test it out.
Hope that does the trick for you. Be aware that this hack will not
appear
in future versions of MET. So you'd need the hack each time.
Here's the hacked section of code...
// *** BEGIN HACK ***
// Write out the AMAX_WIND change, BMAX_WIND change, and their
// difference into columns 54, 55, and 56.
int a1, a2, b1, b2, ac, bc, dc;
ac = bc = dc = bad_data_int;
if(i > 0) {
a1 = p.adeck()[i].v_max();
a2 = p.adeck()[i-1].v_max();
b1 = p.bdeck()[i].v_max();
b2 = p.bdeck()[i-1].v_max();
ac = (is_bad_data(a1) || is_bad_data(a2) ? bad_data_int : a1
- a2);
bc = (is_bad_data(b1) || is_bad_data(b2) ? bad_data_int : b1
- b2);
dc = (is_bad_data(ac) || is_bad_data(bc) ? bad_data_int : ac
- bc);
}
at.set_entry(i_row, 53, ac);
at.set_entry(i_row, 54, bc);
at.set_entry(i_row, 55, dc);
// *** END HACK ***
Thanks,
John
On Mon, Mar 9, 2015 at 4:49 PM, Ghassan Alaka - NOAA Affiliate via RT
<
met_help at ucar.edu> wrote:
>
> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=71043 >
>
> John,
>
> Thanks for the reply. This gives me a good head start. It's good to
know
> that I can just "hack" my new columns to existing columns that I'll
likely
> never use (e.g., *_WIND_64).
>
> I'll look into the actual source code, but I'm not sure that I have
the
> time to get up to speed.
>
> -Gus
>
> On Mon, Mar 9, 2015 at 6:04 PM, John Halley Gotway via RT <
> met_help at ucar.edu
> > wrote:
>
> > Gus,
> >
> > The code was not designed to handle extra, user-defined columns at
the
> end
> > of the TCMPR line. Enabling MET-TC to parse those additional
columns
> would
> > require several little changes in the source code. While we do
have
> > funding to support MET-TC to the community we have essentially no
funding
> > in the coming year to add enhancements.
> >
> > Here's a few thoughts...
> >
> > - Rather than tacking those values on to the end of the line, you
could
> > store them in some less commonly used columns. For example, you
might
> > store them in one of the many columns ending in "_WIND_64". You'd
just
> > need to remember what you put where! And you could use the
existing
> > filtering options to process that data. I know that's less than
ideal,
> but
> > it'd get the job done.
> >
> > - You could write a wrapper script for the tc_stat tool in some
> scripting
> > language. Rather than calling tc_stat, call tc_stat_wrapper and
have it
> > check the filtering settings for the columns you added, subset the
lines
> > based on those settings, and the pass the remaining lines to
tc_stat for
> > filtering.
> >
> > - MET-TC is open source and you are of course welcome to make
whatever
> > changes to the code you'd like. You could take a shot at making
those
> > changes yourself. But I can't guarantee that we would propagate
them to
> > the official release since that'd require significant work in
adding
> tests
> > and documentation for those options.
> >
> > Sorry I don't have a better answer for you!
> >
> > John
> >
> >
> >
> > On Mon, Mar 9, 2015 at 1:22 PM, Ghassan Alaka - NOAA Affiliate via
RT <
> > met_help at ucar.edu> wrote:
> >
> > >
> > > Mon Mar 09 13:22:04 2015: Request 71043 was acted upon.
> > > Transaction: Ticket created by ghassan.alaka at noaa.gov
> > > Queue: met_help
> > > Subject: TC_STAT --> Summarize User-Added Columns
> > > Owner: Nobody
> > > Requestors: ghassan.alaka at noaa.gov
> > > Status: new
> > > Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=71043
> >
> > >
> > >
> > > Dear Met Help,
> > >
> > > I'd like to add some custom columns to my filtered TCST file and
> > summarize
> > > these columns with TC_STAT.
> > >
> > > Do you know if this is possible? Do I need to manually go into
the code
> > and
> > > add the capability for TC_STAT to read custom columns?
> > >
> > > For reference, I'm looking to add columns for the "wind
intensity
> change"
> > > (nicknamed *AWIND_CHG* for adeck, *BWIND_CHG* for bdeck,
*WIND_CHG_ERR*
> > for
> > > the difference). An example of how I added these columns can be
found
> in
> > > the attached TCST file. I also attached a log file containing
the
> TC_STAT
> > > output (and error).
> > >
> > > Thank you,
> > > Gus
> > >
> > >
> >
> >
>
>
------------------------------------------------
Subject: TC_STAT --> Summarize User-Added Columns
From: Ghassan Alaka - NOAA Affiliate
Time: Tue Mar 10 10:58:09 2015
Thanks, John! I'll have a look and see if I can use it.
Greatly appreciate your guidance.
Best,
Gus
On Tue, Mar 10, 2015 at 12:28 PM, John Halley Gotway via RT <
met_help at ucar.edu> wrote:
> Gus,
>
> Here's how you could hack it. I've attached an updated version of
the file
> named "met-5.0/src/libcode/vx_tc_util/tc_columns.cc". Look for the
string
> "BEGIN HACK" in the function named "write_tc_mpr_row()". The
updated
> version will write out the AMAX_WIND delta, BMAX_WIND delta, and
their
> difference into columns 54, 55, and 56 of the existing output.
Those are
> the columns named:
> 54 AAL_WIND_64
> 55 BAL_WIND_64
> 56 ANE_WIND_64
>
> This code just dumps out the difference between the previous line
and the
> current one. So it only really makes sense when you set
"match_points =
> true". Otherwise, you'll end up with a whole bunch of missing data
> values. Update tc_columns.cc, do a make clean, a make install, and
then
> test it out.
>
> Hope that does the trick for you. Be aware that this hack will not
appear
> in future versions of MET. So you'd need the hack each time.
>
> Here's the hacked section of code...
>
> // *** BEGIN HACK ***
> // Write out the AMAX_WIND change, BMAX_WIND change, and their
> // difference into columns 54, 55, and 56.
> int a1, a2, b1, b2, ac, bc, dc;
> ac = bc = dc = bad_data_int;
> if(i > 0) {
> a1 = p.adeck()[i].v_max();
> a2 = p.adeck()[i-1].v_max();
> b1 = p.bdeck()[i].v_max();
> b2 = p.bdeck()[i-1].v_max();
> ac = (is_bad_data(a1) || is_bad_data(a2) ? bad_data_int :
a1 -
> a2);
> bc = (is_bad_data(b1) || is_bad_data(b2) ? bad_data_int :
b1 -
> b2);
> dc = (is_bad_data(ac) || is_bad_data(bc) ? bad_data_int :
ac -
> bc);
> }
> at.set_entry(i_row, 53, ac);
> at.set_entry(i_row, 54, bc);
> at.set_entry(i_row, 55, dc);
> // *** END HACK ***
>
> Thanks,
> John
>
> On Mon, Mar 9, 2015 at 4:49 PM, Ghassan Alaka - NOAA Affiliate via
RT <
> met_help at ucar.edu> wrote:
>
> >
> > <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=71043 >
> >
> > John,
> >
> > Thanks for the reply. This gives me a good head start. It's good
to know
> > that I can just "hack" my new columns to existing columns that
I'll
> likely
> > never use (e.g., *_WIND_64).
> >
> > I'll look into the actual source code, but I'm not sure that I
have the
> > time to get up to speed.
> >
> > -Gus
> >
> > On Mon, Mar 9, 2015 at 6:04 PM, John Halley Gotway via RT <
> > met_help at ucar.edu
> > > wrote:
> >
> > > Gus,
> > >
> > > The code was not designed to handle extra, user-defined columns
at the
> > end
> > > of the TCMPR line. Enabling MET-TC to parse those additional
columns
> > would
> > > require several little changes in the source code. While we do
have
> > > funding to support MET-TC to the community we have essentially
no
> funding
> > > in the coming year to add enhancements.
> > >
> > > Here's a few thoughts...
> > >
> > > - Rather than tacking those values on to the end of the line,
you
> could
> > > store them in some less commonly used columns. For example, you
might
> > > store them in one of the many columns ending in "_WIND_64".
You'd just
> > > need to remember what you put where! And you could use the
existing
> > > filtering options to process that data. I know that's less than
ideal,
> > but
> > > it'd get the job done.
> > >
> > > - You could write a wrapper script for the tc_stat tool in some
> > scripting
> > > language. Rather than calling tc_stat, call tc_stat_wrapper and
have
> it
> > > check the filtering settings for the columns you added, subset
the
> lines
> > > based on those settings, and the pass the remaining lines to
tc_stat
> for
> > > filtering.
> > >
> > > - MET-TC is open source and you are of course welcome to make
whatever
> > > changes to the code you'd like. You could take a shot at making
those
> > > changes yourself. But I can't guarantee that we would propagate
them
> to
> > > the official release since that'd require significant work in
adding
> > tests
> > > and documentation for those options.
> > >
> > > Sorry I don't have a better answer for you!
> > >
> > > John
> > >
> > >
> > >
> > > On Mon, Mar 9, 2015 at 1:22 PM, Ghassan Alaka - NOAA Affiliate
via RT <
> > > met_help at ucar.edu> wrote:
> > >
> > > >
> > > > Mon Mar 09 13:22:04 2015: Request 71043 was acted upon.
> > > > Transaction: Ticket created by ghassan.alaka at noaa.gov
> > > > Queue: met_help
> > > > Subject: TC_STAT --> Summarize User-Added Columns
> > > > Owner: Nobody
> > > > Requestors: ghassan.alaka at noaa.gov
> > > > Status: new
> > > > Ticket <URL:
> https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=71043
> > >
> > > >
> > > >
> > > > Dear Met Help,
> > > >
> > > > I'd like to add some custom columns to my filtered TCST file
and
> > > summarize
> > > > these columns with TC_STAT.
> > > >
> > > > Do you know if this is possible? Do I need to manually go into
the
> code
> > > and
> > > > add the capability for TC_STAT to read custom columns?
> > > >
> > > > For reference, I'm looking to add columns for the "wind
intensity
> > change"
> > > > (nicknamed *AWIND_CHG* for adeck, *BWIND_CHG* for bdeck,
> *WIND_CHG_ERR*
> > > for
> > > > the difference). An example of how I added these columns can
be found
> > in
> > > > the attached TCST file. I also attached a log file containing
the
> > TC_STAT
> > > > output (and error).
> > > >
> > > > Thank you,
> > > > Gus
> > > >
> > > >
> > >
> > >
> >
> >
>
>
------------------------------------------------
More information about the Met_help
mailing list