PnE rescaling and fix numpy 2.x compatibility#78
Open
mhussels wants to merge 6 commits intoeyurtsev:masterfrom
Open
PnE rescaling and fix numpy 2.x compatibility#78mhussels wants to merge 6 commits intoeyurtsev:masterfrom
mhussels wants to merge 6 commits intoeyurtsev:masterfrom
Conversation
… 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.
…stead of using the hard coded "<f4".
|
@eyurtsev does this look OK? |
|
@eyurtsev: Small reminder, this looks quite useful! |
…ters are correctly set to 0.0,0.0 to fall back to linear scaling.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).