Utilities¶
Helper functions for time, coordinates, and file parsing.
Coordinates¶
altaz_to_radec ¶
altaz_to_radec(
azimuth: NDArray[float64],
altitude: NDArray[float64],
times: NDArray[object_],
facility: Facility,
) -> tuple[NDArray[float64], NDArray[float64]]
Convert horizontal (Az/El) coordinates to equatorial (RA/Dec).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
azimuth
|
NDArray[float64]
|
Azimuth angles in degrees. |
required |
altitude
|
NDArray[float64]
|
Elevation angles in degrees. |
required |
times
|
NDArray[object_]
|
Array of UTC datetime objects. |
required |
facility
|
Facility
|
Observer facility (provides location). |
required |
Returns:
| Type | Description |
|---|---|
tuple[NDArray[float64], NDArray[float64]]
|
Tuple of (ra_degrees, dec_degrees) as numpy arrays. |
Source code in src/sopp/utils/coordinates.py
Time¶
generate_time_grid ¶
Generate a uniformly spaced array of datetime objects.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start
|
datetime
|
Start time (UTC). |
required |
end
|
datetime
|
End time (UTC). |
required |
resolution_seconds
|
float
|
Time step in seconds. |
1.0
|
Returns:
| Type | Description |
|---|---|
ndarray
|
1D numpy array of datetime objects from start to end (inclusive). |
Source code in src/sopp/utils/time.py
Helpers¶
parse_time_and_convert_to_utc ¶
Accept either a string or datetime and return UTC datetime.