Draft: Add Isotope and spin to Spectrum class
This commit makes the Spectrum class isotope and spin aware.
The spectIO module import this information into Spectrum instance for Bruker import (Topspin/XWinNMR spectrum and FID), winNMR.
An extra menu within Workspace (or Tools ?) allows to change the isotope and the corresponding spin.
This will allow in the future to set automatically the spin and axe labels in fitting or plot modules.
define isotope and spin in spectrum.py
Add isotope and spin in _init_
array_like str for isotopesarray_like (float) for spins
manage dimensions: same as spec, wholeecho or ref are managed...
Functions to create:
-
set_isotope(should it set associated spin ?) set_spin
Functions to update:
concatenatesplitmatrixManipgetSlicerestoreData
access of isotope and spin in views.py
via function access especially for macro handling. and future use in plot mode.
Add access functions:
get_isotope(self, dim=-1)get_spin(self, dim=-1)set_isotope(self, value) (MacroHandling)set_spin(self, value) (MacroHandling)
implement save/read in specIO
jsonmatlabTopspinXwinNMR- Varian
- Jeol
define tests for spin and isotope in test modules:
- spectrum:
add comparison for isotope and spin in assertSpectraEqualtest for new functions setIsotope and setSpinsplitconcatenate- matrixManip
- getSlice
- restoreData
- views
specIO- ssNake
rework ssNake access to isotope
Current implementation in workspace need to be reworked and some points need discussion.
- Spin/isotope change must be done through views access functions to manage macros which will also enable history
I would like to have spin and isotope to be modified in a all dimensions. One possibility could be in directly workspace info, with editable parameters. But this may have lot of side effects. This could be later extended to ref and freq. Very often one need to copy ref of freq from one dimension to another one.
I will implement several access points:
- update WorkIsotopeWindow in worksapec menu to use view access
- make Isotope settable in Workspace Info
- implement isotope in tools menu for active dimension only
manage workspace Combine menu
I didn't looked into that yet.
- combine
- insert
- add
- substract
- multiply
- divide
Add isotope in axis labels
- set default xylabels
- add option in plot settings
- Add isotope in default xlabel in spectrumFrame.PlotFrame.getLabel