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

Formalize STFT Fourier coefficients object #314

Open
7 tasks
kkappler opened this issue Jan 8, 2024 · 1 comment
Open
7 tasks

Formalize STFT Fourier coefficients object #314

kkappler opened this issue Jan 8, 2024 · 1 comment

Comments

@kkappler
Copy link
Collaborator

kkappler commented Jan 8, 2024

Currently these are called stft_obj in the code, and they are xarrays.

There is now a class called Spectrogram() as a container for these objects. This could be where the interface to mth5's FourierCoefficients lives. We can also add the various types of plotters, coherency, cross-power and etc calculations to this class.

  • Add option for WindowedTimeSeries.apply_fft() to return Spectrogram object
  • Integrate spectrogram object througout pipeline (instead of stft_obj)

These objects are the inputs to tf estimation, as well as coherence weights, and probably some other channel or segment weighting, outlier rejection methods. A class that manages these maybe called for, which could have cross-power calculation methods, Z_estimators (ala Sims, Vozoff), and more.

When these unpack from MTH5, or get built, they could be improved by:

  • Having units associated: [mV/km]/[sqrt(Hz)], [nT]/[sqrt(Hz)],

  • Once units are there, the unused placeholder kwarg "units" in process_tf_decimation_level can be replaced with a check that the units of the individual time series are one of these two expected cases.

  • These objects will be the inputs to tf estimation, as well as coherence weights, and probably some other channel or segment weighting, outlier rejection methods.

  • Also, the merged stft object should be examined;
    local_merged_stft_obj, remote_merged_stft_obj = merge_stfts(stfts, tfk)
    note that it is a common use case to merge stfts with time gaps that are large in comparison to the TS duration ...
    For example, say you are burst sampling at 32kHz every hour for ~5 minutes, with a station that is left out for a day. If merging the stfts "fills in" the missing timestamps, then this would increase by an order of magntiude the RAM used if the entire merged sequence was kept in memory.

  • Cross powers method should use self._crosspower(ch1, ch2) method which returns self.crosspower_dict[f"{ch1}-{ch2}"], which was initialized to None. It only computes if the value of key f"{ch1}-{ch2}" is not None

@kkappler
Copy link
Collaborator Author

kkappler commented Jan 27, 2024

There is now a class called Spectrogram() as a container for these objects. This could be where the interface to mth5's FourierCoefficients lives. We can also add the various types of plotters, coherency, cross-power and etc calculations to this class.

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

No branches or pull requests

1 participant