diff --git a/resources/ReleaseNotes.md b/resources/ReleaseNotes.md index 4ff5d5f0..c43a8961 100644 --- a/resources/ReleaseNotes.md +++ b/resources/ReleaseNotes.md @@ -1,23 +1,7 @@ # App -- Fix issue when event, meta data and HK patterns are empty -- Fix issue with closing invalid figures +- # Software -- Add method to `mag.Instrument` to fill warm-up with `missing` data -- Add method to `mag.Science` to replace periods with a filler variable -- Add save/load utility class -- Separate calculation of spectrogram in separate function -- Replace last element of file with `missing` to improve plot where data is missing -- Science object with no data is considered empty in `mag.Instrument` -- Reintroduce filtering for charts -- Rename `cropDataBasedOnScience` to `cropToMatch` -- Make sure derivative is empty when data is empty -- Remove unnecessary `Sealed` attributes on classes -- Fix issue with consecutive events of the same type missing a completion message -- Fix issue when cropping data and no timestamps are selected -- Fix issue with `mag.graphics.chart.Stem` not showing markers -- Add tests for `mag.Instrument`, `mag.PSD` and `mag.Science/computePSD` -- Add tests for `mag.graphics.mixin.mustBeColor` -- Fix typo in `MarkerSupportTestCase` \ No newline at end of file +- Fix issue with computing PSD when data has `NaN`s or `Inf`s \ No newline at end of file diff --git a/src/data/+mag/Science.m b/src/data/+mag/Science.m index 98ab2cea..3099749f 100644 --- a/src/data/+mag/Science.m +++ b/src/data/+mag/Science.m @@ -252,7 +252,10 @@ function replace(this, timeFilter, filler) % Compute PSD. dt = seconds(median(diff(t(locFilter)))); - [psd, f] = psdtsh(this.XYZ(locFilter, :), dt, options.FFTType, options.NW); + xyz = this.XYZ(locFilter, :); + xyz(ismissing(xyz) | isinf(xyz)) = 0; + + [psd, f] = psdtsh(xyz, dt, options.FFTType, options.NW); psd = psd .^ 0.5; data = mag.PSD(table(f, psd(:, 1), psd(:, 2), psd(:, 3), VariableNames = ["f", "x", "y", "z"]));