Differences between revisions 4 and 5
Revision 4 as of 2020-06-14 16:53:24
Size: 1000
Comment:
Revision 5 as of 2020-06-14 17:04:58
Size: 1659
Comment:
Deletions are marked like this. Additions are marked like this.
Line 26: Line 26:

TimeSeriesからスペクトルを計算する際、fftlengthの値が小さいと下図左のように謎の冪スペクトルに埋もれてしまうことがある。(ドリフト+窓関数の影響?)<<BR>>
十分なfftlengthをとればいいのだが、平均回数を稼ぎたいときや短時間のみを見たい場合にはそうもいかない。<<BR>>
そんなときは先に適当な[[https://gwpy.github.io/docs/stable/api/gwpy.timeseries.TimeSeries.html#gwpy.timeseries.TimeSeries.highpass|highpass]]フィルターをかけることで、下図右のように回避できる。<<BR>>
{{attachment:wo_hp.png}}
{{attachment:w_hp.png}}

numpy, scipyなどのメモ

工事中


TimeSeriesなどの計算小技・注意事項

四則演算、指数

gwpyのTimeSeriesFrequencySeriesは、 四則演算や指数の演算がそのまま使える。 横軸の配列(timesやfrequencies)が同一なら、TimeSeries同士の演算も可能。

   1 t = np.linspace(start=-10, stop=10, num=201)
   2 A = TimeSeries(np.sin(t), t0=1261872018)                                                                                                                                 
   3 plot = Plot(A, A+1, 2*A, A**2)
   4 ax = plot.gca().legend(['A', 'A+1', '2*A', 'A**2'], fontsize=18)
   5 plot.show()

sample_calic.png

FFT length の注意

TimeSeriesからスペクトルを計算する際、fftlengthの値が小さいと下図左のように謎の冪スペクトルに埋もれてしまうことがある。(ドリフト+窓関数の影響?)
十分なfftlengthをとればいいのだが、平均回数を稼ぎたいときや短時間のみを見たい場合にはそうもいかない。
そんなときは先に適当なhighpassフィルターをかけることで、下図右のように回避できる。
wo_hp.png w_hp.png

KAGRA/Subgroups/PEM/PythonMemoJP/calculation (last edited 2021-07-29 15:34:38 by tatsuki.washimi)