Coverage for src/sgn_gwframe/base.py: 100.0%

1"""Utility functions for gravitational wave frame I/O."""

2

3# Copyright (C) 2009-2013 Kipp Cannon, Chad Hanna, Drew Keppel

4# Copyright (C) 2024 Becca Ewing, Yun-Jing Huang

5

6 from __future__ import annotations

7

8 import os

9

10

11 def from_T050017(url): # noqa: N802

12 """

13 Parse a URL in the style of T050017-00.

14 """

15 filename, _ = os.path.splitext(os.path.basename(url))

16 obs, desc, start, dur = filename.split("-")

17 return obs, desc, int(start), int(dur)