X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 08 Nov 2013 10:34 AM by  anon
spectral math, ts_smooth
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
08 Nov 2013 10:34 AM
    Hi all. I am having problems for using IDL functions in spectral math in ENVI. there are many tutorials about the syntax of expressions, but I can't figure out how to call an IDL function such as TS_SMOOTH. I would like to smooth noisy spectra, and from what I could read the IDL syntax for it is Result = TS_SMOOTH( X, Nvalues [, /BACKWARD] [, /DOUBLE] [, /FORWARD] [, ORDER=value] ) In the spectral math window, I tried a huge number of syntaxes, all of them being refused. For instance I tried: TS_SMOOTH(s1) **assuming that Nvalues could be an option defined in the next window of variable selection TS_SMOOTH(s1,15) ** if the ORDER parameter is to be defined at this stage TS_SMOOTH ** in case ENVI just needs the name of the function, with the variables defined at the next step. None of these options work. In the spectral math window I get the message: "You have entered an invalid expression. Check for syntax errors or undefined procedures and functions and try again." In IDL I get: "TS_SMOOTH: Time-series input must be a vector of at least 11 elements.", which I do not understand since the input variable, s1, is defined in the next window from an open plot window or a file. Its length cannot be defined before that new window which I cannot access because of the error message. I have never used the spectral math capability of ENVI before, and I am sure the solution is not far! Thanks in anyone can help!

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    11 Nov 2013 05:49 AM
    The way ENVI tests whether or not an expression is valid may not work with every IDL routine depending on the routine works. I think the issue is that the spectrum that is passed to the Spectral Math tool is a 2-D array that consists of the x and y points. TS_SMOOTH takes x (the values) only. You can display the spectrum you want to transform and export it to an IDL variable (choosing the Y values only) and then perform TS_SMOOTH on the data.
    You are not authorized to post a reply.