Giter Club home page Giter Club logo

Comments (7)

DaveEslinger avatar DaveEslinger commented on June 17, 2024

Is there a reason not to implement the same numpy approach used for concentrations? That seems a good approach.

from qnspect.

ar-siddiqui avatar ar-siddiqui commented on June 17, 2024

Is there a reason not to implement the same numpy approach used for concentrations? That seems a good approach.

If we used the same approach of assigning 0 to division by zero cells we will encounter following issue:

Lets say we have raster A = [[0,2]] and B = [[1,2]]

When we calculate percent difference here expression="100 * ((A - B) / A)"

We would endup getting resulting raster as [[0, 0]] which is not correct.

from qnspect.

DaveEslinger avatar DaveEslinger commented on June 17, 2024

Correct, that should give [[NODATA, 0]], I think. That might also be what we want for concentration. "0" implies there is runoff, but no pollutant, when in reality, there is no runoff at all. Therefore, when accumulated runoff = 0, we probably want to return NODATA.

from qnspect.

ar-siddiqui avatar ar-siddiqui commented on June 17, 2024

Correct, that should give [[NODATA, 0]], I think.

This will make the resulting raster have holes in it, I think a better approach would be [[inf, 0]] I can see if there are ways to specify that. I have seen this before in QGIS.

That might also be what we want for concentration. "0" implies there is runoff, but no pollutant, when in reality, there is no runoff at all. Therefore, when accumulated runoff = 0, we probably want to return NODATA.

Actually, this is what was happening before, but this was leading to big holes in the middle of rasters, not looking good. One can argue when there is no runoff, then there is no pollutant as well hence 0 is the correct value for those cells. Infact if there is no runoff there will always be 0 pollutant as well by design of the code.

from qnspect.

DaveEslinger avatar DaveEslinger commented on June 17, 2024

If we go with the [[inf, 0]] option, do you know what that does to the color ramps? Do they try to include that high value? That was the advantage of the nodata approach we used in OpenNSPECT. Yes, there were gaps in data sets, but those gaps were meaningful and folks could interpret them.

from qnspect.

ar-siddiqui avatar ar-siddiqui commented on June 17, 2024

If we go with the [[inf, 0]] option, do you know what that does to the color ramps? Do they try to include that high value? That was the advantage of the nodata approach we used in OpenNSPECT. Yes, there were gaps in data sets, but those gaps were meaningful and folks could interpret them.

I will look into it and get back to you.

from qnspect.

ar-siddiqui avatar ar-siddiqui commented on June 17, 2024

The QGIS legend would include inf, so that option definitely goes out. Currently, it raises runtime warnings for division by zero. This actually is good if we want to return no data for division by zero, at least this way, users get to know they have 0 values in Raster B.

Without the warning, it is possible to assume that there is no difference between A and B, when in fact there is a difference and B has 0 values for cells with a difference. With warning, users get some sort of notice. Closing as there is nothing else that can be opened. Reopen if necessary.

from qnspect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.