I have to rountinely read in a substantial amount of data (~60 parameters, each an array of ~1000 values) and then plot various subsets of it, fit curves, etc. Right now, every plotting or fitting routine I generate has the same ~200 lines copied and pasted into it to handle this input and subset defining. It's a pain when the format of my dataset is modified and I try to update my results, I have to hunt though all my programs to make the same teaks to the input routine. I'd like to write a procedure that handles all my input, so that I can simply insert an input command into new procedures and then manipulate the data from there. For example, I'd like to have a procedure "input_everything" so that I could write:
pro make_a_plot
input_everything
plot, the_stuff, the_other_stuff
oplot, more_things
end
Ideally, "input_everything" would read in all my data, define various subsets, and then return all the new subarrays it has made out to procedure make_a_plot. I know how to do the reading and subset defining, it's the sending the values back out again I can't get. "Stop" sends me back to interactive mode, but I want to keep runnning the outer procedure. "Return" wipes out all the contents of the arrays input_everything made. How do I get a procedure to send ~60 variables out to its parent routine?
|