Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
Re: Simple question about the '>' sign.
munka writes: > I came across this line: > > Y=( B - A*6)>0. > > is this equal to: > > Y=B - A*6 > index=where( Y lt 0., ct) > if ct ne 0 then Y[index]=0. No, this is the "greater than" operator. It compares the two values on either side of the operator and returns the largest of the two. > Also, is the decimal point after the 0 significant? No. > It would help if > I could find somewhere that listed all of the symbols. I think I > found it once,when I had to figure out what the "~" did.... i just > remember looking for a long time to try to figure out what that symbol > meant. It is not blatantly obvious, and everything I google doesn't > come up with the right answers :( If you use the Index tab of the IDL on-line help and type a greater than symbol into the Search box, this operator is the first to appear. Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting, Inc. Coyote's Guide to IDL Programming: http://www.dfanning.com/ Sepore ma de ni thui. ("Perhaps thou speakest truth.")
On Jan 30, 3:38 pm, David Fanning <n...@dfanning.com> wrote: > munka writes: >> I came across this line: > >> Y=( B - A*6)>0. > >> is this equal to: > > No, this is the "greater than" operator. It compares > the two values on either side of the operator and returns > the largest of the two. Just to be clear, that is what the 3 lines of code are doing, so the answer is yes, Y = (B-A*6) > 0 is equivalent to Y=B - A*6 index=where( Y lt 0., ct) if ct ne 0 then Y[index]=0. Wayne
wlandsman writes: > Just to be clear, that is what the 3 lines of code are doing, so the > answer is yes, > > Y = (B-A*6) > 0 > > is equivalent to > > Y=B - A*6 > index=where( Y lt 0., ct) > if ct ne 0 then Y[index]=0. Sorry. Didn't really read the code. Tennis, you know. ;-) Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting, Inc. Coyote's Guide to IDL Programming: http://www.dfanning.com/ Sepore ma de ni thui. ("Perhaps thou speakest truth.")
> munka writes: > >> I came across this line: >> >> Y=( B - A*6)>0. >> >> is this equal to: >> >> Y=B - A*6 >> index=where( Y lt 0., ct) >> if ct ne 0 then Y[index]=0. > > No, this is the "greater than" operator. It compares > the two values on either side of the operator and returns > the largest of the two. > >> Also, is the decimal point after the 0 significant? actually, it could force Y to be a float array, rather than an int array. (if a and b are ints) IDL> help,( b - a*6) > 0 <Expression> INT = Array[10] IDL> help,( b - a*6) > 0. <Expression> FLOAT = Array[10]
R.G. Stockwell writes: > actually, it could force Y to be a float array, rather than an int array. > (if a and b are ints) > > IDL> help,( b - a*6) > 0 > <Expression> INT = Array[10] > IDL> help,( b - a*6) > 0. > <Expression> FLOAT = Array[10] Next time, I'm going to read the damn question before I answer it. :-( Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting, Inc. Coyote's Guide to IDL Programming: http://www.dfanning.com/ Sepore ma de ni thue. ("Perhaps thos speakest truth.")
In article <MPG.25d10b8422472a4a9896a4@news.giganews.com>, David Fanning <news@dfanning.com> wrote: > R.G. Stockwell writes: > >> actually, it could force Y to be a float array, rather than an int array. >> (if a and b are ints) >> >> IDL> help,( b - a*6) > 0 >> <Expression> INT = Array[10] >> IDL> help,( b - a*6) > 0. >> <Expression> FLOAT = Array[10] > > Next time, I'm going to read the damn question before > I answer it. :-( > > Cheers, > > David RTFQ, then tell them to RTFM. :-) Cheers, Ken
On Feb 2, 9:23 am, "Kenneth P. Bowman" <k-bow...@null.edu> wrote: > In article <MPG.25d10b8422472a4a989...@news.giganews.com>, > David Fanning <n...@dfanning.com> wrote: > > > > > >> R.G. Stockwell writes: > >>> actually, it could force Y to be a float array, rather than an int array. >>> (if a and b are ints) > >>> IDL> help,( b - a*6) > 0 >>> <Expression> INT = Array[10] >>> IDL> help,( b - a*6) > 0. >>> <Expression> FLOAT = Array[10] > >> Next time, I'm going to read the damn question before >> I answer it. :-( > >> Cheers, > >> David > > RTFQ, then tell them to RTFM. :-) > > Cheers, Ken Well. I have to admit, I don't actually have IDL installed on my home computer, where I sent the question from. I only have it installed on the computer that I work on, which is in the office. I looked up the symbols, and I realized that I know very little about the crazy symbols IDL has. They're not too complex, I just haven't had any experience with them. (except for ?... that one still confuses me) Thanks for the responses! ~Bill
On Tue, 2 Feb 2010 20:52:27 -0800 (PST), munka <mynameismunka@gmail.com> wrote: > I looked up the > symbols, and I realized that I know very little about the crazy > symbols IDL has. They're not too complex, I just haven't had any > experience with them. (except for ?... that one still confuses me) Have a look at this: http://michaelgalloy.com/2006/11/01/periodic-table-of-idl-op erators.html