Skip to content

Update to upstream - #12

Open
harivyasi wants to merge 59 commits into
ComPlat:masterfrom
jjhelmus:master
Open

harivyasi wants to merge 59 commits into
ComPlat:masterfrom
jjhelmus:master

Conversation

@harivyasi

Copy link
Copy Markdown
Member

No description provided.

JLVarjo and others added 30 commits November 13, 2024 09:36
- Fixed a bug where `proc_base.ls()` returned zeroed out data when left shifting by zero (pts=0), by adding a guard clause.

- Minor changes: Changed the default parameter from `pts=0.0` to `pts=0` for clarity in a few functions, especially with the docstring describing `pts` as int
bugfix: Fix zero-shift bug in `proc_base.ls`
Try second encoding for bruker jcamp-dx files when first fails
NumPy 2.0 compatibility changes
bruker.write uses override argument when writing proc files
Deprecation Fix: np.fromstring to np.frombuffer
kaustubhmote and others added 29 commits January 23, 2026 17:54
Fix: Handle UTF-8 BOM in JCAMP-DX files
Bugfix: Reading Floating Point Datasets (Topspin > 4.0)
A function to update the unit conversion object
Handle partially acquired datasets in Bruker
Closes #123.

The PSEQ section of Tecmag .tnt files stores sequence tables (rfamp,
delay tables, etc.) as pairs of length-prefixed Pascal strings. This
adds guess_tables() to expose them as a dict.

The pytnt library (chatcannon/pytnt, GPL-3.0) reads delay tables by
matching the default TNMR naming pattern `de[0-9]+:[0-9]`. As noted by
robbyblum in #123, most users assign descriptive names to their tables
(e.g. "rfamp", "tp"), which pytnt's regex does not catch. This
implementation generalizes the parser to find any valid Pascal-string
pair in PSEQ, with strict length-prefix validation to reject
coincidental substring matches.

The function follows the API suggested by kaustubhmote in #123:
a standalone guess_tables() function with optional name filtering.
Single-value (scalar) entries are excluded since they typically
represent sequence variable defaults rather than swept tables.

SI-prefix conversion (e.g. '100u' -> 1e-4) mirrors pytnt's
convert_si() behavior so unit-suffixed tokens are returned in base
SI units.

Tests cover the numeric parsing, SI conversion, scalar exclusion,
name filtering, the convert_si=False mode, files without a PSEQ
section, rejection of invalid length prefixes, rejection of
non-ASCII names, and mixed whitespace separators.
Add guess_tables() to tecmag for reading sequence tables from PSEQ
drop support for Python 3.8,9 add 3.13,14
Fix Bruker magnitude-mode quadrature metadata
…tant

Document the GM Gaussian constant discussed in #17
- Use t2=0.01 and halve the first FID point in the synthetic spectrum so
  it is not truncated and needs no intrinsic phase correction.
- Check that the recovered phases undo the applied error (opt[0] ~ -p0,
  p1 ~ 0) instead of only comparing magnitudes.
- Translate fmin-style kwargs (xtol, ftol, maxiter, maxfun, disp,
  initial_simplex) into minimize options when bounds are given.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scipy silently broadcasts a single (min, max) pair to both phases, so
bounds=[(-180, 180)] also constrained p1. Require exactly two pairs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Explain (None, None) to leave one phase unbounded, with examples.
- Note that hard p0 limits can trap the optimiser near +-180 since the
  phase is periodic; the zero-order example now leaves p0 unbounded.
- Test single-phase bounds and p0 recovery near 180 with p0 unbounded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The zero-order phase is periodic, so hard limits on it can trap the
optimiser at a limit while p1 absorbs the remaining error (e.g. a 170
degree p0 error gave p0=-180, p1=22). p0 is now always optimised
without limits and wrapped into [-180, 180) on return; only p1 can be
bounded, via p1_bounds=(min, max).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add optional bounds parameters to autophase
Replace removed pinv2 in linear prediction
FIX: update FDSPECNUM properly when using pipe_proc.ext on 2D data set
* Fixes to JCAMP-DX udic & FID handling
---------

Co-authored-by: Juuso Lehtivarjo <jlehtivarjo@nmrsolutions.fi>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.