Merging CISLAM Experimental model (no Test Suite available) in JGrassTools

The wrapper of the main module is working correctly. All Oms sub-modules are fine. Wrappers for sub-modules might not be fully functional. 
I got your point.. ..but I can see from the code that the checked
value "toBeAveragedValue"
is coming from JAI method getSampleDouble().
How can this ever return a float?



On 3 November 2014 04:00, Andrea Antonello <notifications@github.com> wrote:

> In
> hortonmachine/src/main/java/org/jgrasstools/hortonmachine/modules/hydrogeomorphology/cislam/utils/MapCalculationFunctions.java:
>
> > +        // Prepare objects for iterating over the maps
> > +        RandomIter toBeAveragedMapIter = RandomIterFactory.create(toBeAveragedMap.getRenderedImage(), null);
> > +        RandomIter dividerMapIter = RandomIterFactory.create(countsMapToUseToAverage.getRenderedImage(), null);
> > +
> > +        WritableRaster averagedMapWR = CoverageUtilities.createDoubleWritableRaster(cols, rows, null, null, JGTConstants.doubleNovalue);
> > +        WritableRandomIter averagedMapIter = RandomIterFactory.createWritable(averagedMapWR, null);
> > +
> > +        double toBeAveragedValue;
> > +        double divider;
> > +        double averagedValue;
> > +
> > +        for( int r = 0; r < rows; r++ ) {
> > +            for( int c = 0; c < cols; c++ ) {
> > +                toBeAveragedValue = toBeAveragedMapIter.getSampleDouble(c, r, 0);
> > +                divider = dividerMapIter.getSampleDouble(c, r, 0);
> > +                if(!Double.isNaN(toBeAveragedValue) && !Double.isNaN(divider) && !Double.isInfinite(divider)){
>
> I think here you should use JGTConstants.isNovalue() instead of
> Double.isNaN. The novalue could be different at some point (ex. float
> maps).
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/moovida/jgrasstools/pull/8/files#r19717885>.
>