[yt-users] Pickling YT objects
Sam Geen
samgeen at astro.ox.ac.uk
Fri Feb 14 06:22:31 PST 2014
Hmm, just found this:
http://yt-project.org/doc/analyzing/objects.html?#storing-and-loading-objects
although it claims that cPickle should work as well (I have a library
that handles the pickling so I'd prefer the cPickle solution if possible
to avoid complicating the code)
I should add that I'm using a RAMSES gas-only simulation.
Sam
On 14/02/2014 15:19, Sam Geen wrote:
> Hi,
>
> I'm making plots of my data and I want to save them as pickle files so
> I can load them later and perhaps mess with the colour map limits,
> say, without reprocessing all the data (I have about 9TB to go
> through). When I tried this I got the error: "TypeError: can't pickle
> instancemethod objects"
>
> Do you know if this is possible, or some variant of it? I'm running:
>
> pf = yt.mods.load(file_location)
> prj = yt.mods.ProjectionPlot(pf, 2, var, center=[0.5, 0.5, 0.5],
> width=(rlim, 'pc'), weight_field=None)
>
> and trying to pickle prj, when I get the error. prj appears to be a
> yt.visualization.plot_window.ProjectionPlot object and not an instance
> method, but I could be wrong.
>
> At least it could be good to save the 2D image array and link it back
> later to a YT plot object, but I don't know much about the internal
> workings of the plot objects as to whether this is possible or not.
>
> Thanks,
>
> Sam
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
More information about the yt-users
mailing list