5

When performing the following operation in QGIS Raster calculator:

10 ^ (("20091201_20100101_chl_modis_malvinas_ns@1" * 0.0000581)-2)

I get no dada values for every cell where I should get < 1, and correct values for the rest.

I understand this has to be a silly thing that I am overlooking, but I could not make it work, nor find answers out there.

The same operation and dataset used to work OK with the Raster Calc plugin, but it appears it is not supported in QGIS 2.4.

Any other operation with the same layer works ok, rendering real numbers.

4
  • Is the output floating point or integer (0-255)?
    – Aaron
    Sep 24, 2014 at 22:57
  • 1
    The output is floating point. And I just found out that the operation runs smoothly with SAGA raster calculator. So only the one built in in QGIS seems to be problematic.
    – Mario
    Sep 25, 2014 at 6:13
  • 1
    Might be worth a bug report.
    – underdark
    Sep 25, 2014 at 13:48
  • I found a solution for this particular case.
    – xunilk
    Mar 17, 2015 at 0:39

1 Answer 1

1

Yes, it's a bug but it can be overcome. I found that the problem was in raising a number by using a negative exponent lesser than one (for example: 10 ^-0.001). For the case here exposed, 10 ^ (("20091201_20100101_chl_modis_malvinas_ns@1" * 0.0000581)-2), to get a raster valid the formula that it must be used is:

1/(10 ^ -(("20091201_20100101_chl_modis_malvinas_ns@1" * 0.0000581)-2))

To test it I used my own raster (LT50380322011235PAC01_B6@1).

enter image description here

The following image presents the original raster and the valid test_raster2 resultant (it doesn't have NAN values). With the Value Tool Plugin, it can be corroborated that 187 in 10 ^ ((187 * 0.0000581)-2), Mario's formula, is precisely 0,010253324 (obtained manually).

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.