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

Home » Public Forums » archive » Reading Multiple .sav files with same variable names for graphing
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: Reading Multiple .sav files with same variable names for graphing [message #88955 is a reply to message #88952] Mon, 07 July 2014 08:11 Go to previous messageGo to previous message
morganlsilverman is currently offline  morganlsilverman
Messages: 46
Registered: February 2013
Member
On Monday, July 7, 2014 10:47:01 AM UTC-4, David Fanning wrote:
> Morgan Silverman writes:
>
>
>
>> I have 9 .sav files each containing a different days data but with the same set of variable names. I am trying to figure out a better method to read each of these files and save the variables to different named arrays or structures so that I can then plot several days of data in the same graph. The method i've been using right now involves a lot of coding (shown below for first 2 files). Is there a better way to do this so that I can then plot multiple arrays from
>
> different .save files on the same graph? Thank you.
>
>
>
> Typically, things like this are done in a loop. :-)
>
>
>
> Cheers,
>
>
>
> David
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")

Right, of course :-) I started creating a loop but ran into trouble when I wanted to rename the structure or variables each loop iteration. I tried doing something like the following but run into trouble creating the temp variable name to use for each new structure and then using it. How do I create a new named structure or array each loop?

for i=0,0 do begin
flightnum = [5,10,14,4,8,11,2,6,7]
flight = flightnum(i)
restore, './DAQPadonia_AvgBackTraj_Flight'+strtrim(flight,2)+'.sav'
temp = 'Flight'+strtrim(i,2)
temp = {Avg500Lat: fltarr(73), Avg500Lon: fltarr(73), Avg1000Lat: fltarr(73), Avg1000Lon: fltarr(73), $
Avg1500Lat: fltarr(73), Avg1500Lon: fltarr(73), Avg2000Lat: fltarr(73), Avg2000Lon: fltarr(73)}
Flight5.Avg500Lat = Avg500Lat
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Projected Meter Space and mapCoord
Next Topic: IDL project build scripts?

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

Current Time: Wed Oct 08 15:27:47 PDT 2025

Total time taken to generate the page: 0.00466 seconds