[SciPy-User] Porting code from IDL to Python - 'Common block' equivalent?

David Andrews irbdavid at gmail.com
Wed Jul 21 04:18:24 EDT 2010


Hi All,

I suppose this might not strictly be a scipy type question, but I'll
ask here as I expect some of you might understand what I'm getting at!

I'm in the process of porting some code from IDL (Interactive Data
Language - popular in some fields of science, but largely nowhere
else) to Python.  Essentially it's just plotting and analyzing time
series data, and so most of the porting is relatively simple.  The one
stumbling block - is there an equivalent or useful replacement for the
"common block" concept in IDL available in Python?

Common blocks are areas of shared memory held by IDL that can be
accessed easily from within sub-routines.  So for example, in our IDL
code, we load data into these common blocks at the start of a session,
and then perform whatever analysis on it.  In this manner, we do not
have to continually re-load data every time we re-perform a piece of
analysis.  They store their contents persistently, for the duration of
the IDL session.  It's all for academic research purposes, so it's
very much 'try this / see what happens / alter it, try again' kind of
work.  The loading and initial processing of data is fairly time
intensive, so having to reload at each step is a bit frustrating and
not very productive.

So, does anyone have any suggestions as to the best way to go about
porting this sort of behavior?  Pickle seems to be one option, but
that would involve read/write to disk operations anyway?  Any others?

Kind Regards,

David

---------------------------------------
David Andrews
Postgraduate Student, Radio & Space Plasma Physics Group
University of Leicester, UK



More information about the SciPy-User mailing list