subclassing Scientific.IO.NetCDFFile

J

Jon Beezley

Hi all,

I have come across a problem that I am unsure how to get around. What
I want to do is create a subclass of Scientific.IO.NetCDFFile, but
despite what the docstrings say isn't really a class at all, but a
function that returns some sort of data structure from the netcdf C
api. I am aware of pure python implementations such as
scipy.io.netcdf_file, but these seem to have internal limitations
causing overflows when opening large (e.g. several gigabytes) files.

I have tried creating a class with an open NetCDFFile as a member
(f). File attributes are easy enough to deal with
(self.__dict__=self.f.__dict__), and I can even create callable
methods such as self.dimensions which return self.f.dimensions.
However, when it comes to more esoteric aspects such as multi-
dimensional slicing of the variables (derived somehow from
numpy.array), I am somewhat at a loss.

So my question is: Is there a simple method of containing NetCDFFile
in a class? If not, how can I design a class that will behave like
NetCDFFile from the user perspective?

Thanks,
Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,162
Latest member
GertrudeMa
Top