smeerten / ssnake

A program for the analysis of NMR data.
Other
20 stars 15 forks source link

Custom axis lost after FT and undo #127

Open Famlam opened 1 year ago

Famlam commented 1 year ago

A minor issue, just an inconvenience:

  1. Have i.e. a saturation recovery experiment. Fourier transform, phase etc. the spectra
  2. Go to the 'indirect dimension'. Set a custom axis (I used a logarithmic from 0.01 with increments of 2)
  3. Press the Fourier button by accident
  4. Press Edit -> Undo to undo the Fourier transform of the indirect dimension (because obviously you don't want to FT this)
  5. Notice the custom axis is lost
jtrebosc commented 10 months ago

Any operation that rely on FT internally does loose the customAxis as it uses resetXax(). For example the roll, shift, fiddle, autophase, apodize... (when done in freq domain)... I'm not sure but I feel like this will be quite difficult to implement because the undo function is done by applying the inverse function and customAxis values are not stored. A simple way to prevent surprises would be to completely dis-allow such functions on data with custom axis : raise SsnakeException in __fourier if applied to data with custom axis. Julien

Famlam commented 10 months ago

I cannot think of a good use case for FT (or any function relying on FT) on an object with a custom axis right now, but in order to allow the user to still do it if they have to, it may be better to just give a pop-up warning if a custom axis is set: "This action will reset the custom axis. This cannot be undone. Continue? Y/N"