mailRe: r27012 - /branches/nmrglue/test_suite/system_tests/nmrglue.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by Troels Emtekær Linnet on December 08, 2014 - 15:20:
Hi Edward.

I am trying to look at my data now with the plots I have in my mind.

The branch is actually in a state where I can use it.

The only trouble I have, is the storing of the numpy array.

I am actually not planning on saving the state, but will continuously just
read from the original file.
But since the numpy array is saved in cdp, to get access, then storing the
state should be possible.

All plots will just be made with matplotlib after the shuffling around with
the numpy array.

Best
Troels



2014-12-08 15:14 GMT+01:00 Edward d'Auvergne <edward@xxxxxxxxxxxxx>:

Hi Troels,

I think I will have to leave the implementation in relax.

Would it take much to get the branch in a reasonable state for merging
back?  Even if not everything is implemented?  Well, apart from
bringing in nmrglue 0.5 when that is released.  I'm sure that in the
future some PhD student or postdoc will appreciate and take up what
you have already done and expand on it.  You've already put a lot of
polish on this, so it'd be a pity to not merge it.


Time goes away from pursuing the analysis, and goes into rather annoying
stuff.

With coding, it's a bit hard to know what will be quick and what will
take a lot of time.  It's a problem I have too.


The idea is simple.
Load one or two spectrum.
Plot the contour, or histogram.
Or make a correlation plot of the two spectra.

Store the data.

Storing the data in any other format always takes more effort when
combining data from different sources/software.  But this is pretty
much sorted out for the nmrglue data.  You could even store the
nmrglue data in the relax data store as a Base64 string and a new
variable for the ndarray shape, as a shortcut.


Storing the axis plots is a different question.

http://stackoverflow.com/questions/7290370/store-and-reload-matplotlib-pyplot-object

I cannot actually do it at the moment.
So essentially, it just storing a numpy array

For matplotlib data, I don't think that storing these data structures
will ever be possible to implement in a compatible way.  The reason is
because matplotlib is too much of a moving target.  They do not have a
stable API!  So I would never recommend that you tackle such a problem
in this way.  That's just asking for pain ;)

There is a much better alternative which would be more compatible with
future matplotlib versions.  And that is that all the information
required to create the matplotlib plot is stored in a pure
data_store.data_classes.Element class container as simple variables
(str, bool, int, float, or a list, tuple or dict of these).  This is
similar to the GUI setting storage.  Then there could be a user
function to recreate the plot using the currently stored settings.
This would work much better.  And it would be orders of magnitude
quicker to implement than working with matplotlib data structures.

Regards,

Edward



Related Messages


Powered by MHonArc, Updated Mon Dec 08 15:40:10 2014