On Fri, Feb 17, 2017 at 2:58 PM, Jason Galyardt email@example.com wrote:
Dear yt Users,
Does anyone know of a way to export the data of a profile object to a byte stream? Specifically, I'd like to be able to store several byte streams from several different simulation files into a single dictionary object (for example), and then pickle the dictionary. I'd like to then unpickle the dictionary object at a later time for plotting, etc.
I have figured out a way to do this, but it involves saving each profile to a temporary file, reading the temp file into a byte stream, and then pickling the byte stream; then to reload, I would have to unpickle the byte stream, write it to a temporary file, then use yt.load() to get the profile object back. This works, but boy, it's inefficient. Dealing with a whole bunch of separate files generated by profile.save_as_dataset() is inefficient in different way. Any ideas on streamlining this workflow?
I'm not sure I fully understand what you're trying to do. A code example or an outline if a code example with the part you're confused about left to be filled in would help.
Why not just save the raw profile data for the fields you're interested in, e.g. profile[field], which will be a numpy array. Do you need other data that's defined on the profile object?
Jason Galyardt University of Georgia
yt-users mailing list firstname.lastname@example.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org