Hi dcd,

To complete Jordi's answer :

1) Being able to output multiple bands corresponding to multiple formulas at once, or one formula applied to many bands, is not a limitation of the muparser library, it is a matter of implementation on the OTB side. It would require some additional code that we ought to write someday, considering the many feature requests we have. Until then, the solution proposed by Jordi is just as fine (only requires a little scripting).

2) Regarding your second question, it depends on what you intent to calculate : the mean and std dev of one layer, or the mean and std dev of one pixel accross several layers ? The latter is already possible (you just need to write the mathematical expression), while the former again requires more code on OTB side (but it would be useful to be able to call std(im1b1) for instance in a formula).

Anyway, these are great ideas and OTB BandMath, simple as it is, beats a lot of other raster bands calculators I have tried (we will never thank enough muParser for that). This is a simple yet very discriminative feature of OTB, so we may want to enhance it further.

Thanks for your remarks,

Julien

Le 11/03/2014 04:40, dcd a écrit :
Just out of curiousity, is this a "limitation" to using muparser for Band Math? If so, how difficult would it be to implement a different library, one that supports statistical operators?

I'll look into scripting through Bash, although I'm not sure (initially) how I might derive statistical measures that I'm interested in (e.g., cv, std.dev), without creating a large amount of temp layers to hold intermediary results. Oh well, perhaps I should go back to R for this task.

Thanks for the responses.

On Monday, March 10, 2014 8:53:16 AM UTC, Jordi Inglada wrote:

    dcd
    >
    > Merci,
    >
    > Two follow up questions:
    >
    > 1) Is it possible to specify all bands within a multi-layered
    image? e.g., sum(imb*)? I ask because there are times that I wish
    to run a raster calculation involving a multi-layered image with
    10s or 100s of layers (e.g., an image
    > stack representing a time-series of temperature for every week,
    month, etc.).
    >
    > 2) Is it possible to calculate standard deviation, coefficient
    of variation, etc. using Band Math?
    >

    Hi,

    I think that the answer to both your questions is "no". At least
    not in
    a single command. You can however use either a shell scripts (i.e.
    bash)
    or a the application python bindings to write the necessary loops
    to do
    what you want.

    Jordi

    > Cheers!
    >
    > On Saturday, March 8, 2014 8:30:54 PM UTC, Jonathan Guinet wrote:
    >
    >     Hello,
    >
    >     Band Math handle multiple image and bands using imXbY  where
    X refers to image number and Y refers to band numbers.
    >
    >     for example if you want to calculate mean over bands of a
    three band image you can use : (im1b1+im1b2+im1b3)/3
    >
    >     2014-03-08 15:01 GMT+01:00 dcd <[email protected]>:
    >
    >         Hi OTB'ers,
    >
    >         I understand how to use Band Math to accomplish
    calculations specifying single images/bands, but is there a way to
    do Band Math through a raster stack (e.g., 12 layer raster?).
    Also, is it possible to calculate the std dev,
    >         cv, etc for each pixel through the stack?
    >
    >         Cheers
    >
    >         --
    >         --
    >         Check the OTB FAQ at
    > http://www.orfeo-toolbox.org/FAQ.html
    <http://www.orfeo-toolbox.org/FAQ.html>
    >
    >         You received this message because you are subscribed to
    the Google
    >         Groups "otb-users" group.
    >         To post to this group, send email to
    otb-...-/[email protected] <javascript:>
    >         To unsubscribe from this group, send email to
    > [email protected]
    >         For more options, visit this group at
    > http://groups.google.com/group/otb-users?hl=en
    <http://groups.google.com/group/otb-users?hl=en>
    >         ---
    >         You received this message because you are subscribed to
    the Google Groups "otb-users" group.
    >         To unsubscribe from this group and stop receiving emails
    from it, send an email to [email protected].
    >         For more options, visit
    https://groups.google.com/d/optout
    <https://groups.google.com/d/optout>.
    >
    > --
    > --
    > Check the OTB FAQ at
    > http://www.orfeo-toolbox.org/FAQ.html
    <http://www.orfeo-toolbox.org/FAQ.html>
    >
    > You received this message because you are subscribed to the Google
    > Groups "otb-users" group.
    > To post to this group, send email to
    otb-users-/[email protected] <javascript:>
    > To unsubscribe from this group, send email to
    > otb-users+unsubscribe-/[email protected]
    <javascript:>
    > For more options, visit this group at
    > http://groups.google.com/group/otb-users?hl=en
    <http://groups.google.com/group/otb-users?hl=en>
    > ---
    > You received this message because you are subscribed to the
    Google Groups "otb-users" group.
    > To unsubscribe from this group and stop receiving emails from
    it, send an email to
    otb-users+unsubscribe-/[email protected]
    <javascript:>.
    > For more options, visit https://groups.google.com/d/optout
    <https://groups.google.com/d/optout>.

--
--
Check the OTB FAQ at
http://www.orfeo-toolbox.org/FAQ.html

You received this message because you are subscribed to the Google
Groups "otb-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/otb-users?hl=en
---
You received this message because you are subscribed to the Google Groups "otb-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.


--
Julien MICHEL
CNES - DCT/SI/AP - BPI 1219
18, avenue Edouard Belin
31401 Toulouse Cedex 09 - France
Tel: +33 561 282 894 - Fax: +33 561 283 109

--
--
Check the OTB FAQ at
http://www.orfeo-toolbox.org/FAQ.html

You received this message because you are subscribed to the Google
Groups "otb-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/otb-users?hl=en
--- You received this message because you are subscribed to the Google Groups "otb-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to