sorting measurementlist by wavelength --> is data sorted too?
When reading in one of mine .snirf-files I noticed the following:
in line 247 of the latest version of DataClass.m of Homer3 the MeasurementList rows are sorted based on the wavelengths:
% Sort according to wavelength ml = sortrows(ml,4);
However, I don't see anywhere in the code where the order of the data is sorted accordingly. I am worried that the labeling of my data is not correct anymore because there is quite a difference between my labels (sorted by source-detector pair) and the sorted homer measurementlist (sorted by wavelength).
Am I overlooking a part in the code where the data is sorted or is the code handling this differently?
I have added one of my .snirf files so you can try it out yourself.
Thank you in advance!
Thanks for this. You are correct, this could lead to serious issues in the case where data is not sorted prior to import. This is some legacy code that shouldn't be there.
It actually came to our attention recently with the introduction of new time domain data from unfamiliar hardware, and so we are actively working on this-- try this developmental branch of Homer3 and compare the data labeling.
It looks like my file was not added properly because it was too big in size. You can download it here: https://surfdrive.surf.nl/files/index.php/s/OSQ4KM2zq2oaNfJ
Thanks for your reply and the suggestion to look at the developmental branch. For now, I just commented out the line where the measurement list is sorted and now my data makes much more sense. 🙂 Is there a reason to sort the measurement list for later steps, or is there no harm by just commenting this line out?
Also, would you like me to report such issues in the future on GitHub directly or just on this forum?
For now, I just commented out the line where the measurement list is sorted and now my data makes much more sense.
This should work for display-- it is possible that some places in the code expect an ml matrix ordered by wavelength, but I have yet to find an explicit one. I'll update you here as I work on this.