Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#314 conv1d bad value broken

critical
closed-fixed
core (120)
5
2013-03-24
2012-11-09
Chris Marshall
No

The conv1d routine does not handle bad values
(up through PDL-2.4.11) and is documented as
such....

However, the current quietly propagate the badflag
value behavior is broken because it causes subtle,
difficult to locate bugs in the output since computations
proceed---just with possibly corrupted bad values
present. E.g.,

pdl> p $a
[1 1 1 1 1 1 BAD 1 1 1]

pdl> $kern = ones(3)/3

pdl> p $kern
[0.33333333 0.33333333 0.33333333]

pdl> p conv1d( $a, $kern )
[1 1 1 1 1 -5.9923104e+307 -5.9923104e+307 -5.9923104e+307 1 1]

Where you can see that the conv1d calculation has
used the numeric value of the bad value and the
result is very large numbers being introduced into
the calculation near the location of the original
bad values.

I recommend we change behavior to barf in
the case of badflag'd input data. That would
immediately alerted me to the problem and
seems to be much better at DWIM!

We should probably review non-badvalue
handling routines to check for such pathologies
and address similarly.

At the least, the docs need to be updated
to provide a more appropriate discussion:
be careful not to use conv1d on piddles
having bad values present as that will lead
to corrupted results.

Discussion

  • Chris Marshall
    Chris Marshall
    2013-01-01

    Bug fixed in Git.
    Thanks for reporting the problem!

     
  • Chris Marshall
    Chris Marshall
    2013-01-01

    Added HandleBad=>0 to the pp_def() and an
    explicit warning abut using conv1d on piddles
    with bad values in them without special care.

     
  • Chris Marshall
    Chris Marshall
    2013-01-01

    • assigned_to: nobody --> marshallch
    • status: open --> pending-fixed
     
  • Chris Marshall
    Chris Marshall
    2013-03-24

    • status: pending-fixed --> closed-fixed