sgnligo.sources.gwdata_noise_source
¶
A source element to generate realistic noise inspired by modern GW detectors.
This module provides the GWDataNoiseSource class which generates colored noise with spectral characteristics inspired by Advanced LIGO and Virgo detectors. The noise is generated using FIR filtering of white noise to achieve realistic power spectral density characteristics for testing and simulation.
GWDataNoiseSource
dataclass
¶
Bases: TSSource
flowchart TD
sgnligo.sources.gwdata_noise_source.GWDataNoiseSource[GWDataNoiseSource]
click sgnligo.sources.gwdata_noise_source.GWDataNoiseSource href "" "sgnligo.sources.gwdata_noise_source.GWDataNoiseSource"
Source element to generate realistic noise inspired by modern GW detectors.
This source generates noise with spectral characteristics inspired by Advanced LIGO and Virgo detectors. The noise is colored using realistic power spectral density curves suitable for testing and simulation purposes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel_dict
|
Optional[dict]
|
dict or None. If None use {"H1":"H1:FAKE-STRAIN", "L1":"L1:FAKE-STRAIN"} |
None
|
t0
|
float or None, start GPS time. If None and real_time is True, uses current GPS time and syncs with actual wall time. If None and real_time is False, uses current GPS time. |
required | |
end
|
float or None, end GPS time. If None, run indefinitely. Can be None only when real_time is True. |
required | |
duration
|
float or None, duration GPS time. Cannot be combined with end. Use one or the other. |
required | |
real_time
|
bool
|
bool, if True, generate data in real time. When t0 is provided, real-time mode ensures that one second of wall time passes for each second of generated data. When t0 is None, real-time mode syncs with actual GPS time. |
False
|
verbose
|
bool
|
bool, if True, print additional information. |
False
|
Source code in sgnligo/sources/gwdata_noise_source.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | |
__post_init__()
¶
Initialize the source after creation.
This sets up the PSD, filter coefficients, and initial state for noise generation. When real_time is True, allows t0 and end to be None for continuous real-time operation synced with actual GPS time.
Source code in sgnligo/sources/gwdata_noise_source.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | |
internal()
¶
Internal processing, handles real-time timing if enabled.
Source code in sgnligo/sources/gwdata_noise_source.py
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | |
new(pad)
¶
Generate a new frame with colored noise matching LIGO PSD.
This method is called by the base class's prepare_frame method, which manages the timing and buffer creation for us.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pad
|
SourcePad
|
Source pad requesting new data |
required |
Returns:
| Type | Description |
|---|---|
TSFrame
|
TSFrame containing realistic LIGO noise |
Source code in sgnligo/sources/gwdata_noise_source.py
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | |
parse_psd(channel_dict)
¶
Parse the PSDs for the given channels.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel_dict
|
Dictionary mapping detector names to channel names |
required |
Returns:
| Type | Description |
|---|---|
|
Dictionary containing PSD information for each detector |
Source code in sgnligo/sources/gwdata_noise_source.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |