sdss-almanac 0.3__py3-none-any.whl → 0.3.1__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.
- almanac/__init__.py +1 -1
- almanac/cli.py +21 -9
- {sdss_almanac-0.3.dist-info → sdss_almanac-0.3.1.dist-info}/METADATA +1 -1
- {sdss_almanac-0.3.dist-info → sdss_almanac-0.3.1.dist-info}/RECORD +8 -8
- {sdss_almanac-0.3.dist-info → sdss_almanac-0.3.1.dist-info}/WHEEL +0 -0
- {sdss_almanac-0.3.dist-info → sdss_almanac-0.3.1.dist-info}/entry_points.txt +0 -0
- {sdss_almanac-0.3.dist-info → sdss_almanac-0.3.1.dist-info}/licenses/LICENSE.md +0 -0
- {sdss_almanac-0.3.dist-info → sdss_almanac-0.3.1.dist-info}/top_level.txt +0 -0
almanac/__init__.py
CHANGED
almanac/cli.py
CHANGED
@@ -217,7 +217,7 @@ def lookup(identifier, careful, **kwargs):
|
|
217
217
|
from almanac.apogee import get_exposures
|
218
218
|
from sdssdb.peewee.sdss5db.targetdb import (
|
219
219
|
Assignment, AssignmentStatus,CartonToTarget, Target, Hole, Observatory,
|
220
|
-
Design, DesignToField
|
220
|
+
Design, DesignToField, Field
|
221
221
|
)
|
222
222
|
from sdssdb.peewee.sdss5db.catalogdb import SDSS_ID_flat
|
223
223
|
|
@@ -258,40 +258,52 @@ def lookup(identifier, careful, **kwargs):
|
|
258
258
|
.select(
|
259
259
|
fn.Lower(Observatory.label),
|
260
260
|
AssignmentStatus.mjd,
|
261
|
+
Field.field_id,
|
261
262
|
)
|
263
|
+
.distinct()
|
262
264
|
.join(CartonToTarget)
|
263
265
|
.join(Assignment)
|
264
266
|
.join(AssignmentStatus)
|
265
267
|
.switch(Assignment)
|
266
268
|
.join(Hole)
|
267
269
|
.join(Observatory)
|
270
|
+
.switch(Assignment)
|
271
|
+
.join(Design)
|
272
|
+
.join(DesignToField)
|
273
|
+
.join(Field)
|
268
274
|
.where(
|
269
275
|
Target.catalogid.in_(tuple(catalogids))
|
270
276
|
& (AssignmentStatus.status == 1)
|
271
277
|
)
|
272
278
|
.tuples()
|
273
279
|
)
|
274
|
-
|
280
|
+
fields = {}
|
281
|
+
for obs, mjd, field_id in q:
|
282
|
+
mjd = int(mjd)
|
283
|
+
fields.setdefault((obs, mjd), set())
|
284
|
+
fields[(obs, mjd)].add(field_id)
|
275
285
|
|
276
286
|
console = Console()
|
277
287
|
|
278
288
|
title = f"SDSS ID {sdss_id}"
|
279
289
|
|
280
|
-
|
281
|
-
|
290
|
+
rich_table = RichTable(
|
291
|
+
title=f"{title}",
|
292
|
+
title_style="bold blue",
|
293
|
+
show_header=True,
|
294
|
+
header_style="bold cyan"
|
295
|
+
)
|
282
296
|
|
283
297
|
for field_name in ("#", "obs", "mjd", "exposure", "field", "fiber_id", "catalogid"):
|
284
298
|
rich_table.add_column(field_name, justify="center")
|
285
299
|
|
286
|
-
fields = {}
|
287
300
|
i = 1
|
288
301
|
with Live(rich_table, console=console, refresh_per_second=4) as live:
|
289
|
-
for exposure in chain(*starmap(get_exposures,
|
290
|
-
|
291
|
-
if
|
302
|
+
for exposure in chain(*starmap(get_exposures, fields.keys())):
|
303
|
+
field_ids = fields[(exposure.observatory, exposure.mjd)]
|
304
|
+
if exposure.field_id in field_ids:
|
292
305
|
for target in exposure.targets:
|
293
306
|
if target.catalogid in catalogids:
|
294
|
-
fields[key] = exposure.field_id
|
295
307
|
rich_table.add_row(*list(map(str, (
|
296
308
|
i,
|
297
309
|
exposure.observatory,
|
@@ -1,7 +1,7 @@
|
|
1
|
-
almanac/__init__.py,sha256=
|
1
|
+
almanac/__init__.py,sha256=nxyCJkPdw9Exgk2WWizLADkLFWCqT_I71kV6KSA_dRc,109
|
2
2
|
almanac/apogee.py,sha256=Q7juc7BJdnP56-4UZ4CSg6FCULr22KHinHly2d0KMt8,10390
|
3
3
|
almanac/catalog.py,sha256=tVwlLtVaUbSt1hoTpIPP2bMhgd4rpcUUP_zdr6uks2c,11633
|
4
|
-
almanac/cli.py,sha256=
|
4
|
+
almanac/cli.py,sha256=rntf3UgIRk-UK-DHu8qf1ZnJrQwUs3Xd3nnkO2cF8iw,30198
|
5
5
|
almanac/config.py,sha256=5oRO-mrtaCKIcqGxcrfeNHZIjHkULDRrI_Bv1CU5uxE,3259
|
6
6
|
almanac/database.py,sha256=6YeuRSFU5zfIen7zU-nI4pN_Z_fnYkglPcYxzVF4Xqo,758
|
7
7
|
almanac/display.py,sha256=IflM5Y3yOJEDkvyUYQe3bOFs1iEwoe3mUj8mbODsYDk,15388
|
@@ -20,9 +20,9 @@ almanac/etc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
20
|
almanac/etc/bad_exposures.csv,sha256=VQQoq6uXDhnnIyp6vw0cfeTaoyNqPi5dW0MwfKsDRCk,25394
|
21
21
|
almanac/stash/data_models.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
22
22
|
almanac/stash/plugmap_models.py,sha256=8yxw6ZXuLP1ZdFuT7wCW_Z5JSJll4uymiIWRb6WvSOk,8973
|
23
|
-
sdss_almanac-0.3.dist-info/licenses/LICENSE.md,sha256=_7dAUQQ5Ph_x1hcFXhi9aHBcqq9H11zco12eO4B3Cyg,1504
|
24
|
-
sdss_almanac-0.3.dist-info/METADATA,sha256=
|
25
|
-
sdss_almanac-0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
26
|
-
sdss_almanac-0.3.dist-info/entry_points.txt,sha256=5Obfm-uaVxE3RnRm2W7dYaX_O_j5ggGvAW5UQG5AtuE,45
|
27
|
-
sdss_almanac-0.3.dist-info/top_level.txt,sha256=sWBGH9a-2-nFB2-rGqioyigbkcz14t1u8rqAs_RYe_w,8
|
28
|
-
sdss_almanac-0.3.dist-info/RECORD,,
|
23
|
+
sdss_almanac-0.3.1.dist-info/licenses/LICENSE.md,sha256=_7dAUQQ5Ph_x1hcFXhi9aHBcqq9H11zco12eO4B3Cyg,1504
|
24
|
+
sdss_almanac-0.3.1.dist-info/METADATA,sha256=Utp6VykVy7C5cuGllPXDZOy9lM4puReK7Y4txy_HMC0,6994
|
25
|
+
sdss_almanac-0.3.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
26
|
+
sdss_almanac-0.3.1.dist-info/entry_points.txt,sha256=5Obfm-uaVxE3RnRm2W7dYaX_O_j5ggGvAW5UQG5AtuE,45
|
27
|
+
sdss_almanac-0.3.1.dist-info/top_level.txt,sha256=sWBGH9a-2-nFB2-rGqioyigbkcz14t1u8rqAs_RYe_w,8
|
28
|
+
sdss_almanac-0.3.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|