frame
Read timeseries data from gravitational wave frame files.
CacheEntry
dataclass
¶
CacheEntry(observatory, description, gps_start, duration, path)
Simple cache entry parser for frame cache files.
Cache file format: observatory description gps_start duration path Example: L L1_GWOSC_16KHZ_R1 1240215487 32 ./path/to/file.gwf
from_line
classmethod
¶
from_line(line)
Parse a cache file line into a CacheEntry.
Source code in src/sgn_gwframe/sources/frame.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |
FrameSource
dataclass
¶
FrameSource(*, channels, frames, instrument=None)
Bases: TSSource
Read timeseries data from gravitational wave frame files
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channels
|
list[str]
|
list[str], a list of channel names of the data, e.g., ["L1:GWOSC-16KHZ_R1_STRAIN", "L1:GWOSC-16KHZ_R1_DQMASK"]. Source pads will be automatically generated for each channel, with channel name as pad name. |
required |
frames
|
str | list[str]
|
str | list[str], one of: - Path to a .cache file containing frame file locations - Path to a single .gwf frame file - List of paths to .gwf frame files |
required |
instrument
|
Optional[str]
|
str, optional, only read gwf files from this instrument (e.g., "H1", "L1"). Default: None |
None
|
internal ¶
internal()
Check if we need to read the next gw frame file in the cache. All channels are read at once.
Source code in src/sgn_gwframe/sources/frame.py
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 | |
load_gwf_data ¶
load_gwf_data(frame_file)
Load timeseries data from a gwf frame file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frame_file
|
CacheEntry
|
CacheEntry, the gwf frame file to read timeseries data from |
required |
Returns:
| Type | Description |
|---|---|
None
|
dict[str, np.ndarray], a dictionary with channel names as keys and |
None
|
numpy arrays of timeseries data as values |
Source code in src/sgn_gwframe/sources/frame.py
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | |
new ¶
new(pad)
New frames are created on "pad" with an instance specific count and a name derived from the channel name. "EOS" is set once we have procssed all data in the cache within the analysis segment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pad
|
SourcePad
|
SourcePad, the pad for which to produce a new TSFrame |
required |
Returns:
| Type | Description |
|---|---|
TSFrame
|
TSFrame, the TSFrame that carries a list of SeriesBuffers |
Source code in src/sgn_gwframe/sources/frame.py
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 | |