Re: REVERSE even row elements in data array. [message #12476 is a reply to message #12475] |
Sun, 02 August 1998 00:00  |
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
|
|
|