Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.mat store ints as doubles #327

Open
willGraham01 opened this issue Jun 2, 2023 · 0 comments
Open

.mat store ints as doubles #327

willGraham01 opened this issue Jun 2, 2023 · 0 comments
Labels
bug Something isn't working housekeeping Code cleanup investigation A study or investigation of something.

Comments

@willGraham01
Copy link
Collaborator

willGraham01 commented Jun 2, 2023

.mat files save values as doubles by default, and thus the .mat inputs that we provide to TDMS have values stored as double when we are expecting to read them into std::vector<int> for example.

This causes segmentation faults when we attempt to read in data that we expect to be integer-valued, using the HDF5 C++ API.

There are several variables that we attempt to read in as ints. Creating a list of known places here which will be added to as more are found.
Known variables that are affected:

  • campssample -> components (saved as double but contains int values). Appears in VertexPhasors.
  • fieldsample -> i,j,k (saved as double but contains int values). Appears in FieldSample.

We can circumnavigate this by introducing intermediary buffers in our read methods, but this is not ideal.

  • For the purposes of removing the MATLAB header dependency (Remove MATLAB dependency #70) this is an acceptable workaround.
  • However in the future we should look to be stricter in how the input files (via iteratefdtd_matrix and others) are written.
@willGraham01 willGraham01 added bug Something isn't working housekeeping Code cleanup investigation A study or investigation of something. labels Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working housekeeping Code cleanup investigation A study or investigation of something.
Projects
None yet
Development

No branches or pull requests

1 participant