X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 28 Mar 2016 02:17 PM by  anon
Help with array jujitsu (easy) !!
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
28 Mar 2016 02:17 PM
    Hi all, I have an array called data that is 1000, 4000. I also have a two dimensional array of subscripts that I would like to apply to only the first dimension of the data array. IDL> help, data DATA FLOAT = Array[1000, 4000] IDL> help, subs SUBS LONG64 = Array[21, 4] The result I want is [21, 4, 4000]. However, I can't quite figure out how to get that. For example: IDL> help, data[[subs],*] FLOAT = Array[84, 4000] Does anyone see how to make this happen? Thanks in advance! S-

    Deleted User



    Basic Member


    Posts:143
    Basic Member


    --
    08 Apr 2016 05:51 PM
    I think you can use the REFORM function to get the result you are seeking: data = fltarr(1000, 4000) subs = lonarr(21,4) newdata = data[[subs],*] final_data = reform(newdata, 21,4,4000) IDL> help, final_data FINAL_DATA FLOAT = Array[21, 4, 4000] David Starbuck Harris Geospatial Solutions
    You are not authorized to post a reply.