Skip to content

PnE rescaling and fix numpy 2.x compatibility#78

Open
mhussels wants to merge 6 commits intoeyurtsev:masterfrom
mhussels:PnE_rescaling
Open

PnE rescaling and fix numpy 2.x compatibility#78
mhussels wants to merge 6 commits intoeyurtsev:masterfrom
mhussels:PnE_rescaling

Conversation

@mhussels
Copy link
Copy Markdown

I have added a logarithmic to linear transformation method to do the rescaling as described in the FCS standard for the $PnE parameter (Issue #16). The method tries to handle non-standard inputs that may occur for some instruments. If a transformation is performed, this is written to the log. The method is only used for data type "I" as described in the FCS standard.
I had to change the data in the unit tests because some files contain log data and otherwise the test would fail. I used FCS Express 7 to check that the data was correctly transformed.

I also fixed the Numpy 2.x compatibility problem (Issue #74).

… by the FCS standard. The method checks the settings in the $PnE parameter and tries to fix non-standard entries (this may happen on some instruments). If the method applies log to linear transformation, a message is written to the log.

The read_data method is modified to call _transform_log_to_lin if the data type is integer. For other data types this transformation is not allowed in the FCS standard and the scaling has to be linear.
…e files contain log data, the parsed data needs to be compared with correctly scaled data. I have checked the data with FCS Express 7 to make sure the data is correct.

Fix test_parse_into_numpy_data_correctly to run without errors.
In Numpy 2.x, ndarray no longer has a newbyteorder method.
This code should work as of Numpy 1.6.
@jgarthur
Copy link
Copy Markdown

@eyurtsev does this look OK?

@pfistfl
Copy link
Copy Markdown

pfistfl commented Oct 10, 2025

@eyurtsev: Small reminder, this looks quite useful!

…ters are correctly set to 0.0,0.0 to fall back to linear scaling.
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.

3 participants