[Met_help] [rt.rap.ucar.edu #80976] History for object thresholds for MODE

John Halley Gotway via RT met_help at ucar.edu
Tue Jun 27 13:27:26 MDT 2017


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

Hi,

I was wondering if there is a way to set a minimum length and aspect ratio for objects in the MODE config file.  I am trying to detect atmospheric rivers and so I'm only interested in long narrow objects.

Thank you,
-Laurel DeHaan


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

Subject: object thresholds for MODE
From: John Halley Gotway
Time: Wed Jun 21 16:48:47 2017

Hello Laurel,

I see that you're running MODE and would like to extract atmospheric
river
objects.

Unfortunately, no, there is currently no way to discard objects based
on
minimum length or aspect ratio.  Currently, the only filtering logic
available is to discard objects based on their area (area_thresh) or
intensity (apply inten_perc_thresh threshold to percentile defined by
inten_perc_value).

You can of course filter objects after the fact in the output of MODE,
but
I'm guessing you want to throw these objects out *before* computing
MODE
stats on them.

Adding support for additional object filtering criteria directly in
MODE
would require code changes.  MET is open source and your are welcome
to
modify the code in any way you'd like.

If you're not actually using the area_thresh, you could probably just
edit
the code to apply the area_thresh to the object length instead.

Look at the file "met-6.0/src/libcode/vx_shapedata/shapedata.cc"...
In the function "void ShapeData::threshold_area(SingleThresh t)"...

On line number 1634:
       area_object[j] = sd_object.area();
You could change that line to:
       area_object[j] = sd_object.length();

Then do a "make clean" and "make install".  Hopefully that'd give you
an
easy way of testing to see if filtering by object length is useful.

Please do let us know how it goes.  If you find that discarding
objects
based on different object attributes is useful for atmospheric rivers,
we
may be able to enhance MODE to support this directly in the config
file.

Maybe options something like this:
   attribute_name = [ "area", "length", "aspect_ratio" ];
   attribute_thresh = [ >100, >=50,  >0.75 ];

Thanks,
John Halley Gotway


On Wed, Jun 21, 2017 at 3:07 PM, Dehaan, Laurel via RT
<met_help at ucar.edu>
wrote:

>
> Wed Jun 21 15:07:41 2017: Request 80976 was acted upon.
> Transaction: Ticket created by ldehaan at ucsd.edu
>        Queue: met_help
>      Subject: object thresholds for MODE
>        Owner: Nobody
>   Requestors: ldehaan at ucsd.edu
>       Status: new
>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=80976 >
>
>
> Hi,
>
> I was wondering if there is a way to set a minimum length and aspect
ratio
> for objects in the MODE config file.  I am trying to detect
atmospheric
> rivers and so I'm only interested in long narrow objects.
>
> Thank you,
> -Laurel DeHaan
>
>

------------------------------------------------
Subject: RE: [rt.rap.ucar.edu #80976] object thresholds for MODE
From: Dehaan, Laurel
Time: Wed Jun 21 17:02:06 2017

Thank you John!
That's very helpful.

One more question - since I am running MODE in docker, I believe I
would need to change the code and re-compile every time I launched the
docker container.  Is that true?

I'm fairly new to docker.  If the code modification worked, would it
be straight-forward to create a new docker container with the
modification?

Thanks again
-Laurel

________________________________________
From: John Halley Gotway via RT [met_help at ucar.edu]
Sent: Wednesday, June 21, 2017 4:48 PM
To: Dehaan, Laurel
Subject: Re: [rt.rap.ucar.edu #80976] object thresholds for MODE

Hello Laurel,

I see that you're running MODE and would like to extract atmospheric
river
objects.

Unfortunately, no, there is currently no way to discard objects based
on
minimum length or aspect ratio.  Currently, the only filtering logic
available is to discard objects based on their area (area_thresh) or
intensity (apply inten_perc_thresh threshold to percentile defined by
inten_perc_value).

You can of course filter objects after the fact in the output of MODE,
but
I'm guessing you want to throw these objects out *before* computing
MODE
stats on them.

Adding support for additional object filtering criteria directly in
MODE
would require code changes.  MET is open source and your are welcome
to
modify the code in any way you'd like.

If you're not actually using the area_thresh, you could probably just
edit
the code to apply the area_thresh to the object length instead.

Look at the file "met-6.0/src/libcode/vx_shapedata/shapedata.cc"...
In the function "void ShapeData::threshold_area(SingleThresh t)"...

On line number 1634:
       area_object[j] = sd_object.area();
You could change that line to:
       area_object[j] = sd_object.length();

Then do a "make clean" and "make install".  Hopefully that'd give you
an
easy way of testing to see if filtering by object length is useful.

Please do let us know how it goes.  If you find that discarding
objects
based on different object attributes is useful for atmospheric rivers,
we
may be able to enhance MODE to support this directly in the config
file.

Maybe options something like this:
   attribute_name = [ "area", "length", "aspect_ratio" ];
   attribute_thresh = [ >100, >=50,  >0.75 ];

Thanks,
John Halley Gotway


On Wed, Jun 21, 2017 at 3:07 PM, Dehaan, Laurel via RT
<met_help at ucar.edu>
wrote:

>
> Wed Jun 21 15:07:41 2017: Request 80976 was acted upon.
> Transaction: Ticket created by ldehaan at ucsd.edu
>        Queue: met_help
>      Subject: object thresholds for MODE
>        Owner: Nobody
>   Requestors: ldehaan at ucsd.edu
>       Status: new
>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=80976 >
>
>
> Hi,
>
> I was wondering if there is a way to set a minimum length and aspect
ratio
> for objects in the MODE config file.  I am trying to detect
atmospheric
> rivers and so I'm only interested in long narrow objects.
>
> Thank you,
> -Laurel DeHaan
>
>



------------------------------------------------
Subject: object thresholds for MODE
From: John Halley Gotway
Time: Wed Jun 21 17:22:46 2017

Laurel,

Hmmm, yes, that certainly complicates things!

Are you using a pre-built docker image from the MET website?

http://www.dtcenter.org/met/users/support/online_tutorial/tutorial_data/METv6.0_tutorial_data.tar.gz

Or are you building the image yourself from github?
  https://github.com/NCAR/container-dtc-met

To make code changes, you'd need to do the latter.  The instructions
for
building a docker container are listed in this file:
   https://github.com/NCAR/container-dtc-
met/blob/6.0/met/README.docker.txt

***BUT*** you'd need to modify the Dockerfile:
   https://github.com/NCAR/container-dtc-met/blob/6.0/met/Dockerfile

You don't want it to compile met-6.0.  Instead, you want it to compile
a
modified version.  One option would be doing the code modification
during
the docker build step:

After line 139, you could add 2 new lines:

139 && cd /met/met-${MET_VERSION} \
140 && cat src/libcode/vx_shapedata/shapedata.cc | sed 's/=
sd_object.area();/= sd_object.length();/g' >
src/libcode/vx_shapedata/shapedata.cc_NEW \
141 && mv src/libcode/vx_shapedata/shapedata.cc_NEW
src/libcode/vx_shapedata/shapedata.cc \

Please let me know how it goes.

Thanks,
John


On Wed, Jun 21, 2017 at 5:02 PM, Dehaan, Laurel via RT
<met_help at ucar.edu>
wrote:

>
> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=80976 >
>
> Thank you John!
> That's very helpful.
>
> One more question - since I am running MODE in docker, I believe I
would
> need to change the code and re-compile every time I launched the
docker
> container.  Is that true?
>
> I'm fairly new to docker.  If the code modification worked, would it
be
> straight-forward to create a new docker container with the
modification?
>
> Thanks again
> -Laurel
>
> ________________________________________
> From: John Halley Gotway via RT [met_help at ucar.edu]
> Sent: Wednesday, June 21, 2017 4:48 PM
> To: Dehaan, Laurel
> Subject: Re: [rt.rap.ucar.edu #80976] object thresholds for MODE
>
> Hello Laurel,
>
> I see that you're running MODE and would like to extract atmospheric
river
> objects.
>
> Unfortunately, no, there is currently no way to discard objects
based on
> minimum length or aspect ratio.  Currently, the only filtering logic
> available is to discard objects based on their area (area_thresh) or
> intensity (apply inten_perc_thresh threshold to percentile defined
by
> inten_perc_value).
>
> You can of course filter objects after the fact in the output of
MODE, but
> I'm guessing you want to throw these objects out *before* computing
MODE
> stats on them.
>
> Adding support for additional object filtering criteria directly in
MODE
> would require code changes.  MET is open source and your are welcome
to
> modify the code in any way you'd like.
>
> If you're not actually using the area_thresh, you could probably
just edit
> the code to apply the area_thresh to the object length instead.
>
> Look at the file "met-6.0/src/libcode/vx_shapedata/shapedata.cc"...
> In the function "void ShapeData::threshold_area(SingleThresh t)"...
>
> On line number 1634:
>        area_object[j] = sd_object.area();
> You could change that line to:
>        area_object[j] = sd_object.length();
>
> Then do a "make clean" and "make install".  Hopefully that'd give
you an
> easy way of testing to see if filtering by object length is useful.
>
> Please do let us know how it goes.  If you find that discarding
objects
> based on different object attributes is useful for atmospheric
rivers, we
> may be able to enhance MODE to support this directly in the config
file.
>
> Maybe options something like this:
>    attribute_name = [ "area", "length", "aspect_ratio" ];
>    attribute_thresh = [ >100, >=50,  >0.75 ];
>
> Thanks,
> John Halley Gotway
>
>
> On Wed, Jun 21, 2017 at 3:07 PM, Dehaan, Laurel via RT
<met_help at ucar.edu>
> wrote:
>
> >
> > Wed Jun 21 15:07:41 2017: Request 80976 was acted upon.
> > Transaction: Ticket created by ldehaan at ucsd.edu
> >        Queue: met_help
> >      Subject: object thresholds for MODE
> >        Owner: Nobody
> >   Requestors: ldehaan at ucsd.edu
> >       Status: new
> >  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=80976 >
> >
> >
> > Hi,
> >
> > I was wondering if there is a way to set a minimum length and
aspect
> ratio
> > for objects in the MODE config file.  I am trying to detect
atmospheric
> > rivers and so I'm only interested in long narrow objects.
> >
> > Thank you,
> > -Laurel DeHaan
> >
> >
>
>
>
>

------------------------------------------------
Subject: RE: [rt.rap.ucar.edu #80976] object thresholds for MODE
From: Dehaan, Laurel
Time: Thu Jun 22 16:54:06 2017

Thanks again John.

I've changed the code so the area threshold is actually a threshold
for the aspect ratio - which is working well.
(I haven't yet done anything with docker).

While eliminating objects based on the aspect ratio is a big step in
the right direction, it would be great to also be able to use length
and angle.  You mentioned enhancing MODE to be able to use thresholds
on multiple attributes.  That would be extremely useful for us, but I
don't know how much work that is for you.
Is that something you would have time to do in the next couple weeks?
Or couple months?

-Laurel
________________________________________
From: John Halley Gotway via RT [met_help at ucar.edu]
Sent: Wednesday, June 21, 2017 5:22 PM
To: Dehaan, Laurel
Subject: Re: [rt.rap.ucar.edu #80976] object thresholds for MODE

Laurel,

Hmmm, yes, that certainly complicates things!

Are you using a pre-built docker image from the MET website?

http://www.dtcenter.org/met/users/support/online_tutorial/tutorial_data/METv6.0_tutorial_data.tar.gz

Or are you building the image yourself from github?
  https://github.com/NCAR/container-dtc-met

To make code changes, you'd need to do the latter.  The instructions
for
building a docker container are listed in this file:
   https://github.com/NCAR/container-dtc-
met/blob/6.0/met/README.docker.txt

***BUT*** you'd need to modify the Dockerfile:
   https://github.com/NCAR/container-dtc-met/blob/6.0/met/Dockerfile

You don't want it to compile met-6.0.  Instead, you want it to compile
a
modified version.  One option would be doing the code modification
during
the docker build step:

After line 139, you could add 2 new lines:

139 && cd /met/met-${MET_VERSION} \
140 && cat src/libcode/vx_shapedata/shapedata.cc | sed 's/=
sd_object.area();/= sd_object.length();/g' >
src/libcode/vx_shapedata/shapedata.cc_NEW \
141 && mv src/libcode/vx_shapedata/shapedata.cc_NEW
src/libcode/vx_shapedata/shapedata.cc \

Please let me know how it goes.

Thanks,
John


On Wed, Jun 21, 2017 at 5:02 PM, Dehaan, Laurel via RT
<met_help at ucar.edu>
wrote:

>
> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=80976 >
>
> Thank you John!
> That's very helpful.
>
> One more question - since I am running MODE in docker, I believe I
would
> need to change the code and re-compile every time I launched the
docker
> container.  Is that true?
>
> I'm fairly new to docker.  If the code modification worked, would it
be
> straight-forward to create a new docker container with the
modification?
>
> Thanks again
> -Laurel
>
> ________________________________________
> From: John Halley Gotway via RT [met_help at ucar.edu]
> Sent: Wednesday, June 21, 2017 4:48 PM
> To: Dehaan, Laurel
> Subject: Re: [rt.rap.ucar.edu #80976] object thresholds for MODE
>
> Hello Laurel,
>
> I see that you're running MODE and would like to extract atmospheric
river
> objects.
>
> Unfortunately, no, there is currently no way to discard objects
based on
> minimum length or aspect ratio.  Currently, the only filtering logic
> available is to discard objects based on their area (area_thresh) or
> intensity (apply inten_perc_thresh threshold to percentile defined
by
> inten_perc_value).
>
> You can of course filter objects after the fact in the output of
MODE, but
> I'm guessing you want to throw these objects out *before* computing
MODE
> stats on them.
>
> Adding support for additional object filtering criteria directly in
MODE
> would require code changes.  MET is open source and your are welcome
to
> modify the code in any way you'd like.
>
> If you're not actually using the area_thresh, you could probably
just edit
> the code to apply the area_thresh to the object length instead.
>
> Look at the file "met-6.0/src/libcode/vx_shapedata/shapedata.cc"...
> In the function "void ShapeData::threshold_area(SingleThresh t)"...
>
> On line number 1634:
>        area_object[j] = sd_object.area();
> You could change that line to:
>        area_object[j] = sd_object.length();
>
> Then do a "make clean" and "make install".  Hopefully that'd give
you an
> easy way of testing to see if filtering by object length is useful.
>
> Please do let us know how it goes.  If you find that discarding
objects
> based on different object attributes is useful for atmospheric
rivers, we
> may be able to enhance MODE to support this directly in the config
file.
>
> Maybe options something like this:
>    attribute_name = [ "area", "length", "aspect_ratio" ];
>    attribute_thresh = [ >100, >=50,  >0.75 ];
>
> Thanks,
> John Halley Gotway
>
>
> On Wed, Jun 21, 2017 at 3:07 PM, Dehaan, Laurel via RT
<met_help at ucar.edu>
> wrote:
>
> >
> > Wed Jun 21 15:07:41 2017: Request 80976 was acted upon.
> > Transaction: Ticket created by ldehaan at ucsd.edu
> >        Queue: met_help
> >      Subject: object thresholds for MODE
> >        Owner: Nobody
> >   Requestors: ldehaan at ucsd.edu
> >       Status: new
> >  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=80976 >
> >
> >
> > Hi,
> >
> > I was wondering if there is a way to set a minimum length and
aspect
> ratio
> > for objects in the MODE config file.  I am trying to detect
atmospheric
> > rivers and so I'm only interested in long narrow objects.
> >
> > Thank you,
> > -Laurel DeHaan
> >
> >
>
>
>
>



------------------------------------------------
Subject: object thresholds for MODE
From: John Halley Gotway
Time: Fri Jun 23 10:31:18 2017

Laurel,

I sent an email to other developers in our group asking for feedback
on the
idea of supporting more general filtering functionality.  I'll let you
know
what I hear back.

We are currently working on release 6.1 for later this summer.  But
that
development is largely driven by the verification needs at NCEP.  I'm
doubtful that we'd be able to squeeze this in.

But I'll let you know.

You do still have the option of defining multiple objects, and then
filtering them after running MODE.  That may be a less clean approach
but
is possible without any code changes.

Thanks,
John


On Thu, Jun 22, 2017 at 4:54 PM, Dehaan, Laurel via RT
<met_help at ucar.edu>
wrote:

>
> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=80976 >
>
> Thanks again John.
>
> I've changed the code so the area threshold is actually a threshold
for
> the aspect ratio - which is working well.
> (I haven't yet done anything with docker).
>
> While eliminating objects based on the aspect ratio is a big step in
the
> right direction, it would be great to also be able to use length and
> angle.  You mentioned enhancing MODE to be able to use thresholds on
> multiple attributes.  That would be extremely useful for us, but I
don't
> know how much work that is for you.
> Is that something you would have time to do in the next couple
weeks?  Or
> couple months?
>
> -Laurel
> ________________________________________
> From: John Halley Gotway via RT [met_help at ucar.edu]
> Sent: Wednesday, June 21, 2017 5:22 PM
> To: Dehaan, Laurel
> Subject: Re: [rt.rap.ucar.edu #80976] object thresholds for MODE
>
> Laurel,
>
> Hmmm, yes, that certainly complicates things!
>
> Are you using a pre-built docker image from the MET website?
>
> http://www.dtcenter.org/met/users/support/online_tutorial/
> tutorial_data/METv6.0_tutorial_data.tar.gz
>
> Or are you building the image yourself from github?
>   https://github.com/NCAR/container-dtc-met
>
> To make code changes, you'd need to do the latter.  The instructions
for
> building a docker container are listed in this file:
>    https://github.com/NCAR/container-dtc-met/blob/6.0/
> met/README.docker.txt
>
> ***BUT*** you'd need to modify the Dockerfile:
>    https://github.com/NCAR/container-dtc-met/blob/6.0/met/Dockerfile
>
> You don't want it to compile met-6.0.  Instead, you want it to
compile a
> modified version.  One option would be doing the code modification
during
> the docker build step:
>
> After line 139, you could add 2 new lines:
>
> 139 && cd /met/met-${MET_VERSION} \
> 140 && cat src/libcode/vx_shapedata/shapedata.cc | sed 's/=
> sd_object.area();/= sd_object.length();/g' >
> src/libcode/vx_shapedata/shapedata.cc_NEW \
> 141 && mv src/libcode/vx_shapedata/shapedata.cc_NEW
> src/libcode/vx_shapedata/shapedata.cc \
>
> Please let me know how it goes.
>
> Thanks,
> John
>
>
> On Wed, Jun 21, 2017 at 5:02 PM, Dehaan, Laurel via RT
<met_help at ucar.edu>
> wrote:
>
> >
> > <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=80976 >
> >
> > Thank you John!
> > That's very helpful.
> >
> > One more question - since I am running MODE in docker, I believe I
would
> > need to change the code and re-compile every time I launched the
docker
> > container.  Is that true?
> >
> > I'm fairly new to docker.  If the code modification worked, would
it be
> > straight-forward to create a new docker container with the
modification?
> >
> > Thanks again
> > -Laurel
> >
> > ________________________________________
> > From: John Halley Gotway via RT [met_help at ucar.edu]
> > Sent: Wednesday, June 21, 2017 4:48 PM
> > To: Dehaan, Laurel
> > Subject: Re: [rt.rap.ucar.edu #80976] object thresholds for MODE
> >
> > Hello Laurel,
> >
> > I see that you're running MODE and would like to extract
atmospheric
> river
> > objects.
> >
> > Unfortunately, no, there is currently no way to discard objects
based on
> > minimum length or aspect ratio.  Currently, the only filtering
logic
> > available is to discard objects based on their area (area_thresh)
or
> > intensity (apply inten_perc_thresh threshold to percentile defined
by
> > inten_perc_value).
> >
> > You can of course filter objects after the fact in the output of
MODE,
> but
> > I'm guessing you want to throw these objects out *before*
computing MODE
> > stats on them.
> >
> > Adding support for additional object filtering criteria directly
in MODE
> > would require code changes.  MET is open source and your are
welcome to
> > modify the code in any way you'd like.
> >
> > If you're not actually using the area_thresh, you could probably
just
> edit
> > the code to apply the area_thresh to the object length instead.
> >
> > Look at the file "met-
6.0/src/libcode/vx_shapedata/shapedata.cc"...
> > In the function "void ShapeData::threshold_area(SingleThresh
t)"...
> >
> > On line number 1634:
> >        area_object[j] = sd_object.area();
> > You could change that line to:
> >        area_object[j] = sd_object.length();
> >
> > Then do a "make clean" and "make install".  Hopefully that'd give
you an
> > easy way of testing to see if filtering by object length is
useful.
> >
> > Please do let us know how it goes.  If you find that discarding
objects
> > based on different object attributes is useful for atmospheric
rivers, we
> > may be able to enhance MODE to support this directly in the config
file.
> >
> > Maybe options something like this:
> >    attribute_name = [ "area", "length", "aspect_ratio" ];
> >    attribute_thresh = [ >100, >=50,  >0.75 ];
> >
> > Thanks,
> > John Halley Gotway
> >
> >
> > On Wed, Jun 21, 2017 at 3:07 PM, Dehaan, Laurel via RT <
> met_help at ucar.edu>
> > wrote:
> >
> > >
> > > Wed Jun 21 15:07:41 2017: Request 80976 was acted upon.
> > > Transaction: Ticket created by ldehaan at ucsd.edu
> > >        Queue: met_help
> > >      Subject: object thresholds for MODE
> > >        Owner: Nobody
> > >   Requestors: ldehaan at ucsd.edu
> > >       Status: new
> > >  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=80976
> >
> > >
> > >
> > > Hi,
> > >
> > > I was wondering if there is a way to set a minimum length and
aspect
> > ratio
> > > for objects in the MODE config file.  I am trying to detect
atmospheric
> > > rivers and so I'm only interested in long narrow objects.
> > >
> > > Thank you,
> > > -Laurel DeHaan
> > >
> > >
> >
> >
> >
> >
>
>
>
>

------------------------------------------------
Subject: RE: [rt.rap.ucar.edu #80976] object thresholds for MODE
From: Dehaan, Laurel
Time: Fri Jun 23 10:58:20 2017

Thanks John.
I'll move forward with the aspect ratio threshold and filtering
everything else after the fact.
But do let me know when you think more filtering will be available.
We'll use it whenever that is.

-Laurel

________________________________________
From: John Halley Gotway via RT [met_help at ucar.edu]
Sent: Friday, June 23, 2017 10:31 AM
To: Dehaan, Laurel
Subject: Re: [rt.rap.ucar.edu #80976] object thresholds for MODE

Laurel,

I sent an email to other developers in our group asking for feedback
on the
idea of supporting more general filtering functionality.  I'll let you
know
what I hear back.

We are currently working on release 6.1 for later this summer.  But
that
development is largely driven by the verification needs at NCEP.  I'm
doubtful that we'd be able to squeeze this in.

But I'll let you know.

You do still have the option of defining multiple objects, and then
filtering them after running MODE.  That may be a less clean approach
but
is possible without any code changes.

Thanks,
John


On Thu, Jun 22, 2017 at 4:54 PM, Dehaan, Laurel via RT
<met_help at ucar.edu>
wrote:

>
> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=80976 >
>
> Thanks again John.
>
> I've changed the code so the area threshold is actually a threshold
for
> the aspect ratio - which is working well.
> (I haven't yet done anything with docker).
>
> While eliminating objects based on the aspect ratio is a big step in
the
> right direction, it would be great to also be able to use length and
> angle.  You mentioned enhancing MODE to be able to use thresholds on
> multiple attributes.  That would be extremely useful for us, but I
don't
> know how much work that is for you.
> Is that something you would have time to do in the next couple
weeks?  Or
> couple months?
>
> -Laurel
> ________________________________________
> From: John Halley Gotway via RT [met_help at ucar.edu]
> Sent: Wednesday, June 21, 2017 5:22 PM
> To: Dehaan, Laurel
> Subject: Re: [rt.rap.ucar.edu #80976] object thresholds for MODE
>
> Laurel,
>
> Hmmm, yes, that certainly complicates things!
>
> Are you using a pre-built docker image from the MET website?
>
> http://www.dtcenter.org/met/users/support/online_tutorial/
> tutorial_data/METv6.0_tutorial_data.tar.gz
>
> Or are you building the image yourself from github?
>   https://github.com/NCAR/container-dtc-met
>
> To make code changes, you'd need to do the latter.  The instructions
for
> building a docker container are listed in this file:
>    https://github.com/NCAR/container-dtc-met/blob/6.0/
> met/README.docker.txt
>
> ***BUT*** you'd need to modify the Dockerfile:
>    https://github.com/NCAR/container-dtc-met/blob/6.0/met/Dockerfile
>
> You don't want it to compile met-6.0.  Instead, you want it to
compile a
> modified version.  One option would be doing the code modification
during
> the docker build step:
>
> After line 139, you could add 2 new lines:
>
> 139 && cd /met/met-${MET_VERSION} \
> 140 && cat src/libcode/vx_shapedata/shapedata.cc | sed 's/=
> sd_object.area();/= sd_object.length();/g' >
> src/libcode/vx_shapedata/shapedata.cc_NEW \
> 141 && mv src/libcode/vx_shapedata/shapedata.cc_NEW
> src/libcode/vx_shapedata/shapedata.cc \
>
> Please let me know how it goes.
>
> Thanks,
> John
>
>
> On Wed, Jun 21, 2017 at 5:02 PM, Dehaan, Laurel via RT
<met_help at ucar.edu>
> wrote:
>
> >
> > <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=80976 >
> >
> > Thank you John!
> > That's very helpful.
> >
> > One more question - since I am running MODE in docker, I believe I
would
> > need to change the code and re-compile every time I launched the
docker
> > container.  Is that true?
> >
> > I'm fairly new to docker.  If the code modification worked, would
it be
> > straight-forward to create a new docker container with the
modification?
> >
> > Thanks again
> > -Laurel
> >
> > ________________________________________
> > From: John Halley Gotway via RT [met_help at ucar.edu]
> > Sent: Wednesday, June 21, 2017 4:48 PM
> > To: Dehaan, Laurel
> > Subject: Re: [rt.rap.ucar.edu #80976] object thresholds for MODE
> >
> > Hello Laurel,
> >
> > I see that you're running MODE and would like to extract
atmospheric
> river
> > objects.
> >
> > Unfortunately, no, there is currently no way to discard objects
based on
> > minimum length or aspect ratio.  Currently, the only filtering
logic
> > available is to discard objects based on their area (area_thresh)
or
> > intensity (apply inten_perc_thresh threshold to percentile defined
by
> > inten_perc_value).
> >
> > You can of course filter objects after the fact in the output of
MODE,
> but
> > I'm guessing you want to throw these objects out *before*
computing MODE
> > stats on them.
> >
> > Adding support for additional object filtering criteria directly
in MODE
> > would require code changes.  MET is open source and your are
welcome to
> > modify the code in any way you'd like.
> >
> > If you're not actually using the area_thresh, you could probably
just
> edit
> > the code to apply the area_thresh to the object length instead.
> >
> > Look at the file "met-
6.0/src/libcode/vx_shapedata/shapedata.cc"...
> > In the function "void ShapeData::threshold_area(SingleThresh
t)"...
> >
> > On line number 1634:
> >        area_object[j] = sd_object.area();
> > You could change that line to:
> >        area_object[j] = sd_object.length();
> >
> > Then do a "make clean" and "make install".  Hopefully that'd give
you an
> > easy way of testing to see if filtering by object length is
useful.
> >
> > Please do let us know how it goes.  If you find that discarding
objects
> > based on different object attributes is useful for atmospheric
rivers, we
> > may be able to enhance MODE to support this directly in the config
file.
> >
> > Maybe options something like this:
> >    attribute_name = [ "area", "length", "aspect_ratio" ];
> >    attribute_thresh = [ >100, >=50,  >0.75 ];
> >
> > Thanks,
> > John Halley Gotway
> >
> >
> > On Wed, Jun 21, 2017 at 3:07 PM, Dehaan, Laurel via RT <
> met_help at ucar.edu>
> > wrote:
> >
> > >
> > > Wed Jun 21 15:07:41 2017: Request 80976 was acted upon.
> > > Transaction: Ticket created by ldehaan at ucsd.edu
> > >        Queue: met_help
> > >      Subject: object thresholds for MODE
> > >        Owner: Nobody
> > >   Requestors: ldehaan at ucsd.edu
> > >       Status: new
> > >  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=80976
> >
> > >
> > >
> > > Hi,
> > >
> > > I was wondering if there is a way to set a minimum length and
aspect
> > ratio
> > > for objects in the MODE config file.  I am trying to detect
atmospheric
> > > rivers and so I'm only interested in long narrow objects.
> > >
> > > Thank you,
> > > -Laurel DeHaan
> > >
> > >
> >
> >
> >
> >
>
>
>
>



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


More information about the Met_help mailing list