comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: How to do a "match merge"?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: How to do a "match merge"? [message #27578] Thu, 25 October 2001 22:10
Dick Jackson is currently offline  Dick Jackson
Messages: 347
Registered: August 1998
Senior Member
> "Joe Means" <joe.means@orst.edu> wrote in message
news:3BD89112.2070104@orst.edu...
> Thanks to JD, Pavel and Dick who responded. The simple approach below
should > work just fine.

> IDL> segments.length=seg_len_vec[segments.segment-1]

Ah, it looks like I missed the point a bit. The problem I jumped on was an
interesting one, but not one that needed solving. :-( Well, if you did need
a way of adding up lengths of all the pieces in each segment *without a
loop*, there you go!

Cheers,
--
-Dick

Dick Jackson / dick@d-jackson.com
D-Jackson Software Consulting / http://www.d-jackson.com
Calgary, Alberta, Canada / +1-403-242-7398 / Fax: 241-7392
Re: How to do a "match merge"? [message #27583 is a reply to message #27578] Thu, 25 October 2001 15:24 Go to previous message
Joe Means is currently offline  Joe Means
Messages: 44
Registered: November 1996
Member
<html><head></head><body>Thanks to JD, Pavel and Dick who responded.&nbsp; The simple approach below should work just fine.<br>
Joe Means<br>
<br>
JD Smith wrote:<br>
<blockquote type="cite" cite="mid:3BD86DD2.EA6A4E6@astro.cornell.edu"><pre wrap="">Joe Means wrote:<br></pre>
<blockquote type="cite"><pre wrap="">;I have a structure:<br>segment = {seg:0, piece:0, rotation:0.0, length:0.0}<br>segments = Replicate(segment, 2000)<br><br>;then I read data to fill array segments. For each segment there can<br>be 1 or more values of piece,<br>;so the data in segments can look like:<br>segment piece rotation<br>1 1 1.3<br>1 2 5.7<br>2 1 4.4<br>2 2 3.4<br>2 3 5.5<br>......<br><br>;then I calculate length for each segment and put those values in a<br>vector array whose index is equal to segment-1, so each length can be<br>easily matched to each segment. My question is can I effeciently<br>match the length values into the structure for each piece without<br>looping? Statistical programming languages like SAS have match-merge<br>capabilities so this kind of thing is simple, but I am not aware of<br>similar capabilities in IDL.<br><br></pre></blockquote>
<pre wrap=""><!----><br>Will <br><br>IDL&gt; segments.length=seg_len_vec[segments.segment-1]<br><br>do what you want?<br><br>JD<br></pre>
</blockquote>
<br>
<pre class="moz-signature">--
Joseph E. Means
Assistant Professor, <a class="moz-txt-link-abbreviated" href="mailto:joe.means@orst.edu">joe.means@orst.edu</a>
Department of Forest Science
Oregon State University
Corvallis, OR 97331-5752
541-750-7351</pre>
<br>
</body></html>
Re: How to do a "match merge"? [message #27593 is a reply to message #27583] Thu, 25 October 2001 12:53 Go to previous message
Pavel A. Romashkin is currently offline  Pavel A. Romashkin
Messages: 531
Registered: November 2000
Senior Member
I am not sure what exactly needs to be done. Something like

segment = {seg:0, piece:0, rotation:0.0, length:0.0}
segments = Replicate(segment, 2000)

segments.seg = indgen(2000)
segments[where(segments.seg gt 100)].length = the_Length
help, where(segments.seg gt 2 and segments.length lt the_Length)

?
Hope this helps.
Pavel

Joe Means wrote:

> ;then I calculate length for each segment and put those values in a
> vector array whose index is equal to segment-1, so each length can be
> easily matched to each segment. My question is can I effeciently
> match the length values into the structure for each piece without
> looping?>
Re: How to do a "match merge"? [message #27594 is a reply to message #27593] Thu, 25 October 2001 12:53 Go to previous message
John-David T. Smith is currently offline  John-David T. Smith
Messages: 384
Registered: January 2000
Senior Member
Joe Means wrote:
>
> ;I have a structure:
> segment = {seg:0, piece:0, rotation:0.0, length:0.0}
> segments = Replicate(segment, 2000)
>
> ;then I read data to fill array segments. For each segment there can
> be 1 or more values of piece,
> ;so the data in segments can look like:
> segment piece rotation
> 1 1 1.3
> 1 2 5.7
> 2 1 4.4
> 2 2 3.4
> 2 3 5.5
> ......
>
> ;then I calculate length for each segment and put those values in a
> vector array whose index is equal to segment-1, so each length can be
> easily matched to each segment. My question is can I effeciently
> match the length values into the structure for each piece without
> looping? Statistical programming languages like SAS have match-merge
> capabilities so this kind of thing is simple, but I am not aware of
> similar capabilities in IDL.
>

Will

IDL> segments.length=seg_len_vec[segments.segment-1]

do what you want?

JD
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL 5.5 jpeg and tiff
Next Topic: idlwave help

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:31:04 PDT 2025

Total time taken to generate the page: 0.00393 seconds