Skip to content

Commit

Permalink
New version
Browse files Browse the repository at this point in the history
  • Loading branch information
MetallerTM committed Jul 15, 2023
1 parent 5c97720 commit 75e800e
Show file tree
Hide file tree
Showing 24 changed files with 2,162 additions and 504 deletions.
65 changes: 65 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,68 @@
# Version 0.3a.1

## Update notes:
Extension of the Spectra classes for the management of other-than-Bruker data formats.
Modifications to some attributes and methods to make everything more user-friendly.
See the dedicated paragraph for details.

The *linalg* package, previously imported from *scipy*, was now substituted with its *numpy* counterpart. Problems due to missing funcions were not tested, hence errors might arise.

New algorithms for phase correction, baseline computation, smoothing, linear least-squares fitting were also implemented.

All the functions that save figures, i.e. almost the whole *figures* package, have now two additional parameters: *ext*, which allows to save the figure in different formats than PNG, and *dpi*, to specify the desired resolution.

The user guide at the beginning of the documentation pdf file was updated to instruct the reader about the recent modifications of the package.

### General changes in the Spectra classes:
The attribute *datadir* has been split in two parts: *datadir*, which only contains the path to the directory that contains the file, and *filename*, which is actually the name of the file, without any extension. They are generated by functions in *os.path*, which should make the reading of the spectra cross-platform.
The trimming of the extension is achieved by right-splitting at the last "." character of the filename, and retaining the left part.

Right after having read the FID and/or the processed data, the program looks for a file named *filename.procs* in the same directory of the input file, which contains the *procs* dictionary in a format that the **eval** function is able to interpret as a dictionary. If there is, this file is transformed in a dictionary and stored in the *procs* attribute; otherwise, the *procs* dictionary is initialized with default values and then saved in a file named *filename.procs* in the same directory of the input file.

The *processing* function, after the Fourier transform, applies the phase correction and calibrates the spectrum according to the values that are currently stored in the *procs* dictionary. With respect to the previous point, this means that you can store your phase angles to remember the processing.

All functions that change a processing parameter, such as *adjph* or the baseline computation, call for the method *write_procs*, which update the file *filename.procs* with the new values stored in the *procs* dictionary.
In order to comply with this new aspect, the methods *adjph* and *cal* have now a new parameter "update" which allows to disable the update of the *procs* dictionary with the new values. Its default value is "True", hence it behaves as it did previously unless it is explicitely declared.

More detailed comments added in the source code.

## Modified functions:
- *fit.fit_int*: now it computes both intensity and offset, with a slightly modified formula which takes into account also the less relevant term.
- *figures.ax2D*: corrected AssertionError when xscale and yscale have the same dimension
- *figures.figure2D*: corrected AssertionError when xscale and yscale have the same dimension
- *figures.figure2D_multi*: employs better colormaps. You can superimpose a maximum of 6 spectra (positive only) or 3 spectra (both positive and negative).
- *fit.get_region*: automatic zoom can be enabled/disabled by pressing "z" on the keyboard
- *fit.histogram*: now it calls for *fit.ax_histogram* to compute the histogram.
- *spectra.Pseudo_2D.plot_md*: default value of the "which" changed from "all" to None
- *spectra.Pseudo_2D.plot_stacked*: default value of the "which" changed from "all" to None
- *spectra.Spectrum_1D.__init__*: now the parameter "in\_file" can also be an acqus dictionary, in this case the function *sim.load_sim_1D* is not called
- *spectra.Spectrum_1D.__init__*: added new parameter "spect", that allows to read also Varian and Magritek datasets.
- *spectra.Spectrum_1D.basl* now subtracts *self.baseline* from *self.S*, then unpacks it into *self.r* and *self.i*. Its previous behaviour is copied in the new function *Spectrum_1D.baseline_correction*
- *spectra.Spectrum_1D.process* now reverses automatically non-Bruker data after FT for correct display of data
- *spectra.Spectrum_2D.eae*: the behaviour of the function is now related to the value of "self.eaeflag"
- *spectra.Spectrum_nD.save_ser* changed name into *.write_ser* for consistency with other functions. Also the definition of the destination pathway has changed.

## Added functions:
- *misc.makeacqus_1D_varian*
- *misc.makeacqus_1D_spinsolve*
- *processing.acme*
- *processing.whittaker_smoother*
- *processing.RPBC*
- *processing.align*
- *fit.LR*
- *fit.LSP*
- *fit.polyn_basl*
- *fit.SINC_phase*
- *spectra.Spectrum_nD.write_procs*
- *spectra.Spectrum_nD.read_procs*
- *spectra.Spectrum_1D.acme*
- *spectra.Spectrum_1D.baseline_correction*
- *spectra.Spectrum_1D.rpbc*

## Added classes:
- *fit.CostFunc*
- *fit.SINC_ObjFunc*

# Version 0.2a.0

## Update notes:
Expand Down
Loading

0 comments on commit 75e800e

Please sign in to comment.