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

Home » Public Forums » archive » Re: REVERSE even row elements in data array.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: REVERSE even row elements in data array. [message #12476 is a reply to message #12475] Sun, 02 August 1998 00:00 Go to previous message
throop2 is currently offline  throop2
Messages: 1
Registered: August 1998
Junior Member
In article <35C3E2CB.7F621C0A@maxwell.ph.kcl.ac.uk>,
Jouhahn Lee <jl@maxwell.ph.kcl.ac.uk> wrote:
> Thanks to Mike and Kevin, I could retrieve the microscopic data using
> IDL. Thanks.
>
> Now I can have 64*32 array expandible to 1024* 512 array.
> By the way, in 64*32 array, I need to change the even rows's data
> elements.
> I made a C program for this but I found that subroutine REVERSE in IDL
> can do.
>
> Would you tell me how can I apply REVERSE only to the even row data in
> 64*32 array?
> (ie. keep the odd row, reverse the even row) How can I do that? I am
> still novice using
> IDL so I need to have some help please. Thanks in advance!

When I'm doing things like this, I often create an array of 1's and 0's
to multiply the original array by. This extracts the chosen elements,
and the complement of this array returns all the other, non-chosen elements.

Try this, with your array to be reversed in the array 'data':

xdim = 64 ; x array dimension
ydim = 32 ; y array dimension

odds = double(((1+intarr(xdim)) # indgen(ydim)) mod 2)
; create a list of integers and a list of 1's,
; co-multiply them, and extract last bit.

evens = not odds ; every row of this array which is 1 will be
; reversed

result = data*odds + reverse(data*evens)
; reverse and extract the appropriate elements

- henry

------------------------------------------------------
| Henry Throop throop@colorado.edu (303) 492-1628 |
------------------------------------------------------
| Laboratory for Atmospheric and Space Physics |
| University of Colorado, Boulder 80309-0392 |
------------------------------------------------------


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL limits
Next Topic: Interrupting a widget application

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

Current Time: Sun Oct 12 00:05:13 PDT 2025

Total time taken to generate the page: 1.19618 seconds