astro-metadata-translator 29.0.1__py3-none-any.whl → 29.2025.1700__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- astro_metadata_translator/observationInfo.py +2 -0
- astro_metadata_translator/properties.py +15 -1
- astro_metadata_translator/translator.py +28 -0
- astro_metadata_translator/translators/decam.py +1 -0
- astro_metadata_translator/translators/helpers.py +26 -8
- astro_metadata_translator/translators/megaprime.py +1 -0
- astro_metadata_translator/version.py +1 -1
- {astro_metadata_translator-29.0.1.dist-info → astro_metadata_translator-29.2025.1700.dist-info}/METADATA +1 -1
- {astro_metadata_translator-29.0.1.dist-info → astro_metadata_translator-29.2025.1700.dist-info}/RECORD +14 -14
- {astro_metadata_translator-29.0.1.dist-info → astro_metadata_translator-29.2025.1700.dist-info}/WHEEL +1 -1
- {astro_metadata_translator-29.0.1.dist-info → astro_metadata_translator-29.2025.1700.dist-info}/entry_points.txt +0 -0
- {astro_metadata_translator-29.0.1.dist-info → astro_metadata_translator-29.2025.1700.dist-info}/licenses/LICENSE +0 -0
- {astro_metadata_translator-29.0.1.dist-info → astro_metadata_translator-29.2025.1700.dist-info}/top_level.txt +0 -0
- {astro_metadata_translator-29.0.1.dist-info → astro_metadata_translator-29.2025.1700.dist-info}/zip-safe +0 -0
|
@@ -115,6 +115,7 @@ class ObservationInfo:
|
|
|
115
115
|
datetime_end: astropy.time.Time
|
|
116
116
|
exposure_group: str
|
|
117
117
|
exposure_time: astropy.units.Quantity
|
|
118
|
+
exposure_time_requested: astropy.units.Quantity
|
|
118
119
|
dark_time: astropy.units.Quantity
|
|
119
120
|
boresight_airmass: float
|
|
120
121
|
boresight_rotation_angle: astropy.units.Quantity
|
|
@@ -131,6 +132,7 @@ class ObservationInfo:
|
|
|
131
132
|
relative_humidity: float
|
|
132
133
|
tracking_radec: astropy.coordinates.SkyCoord
|
|
133
134
|
altaz_begin: astropy.coordinates.AltAz
|
|
135
|
+
altaz_end: astropy.coordinates.AltAz | None
|
|
134
136
|
science_program: str
|
|
135
137
|
observation_counter: int
|
|
136
138
|
observation_reason: str
|
|
@@ -460,7 +460,14 @@ may not be.""",
|
|
|
460
460
|
simple_to_datetime,
|
|
461
461
|
),
|
|
462
462
|
"exposure_time": PropertyDefinition(
|
|
463
|
-
"
|
|
463
|
+
"Actual duration of the exposure (seconds).",
|
|
464
|
+
"astropy.units.Quantity",
|
|
465
|
+
astropy.units.Quantity,
|
|
466
|
+
exptime_to_simple,
|
|
467
|
+
simple_to_exptime,
|
|
468
|
+
),
|
|
469
|
+
"exposure_time_requested": PropertyDefinition(
|
|
470
|
+
"Requested duration of the exposure (seconds).",
|
|
464
471
|
"astropy.units.Quantity",
|
|
465
472
|
astropy.units.Quantity,
|
|
466
473
|
exptime_to_simple,
|
|
@@ -550,6 +557,13 @@ may not be.""",
|
|
|
550
557
|
altaz_to_simple,
|
|
551
558
|
simple_to_altaz,
|
|
552
559
|
),
|
|
560
|
+
"altaz_end": PropertyDefinition(
|
|
561
|
+
"Telescope boresight azimuth and elevation at end of observation.",
|
|
562
|
+
"astropy.coordinates.AltAz",
|
|
563
|
+
astropy.coordinates.AltAz,
|
|
564
|
+
altaz_to_simple,
|
|
565
|
+
simple_to_altaz,
|
|
566
|
+
),
|
|
553
567
|
"science_program": PropertyDefinition("Observing program (survey or proposal) identifier.", "str", str),
|
|
554
568
|
"observation_type": PropertyDefinition(
|
|
555
569
|
"Type of observation (currently: science, dark, flat, bias, focus).",
|
|
@@ -1042,6 +1042,34 @@ class MetadataTranslator:
|
|
|
1042
1042
|
return "science"
|
|
1043
1043
|
return "unknown"
|
|
1044
1044
|
|
|
1045
|
+
@cache_translation
|
|
1046
|
+
def to_exposure_time_requested(self) -> astropy.units.Quantity:
|
|
1047
|
+
"""Return the requested exposure time in seconds.
|
|
1048
|
+
|
|
1049
|
+
Base class implementations returns the same value as ``exposure_time``.
|
|
1050
|
+
This information may not be available for all instruments.
|
|
1051
|
+
|
|
1052
|
+
Returns
|
|
1053
|
+
-------
|
|
1054
|
+
exptime : `astropy.units.Quantity`
|
|
1055
|
+
The recorded exposure time in seconds.
|
|
1056
|
+
"""
|
|
1057
|
+
return self.to_exposure_time()
|
|
1058
|
+
|
|
1059
|
+
@cache_translation
|
|
1060
|
+
def to_altaz_end(self) -> astropy.coordinates.AltAz | None:
|
|
1061
|
+
"""Return the AltAz for the end of the observation.
|
|
1062
|
+
|
|
1063
|
+
Base class implementation returns `None`. Subclasses should override
|
|
1064
|
+
if the value is known.
|
|
1065
|
+
|
|
1066
|
+
Returns
|
|
1067
|
+
-------
|
|
1068
|
+
altaz : `astropy.coordinates.AltAz` or `None`
|
|
1069
|
+
The AltAz for the end of the observation.
|
|
1070
|
+
"""
|
|
1071
|
+
return None
|
|
1072
|
+
|
|
1045
1073
|
@classmethod
|
|
1046
1074
|
def observing_date_to_offset(cls, observing_date: astropy.time.Time) -> astropy.time.TimeDelta | None:
|
|
1047
1075
|
"""Calculate the observing day offset to apply for a given observation.
|
|
@@ -61,6 +61,7 @@ class DecamTranslator(FitsTranslator):
|
|
|
61
61
|
|
|
62
62
|
_trivial_map: dict[str, str | list[str] | tuple[Any, ...]] = {
|
|
63
63
|
"exposure_time": ("EXPTIME", {"unit": u.s}),
|
|
64
|
+
"exposure_time_requested": ("EXPREQ", {"unit": u.s}),
|
|
64
65
|
"dark_time": ("DARKTIME", {"unit": u.s}),
|
|
65
66
|
"boresight_airmass": ("AIRMASS", {"checker": is_non_science}),
|
|
66
67
|
"observation_id": "OBSID",
|
|
@@ -149,12 +149,16 @@ def altaz_from_degree_headers(
|
|
|
149
149
|
altazpairs: tuple[tuple[str, str], ...],
|
|
150
150
|
obstime: astropy.time.Time,
|
|
151
151
|
is_zd: set[str] | None = None,
|
|
152
|
+
max_alt: float = 90.0,
|
|
153
|
+
min_alt: float = 0.0,
|
|
152
154
|
) -> AltAz:
|
|
153
155
|
"""Calculate the altitude/azimuth coordinates from lists of headers.
|
|
154
156
|
|
|
155
|
-
If the altitude is found but is greater than
|
|
156
|
-
fixed at
|
|
157
|
-
If the altitude
|
|
157
|
+
If the altitude is found but is greater than the maximum allowed value,
|
|
158
|
+
it will be returned fixed at that maximum value.
|
|
159
|
+
If the altitude is found but is less than the minimum allowed value, it
|
|
160
|
+
will be returned clipped to that minimum value.
|
|
161
|
+
If the azimuth is less than -360.0 and this is not a science
|
|
158
162
|
observation, `None` will be returned.
|
|
159
163
|
|
|
160
164
|
Parameters
|
|
@@ -167,6 +171,15 @@ def altaz_from_degree_headers(
|
|
|
167
171
|
is_zd : `set`, optional
|
|
168
172
|
Contains keywords that correspond to zenith distances rather than
|
|
169
173
|
altitude.
|
|
174
|
+
max_alt : `float`, optional
|
|
175
|
+
Maximum allowed altitude in degrees. Will be clamped to this value if
|
|
176
|
+
out of range. This value will be forced to +90 if it exceeds +90
|
|
177
|
+
since `astropy.coordinates.AltAz` does not allow a value larger than
|
|
178
|
+
this even if that is caused by a telescope that can lean back at
|
|
179
|
+
Zenith.
|
|
180
|
+
min_alt : `float`, optional
|
|
181
|
+
Minimum allowed altitude in degrees. Will be clamped to this value if
|
|
182
|
+
out of range.
|
|
170
183
|
|
|
171
184
|
Returns
|
|
172
185
|
-------
|
|
@@ -181,6 +194,8 @@ def altaz_from_degree_headers(
|
|
|
181
194
|
No AltAz keywords were found and this observation is a science
|
|
182
195
|
observation.
|
|
183
196
|
"""
|
|
197
|
+
if max_alt > 90.0:
|
|
198
|
+
max_alt = 90.0
|
|
184
199
|
for alt_key, az_key in altazpairs:
|
|
185
200
|
if self.are_keys_ok([az_key, alt_key]):
|
|
186
201
|
az = self._header[az_key]
|
|
@@ -190,13 +205,16 @@ def altaz_from_degree_headers(
|
|
|
190
205
|
if is_zd and alt_key in is_zd:
|
|
191
206
|
alt = altitude_from_zenith_distance(alt * u.deg).value
|
|
192
207
|
|
|
193
|
-
if az < -360.0 or alt <
|
|
208
|
+
if az < -360.0 or alt < -90.0:
|
|
194
209
|
# Break out of loop since we have found values but
|
|
195
|
-
# they are
|
|
210
|
+
# they are not believable
|
|
196
211
|
break
|
|
197
|
-
if alt >
|
|
198
|
-
log.
|
|
199
|
-
alt =
|
|
212
|
+
if alt > max_alt:
|
|
213
|
+
log.info("%s: Clipping altitude (%f) at %f degrees", self._log_prefix, alt, max_alt)
|
|
214
|
+
alt = max_alt
|
|
215
|
+
elif alt < min_alt:
|
|
216
|
+
log.info("%s: Clipping altitude (%f) at %f degrees", self._log_prefix, alt, min_alt)
|
|
217
|
+
alt = min_alt
|
|
200
218
|
|
|
201
219
|
altaz = AltAz(az * u.deg, alt * u.deg, obstime=obstime, location=self.to_location())
|
|
202
220
|
self._used_these_cards(az_key, alt_key)
|
|
@@ -64,6 +64,7 @@ class MegaPrimeTranslator(FitsTranslator):
|
|
|
64
64
|
"physical_filter": "FILTER",
|
|
65
65
|
"dark_time": ("DARKTIME", {"unit": u.s}),
|
|
66
66
|
"exposure_time": ("EXPTIME", {"unit": u.s}),
|
|
67
|
+
"exposure_time_requested": ("EXPREQ", {"unit": u.s}),
|
|
67
68
|
"observation_id": "OBSID",
|
|
68
69
|
"object": "OBJECT",
|
|
69
70
|
"science_program": "RUNID",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
__all__ = ["__version__"]
|
|
2
|
-
__version__ = "29.
|
|
2
|
+
__version__ = "29.2025.1700"
|
|
@@ -3,12 +3,12 @@ astro_metadata_translator/file_helpers.py,sha256=Y8jovSkAjjHIUMbY4gtiEdEZZ8KzHFC
|
|
|
3
3
|
astro_metadata_translator/headers.py,sha256=21KWaPnBPDkonh5coZ0NolMdtM6KVozqi1Fd2d1z80M,18944
|
|
4
4
|
astro_metadata_translator/indexing.py,sha256=GxQNDJ_-YVqNBAbaUFku6MrzgKrcS7yTLUO498b3rCM,14530
|
|
5
5
|
astro_metadata_translator/observationGroup.py,sha256=XRP8xpHQXx4hSl_SrBBan_q1gmxpu2VuepjLZEWthsQ,8689
|
|
6
|
-
astro_metadata_translator/observationInfo.py,sha256=
|
|
7
|
-
astro_metadata_translator/properties.py,sha256=
|
|
6
|
+
astro_metadata_translator/observationInfo.py,sha256=mlxtrOlJB7qjMZzxVo2-8CjC-KFCexZsBkI_9VtXakI,27543
|
|
7
|
+
astro_metadata_translator/properties.py,sha256=oiatCGP6g7O0sm5dku50dUyMJtu8IORFLXRu4Sx1hCo,18787
|
|
8
8
|
astro_metadata_translator/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
astro_metadata_translator/tests.py,sha256=S73nreZm3pCfRlU8sKHbXfEoEkZ2zSY5pbHs9hDYBAM,13251
|
|
10
|
-
astro_metadata_translator/translator.py,sha256=
|
|
11
|
-
astro_metadata_translator/version.py,sha256=
|
|
10
|
+
astro_metadata_translator/translator.py,sha256=5dA5Dsj57PxTMtdE-t1jixWHLPkW1BNsdUJhiYfsbNc,56602
|
|
11
|
+
astro_metadata_translator/version.py,sha256=k6PcnewHb2vETZCsCS6q8mJ_uyMg-otfwuQ8B0oDDwQ,55
|
|
12
12
|
astro_metadata_translator/bin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
13
|
astro_metadata_translator/bin/translate.py,sha256=uf69YI58nxVI4i-p5nPxPsQWdHlk-QY_WmMBkeeKQB0,11018
|
|
14
14
|
astro_metadata_translator/bin/writeindex.py,sha256=pGdN0Z8WNQKGIFCJz_YHd384nAxVsBKK6JQ1lWQbTN8,4220
|
|
@@ -50,18 +50,18 @@ astro_metadata_translator/corrections/SuprimeCam/README.md,sha256=UaaDRv8T5ik-iY
|
|
|
50
50
|
astro_metadata_translator/serialize/__init__.py,sha256=pthEgasrT3Qw4e7nZk_X1rPBjDju5AsdHDnxqoOoAsU,427
|
|
51
51
|
astro_metadata_translator/serialize/fits.py,sha256=mjBYhL_wy_-aGgmswxMn1bIgq0U764uv02ge_1_5iRg,3811
|
|
52
52
|
astro_metadata_translator/translators/__init__.py,sha256=RHzTw7pnp5o5wyZPWg__udthT6qFQMZAJBsicxkRVZY,560
|
|
53
|
-
astro_metadata_translator/translators/decam.py,sha256=
|
|
53
|
+
astro_metadata_translator/translators/decam.py,sha256=R0M_p5EpPVvpeEQk0nSJdd34UJiIUvqBrlbsC_NQbOc,18286
|
|
54
54
|
astro_metadata_translator/translators/fits.py,sha256=h4tIB2XIg_oV-m5kVe6ny1gJIKMcDsEBO-SvC_NWinM,7030
|
|
55
|
-
astro_metadata_translator/translators/helpers.py,sha256=
|
|
55
|
+
astro_metadata_translator/translators/helpers.py,sha256=SrfI1qo-jLZfsCO60AU9Mft8ecPx8VAq35ap7gv2we0,7478
|
|
56
56
|
astro_metadata_translator/translators/hsc.py,sha256=Ca7zKICl04HrKQG51_bWyxAio7Oiibuuw39fcvtG6wI,8529
|
|
57
|
-
astro_metadata_translator/translators/megaprime.py,sha256=
|
|
57
|
+
astro_metadata_translator/translators/megaprime.py,sha256=n46ZkE95XuybU5JOKhBTE1VIiS-aNwxjuaJxjrz_BH0,10882
|
|
58
58
|
astro_metadata_translator/translators/sdss.py,sha256=prUTawPqAXzJ5i2p2yXH3ekLuj3rWGy-YjJMquJPMq0,9445
|
|
59
59
|
astro_metadata_translator/translators/subaru.py,sha256=-CTzxc2MpgEEpma-toD6B8RcvV-t5MNZq_fb4UGbHQU,2143
|
|
60
60
|
astro_metadata_translator/translators/suprimecam.py,sha256=b3S54aHvZ2SprvXRdOLCIJToj6KAiqjK-JB5My8xLWM,8409
|
|
61
|
-
astro_metadata_translator-29.
|
|
62
|
-
astro_metadata_translator-29.
|
|
63
|
-
astro_metadata_translator-29.
|
|
64
|
-
astro_metadata_translator-29.
|
|
65
|
-
astro_metadata_translator-29.
|
|
66
|
-
astro_metadata_translator-29.
|
|
67
|
-
astro_metadata_translator-29.
|
|
61
|
+
astro_metadata_translator-29.2025.1700.dist-info/licenses/LICENSE,sha256=6DRIob1hPfPI0HmYxqGJXcJr7Vc81mXQJHtjH29gygw,1518
|
|
62
|
+
astro_metadata_translator-29.2025.1700.dist-info/METADATA,sha256=Kwd_bX9v9nKkYCBHrwqMbdif1oRUMA-Lh9qylSTgJFE,1901
|
|
63
|
+
astro_metadata_translator-29.2025.1700.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
|
|
64
|
+
astro_metadata_translator-29.2025.1700.dist-info/entry_points.txt,sha256=9dwf9VZWuNtomGwNBEc0S9HJ740wnPSVEO8yNEPto6Y,83
|
|
65
|
+
astro_metadata_translator-29.2025.1700.dist-info/top_level.txt,sha256=ll138q-If3_TxKr2nTm5F3MEhWqvHbF3ptEDOhvgfRU,26
|
|
66
|
+
astro_metadata_translator-29.2025.1700.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
67
|
+
astro_metadata_translator-29.2025.1700.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|