wintertoo 1.3.2__py3-none-any.whl → 1.5.0__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.
Potentially problematic release.
This version of wintertoo might be problematic. Click here for more details.
- wintertoo/data/__init__.py +1 -1
- wintertoo/data/observing_request_schema.json +2 -2
- wintertoo/models/image.py +5 -3
- wintertoo/models/too.py +28 -4
- wintertoo/schedule.py +12 -4
- {wintertoo-1.3.2.dist-info → wintertoo-1.5.0.dist-info}/METADATA +1 -1
- {wintertoo-1.3.2.dist-info → wintertoo-1.5.0.dist-info}/RECORD +10 -10
- {wintertoo-1.3.2.dist-info → wintertoo-1.5.0.dist-info}/LICENSE +0 -0
- {wintertoo-1.3.2.dist-info → wintertoo-1.5.0.dist-info}/WHEEL +0 -0
- {wintertoo-1.3.2.dist-info → wintertoo-1.5.0.dist-info}/top_level.txt +0 -0
wintertoo/data/__init__.py
CHANGED
|
@@ -32,7 +32,7 @@ WINTER_BASE_WIDTH = 1.0
|
|
|
32
32
|
|
|
33
33
|
MAX_TARGNAME_LEN = 30
|
|
34
34
|
|
|
35
|
-
WinterImageTypes = Literal["exposure", "raw", "science", "stack", "diff"]
|
|
35
|
+
WinterImageTypes = Literal["exposure", "raw", "science", "stack", "diff", "avro"]
|
|
36
36
|
DEFAULT_IMAGE_TYPE = "stack"
|
|
37
37
|
|
|
38
38
|
PROGRAM_DB_HOST = "jagati.caltech.edu"
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"raDeg": {"type": "number", "comment": "Degrees (decimal)"},
|
|
6
6
|
"decDeg": {"type": "number", "comment": "Degrees (decimal)"},
|
|
7
7
|
"filter": {"type": "string", "comment": "'u'/'g'/'r'/'i'/'Y'/'J'/'H'/'dark'"},
|
|
8
|
-
"visitExpTime": {"type": "number", "comment": "Total observation time (seconds)", "default":
|
|
8
|
+
"visitExpTime": {"type": "number", "comment": "Total observation time (seconds)", "default": 960.0},
|
|
9
9
|
"priority": {"type": "number", "comment": "Priority of observation"},
|
|
10
10
|
"progPI": {"type": "string", "comment": "PI of observation"},
|
|
11
11
|
"progID": {"type": "integer", "comment": "Between 0 and 4 (0-Calibration, 1-Survey, 2-MIT, 3-Caltech, 4-Engineering)"},
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"validStop": {"type": "number", "comment": "Format: MJD"},
|
|
15
15
|
"observed": {"anyOf": [{"type": "boolean", "default": false}, {"type" : "integer", "minimum" : 0, "maximum" : 1}]},
|
|
16
16
|
"maxAirmass": {"type": "number", "comment": "Maximum airmass for observation", "default": 2.0},
|
|
17
|
-
"ditherNumber": {"type": "integer", "default":
|
|
17
|
+
"ditherNumber": {"type": "integer", "default": 8},
|
|
18
18
|
"ditherStepSize": {"type": "number", "comment": "arcsec", "default": 30.0},
|
|
19
19
|
"fieldID": {"type": "integer", "default": 999999999},
|
|
20
20
|
"targName": {"type": ["string", "null"], "comment": "Target name e.g. GW170817", "default": null},
|
wintertoo/models/image.py
CHANGED
|
@@ -6,7 +6,7 @@ from typing import Optional
|
|
|
6
6
|
|
|
7
7
|
from astropy import units as u
|
|
8
8
|
from astropy.time import Time
|
|
9
|
-
from pydantic import BaseModel, Field, model_validator
|
|
9
|
+
from pydantic import AliasChoices, BaseModel, Field, model_validator
|
|
10
10
|
|
|
11
11
|
from wintertoo.data import DEFAULT_IMAGE_TYPE, MAX_TARGNAME_LEN, WinterImageTypes
|
|
12
12
|
from wintertoo.errors import WinterValidationError
|
|
@@ -39,8 +39,10 @@ class ProgramImageQuery(BaseModel):
|
|
|
39
39
|
default=get_date(Time.now()),
|
|
40
40
|
examples=[get_date(Time.now() - 30.0 * u.day), get_date(Time.now())],
|
|
41
41
|
)
|
|
42
|
-
|
|
43
|
-
default=DEFAULT_IMAGE_TYPE,
|
|
42
|
+
image_type: WinterImageTypes = Field(
|
|
43
|
+
default=DEFAULT_IMAGE_TYPE,
|
|
44
|
+
example="raw/science/diff",
|
|
45
|
+
validation_alias=AliasChoices("image_type", "kind"),
|
|
44
46
|
)
|
|
45
47
|
|
|
46
48
|
@model_validator(mode="after")
|
wintertoo/models/too.py
CHANGED
|
@@ -5,7 +5,14 @@ Models for ToO requests
|
|
|
5
5
|
from typing import List, Optional, Union
|
|
6
6
|
|
|
7
7
|
from astropy.time import Time
|
|
8
|
-
from pydantic import
|
|
8
|
+
from pydantic import (
|
|
9
|
+
AliasChoices,
|
|
10
|
+
BaseModel,
|
|
11
|
+
ConfigDict,
|
|
12
|
+
Field,
|
|
13
|
+
computed_field,
|
|
14
|
+
model_validator,
|
|
15
|
+
)
|
|
9
16
|
|
|
10
17
|
from wintertoo.data import (
|
|
11
18
|
MAX_TARGNAME_LEN,
|
|
@@ -39,15 +46,21 @@ class ToORequest(BaseModel):
|
|
|
39
46
|
examples=["SN2021abc", "ZTF19aapreis"],
|
|
40
47
|
default=get_default_value("targName"),
|
|
41
48
|
)
|
|
42
|
-
|
|
49
|
+
total_exposure_time: float = Field(
|
|
43
50
|
default=get_default_value("visitExpTime"),
|
|
44
51
|
title="Combined Exposure Time across dithers (s)",
|
|
45
52
|
ge=1.0,
|
|
53
|
+
validation_alias=AliasChoices("total_exposure_time", "t_exp"),
|
|
46
54
|
)
|
|
47
|
-
n_exp: int = Field(default=1, ge=1, title="Number of dither sets")
|
|
48
55
|
n_dither: int = Field(
|
|
49
56
|
default=get_default_value("ditherNumber"), ge=1, title="Number of dithers"
|
|
50
57
|
)
|
|
58
|
+
n_repetitions: int = Field(
|
|
59
|
+
default=1,
|
|
60
|
+
ge=1,
|
|
61
|
+
title="Number of repeated dither sets",
|
|
62
|
+
validation_alias=AliasChoices("n_repetitions", "n_exp"),
|
|
63
|
+
)
|
|
51
64
|
dither_distance: float = Field(
|
|
52
65
|
get_default_value("ditherStepSize"), ge=0.0, title="dither distance (arcsec)"
|
|
53
66
|
)
|
|
@@ -69,6 +82,17 @@ class ToORequest(BaseModel):
|
|
|
69
82
|
title="Place ra/dec at the center of the best detector",
|
|
70
83
|
)
|
|
71
84
|
|
|
85
|
+
@computed_field
|
|
86
|
+
@property
|
|
87
|
+
def single_exposure_time(self) -> float:
|
|
88
|
+
"""
|
|
89
|
+
Computed field to get the exposure time per dither.
|
|
90
|
+
Equivalent to total_exposure_time/n_dither
|
|
91
|
+
|
|
92
|
+
:return: Exposure time per dither
|
|
93
|
+
"""
|
|
94
|
+
return self.total_exposure_time / self.n_dither
|
|
95
|
+
|
|
72
96
|
@model_validator(mode="after")
|
|
73
97
|
def validate_end_time(self):
|
|
74
98
|
"""
|
|
@@ -93,7 +117,7 @@ class ToORequest(BaseModel):
|
|
|
93
117
|
:return: Validated total exposure time per dither set
|
|
94
118
|
"""
|
|
95
119
|
n_dithers = self.n_dither
|
|
96
|
-
t_exp = self.
|
|
120
|
+
t_exp = self.total_exposure_time
|
|
97
121
|
t_per_dither = t_exp / n_dithers
|
|
98
122
|
|
|
99
123
|
if t_per_dither > MAX_EXPOSURE_TIME:
|
wintertoo/schedule.py
CHANGED
|
@@ -43,14 +43,15 @@ def make_schedule(
|
|
|
43
43
|
|
|
44
44
|
for too in toos:
|
|
45
45
|
for filter_name in too.filters:
|
|
46
|
-
for _ in range(too.
|
|
46
|
+
for _ in range(too.n_repetitions):
|
|
47
47
|
new = {
|
|
48
48
|
"targName": too.target_name,
|
|
49
49
|
"raDeg": too.ra_deg,
|
|
50
50
|
"decDeg": too.dec_deg,
|
|
51
51
|
"fieldID": too.field_id,
|
|
52
52
|
"filter": filter_name,
|
|
53
|
-
"visitExpTime": too.
|
|
53
|
+
"visitExpTime": too.total_exposure_time,
|
|
54
|
+
"singleExpTime": too.single_exposure_time,
|
|
54
55
|
"priority": too.target_priority,
|
|
55
56
|
"progPI": program.pi_name,
|
|
56
57
|
"progName": program.progname,
|
|
@@ -121,7 +122,10 @@ def schedule_ra_dec(
|
|
|
121
122
|
else:
|
|
122
123
|
field_id = get_default_value("fieldID")
|
|
123
124
|
|
|
124
|
-
full_request = FullTooRequest(
|
|
125
|
+
full_request = FullTooRequest(
|
|
126
|
+
field_id=field_id,
|
|
127
|
+
**too.model_dump(exclude=set(too.model_computed_fields.keys())),
|
|
128
|
+
)
|
|
125
129
|
|
|
126
130
|
schedule = make_schedule(
|
|
127
131
|
toos=[full_request],
|
|
@@ -152,7 +156,11 @@ def schedule_field(
|
|
|
152
156
|
ra_deg = float(field_details["RA"].iloc[0])
|
|
153
157
|
dec_deg = float(field_details["Dec"].iloc[0])
|
|
154
158
|
|
|
155
|
-
full_request = FullTooRequest(
|
|
159
|
+
full_request = FullTooRequest(
|
|
160
|
+
ra_deg=ra_deg,
|
|
161
|
+
dec_deg=dec_deg,
|
|
162
|
+
**too.model_dump(exclude=set(too.model_computed_fields.keys())),
|
|
163
|
+
)
|
|
156
164
|
|
|
157
165
|
schedule = make_schedule(
|
|
158
166
|
toos=[full_request],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: wintertoo
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.5.0
|
|
4
4
|
Author-email: Robert Stein <rdstein@caltech.edu>, Danielle Frostig <frostig@mit.edu>, Viraj Karambelkar <viraj@astro.caltech.edu>
|
|
5
5
|
License: MIT
|
|
6
6
|
Project-URL: homepage, https://github.com/winter-telescope/wintertoo
|
|
@@ -2,20 +2,20 @@ wintertoo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
2
2
|
wintertoo/database.py,sha256=Ng8qsnDN3p4q-hXRgsHvElzr3k_8H14vq3-C2XChkr8,3020
|
|
3
3
|
wintertoo/errors.py,sha256=iAFcy0z3A3bCnkJmAt_P-77fPaPHFGS1JbrK6O2dCEM,223
|
|
4
4
|
wintertoo/fields.py,sha256=TDSOwJeR4UvfzKQCaIqoPLv0hSU_73TZwQcZ2FbnO8Q,6029
|
|
5
|
-
wintertoo/schedule.py,sha256=
|
|
5
|
+
wintertoo/schedule.py,sha256=0nqOh_Ih4Ce0UMVXIzU2SfhdibFfKciPqQhEiAG9iyU,5813
|
|
6
6
|
wintertoo/submit.py,sha256=kd6_aziOf5QcemsyyhSRSnbXlLj8OWsY1_Gj0ZXsUuo,3201
|
|
7
7
|
wintertoo/utils.py,sha256=BWgBZoSX5xfqURb2Nkvf3i6A_IcVYU2SoXFvp6ez7Xc,3306
|
|
8
8
|
wintertoo/validate.py,sha256=YpSABluVXxl33j_ht7TwfC-0SlN4IC0BnbbQiTwUk4c,10476
|
|
9
|
-
wintertoo/data/__init__.py,sha256=
|
|
10
|
-
wintertoo/data/observing_request_schema.json,sha256=
|
|
9
|
+
wintertoo/data/__init__.py,sha256=OPsHalwB9mTMBHp-W-iAbsP39hrgQ4myNt1Daxkwz2s,1602
|
|
10
|
+
wintertoo/data/observing_request_schema.json,sha256=00laKF0S5O6lolsUrimReR67gymCEJuH4z3u6PUFgFA,1733
|
|
11
11
|
wintertoo/data/summer_fields.txt,sha256=5Sc7MBUacelzaq1KHSLmfAyZ3WB5YifMNwKRjBRBcRk,52684603
|
|
12
12
|
wintertoo/data/winter_fields.txt,sha256=TxySQTmJXCCgaf-oC1gzOYQb2Vr26KEKdJxqrZHHet0,3529364
|
|
13
13
|
wintertoo/models/__init__.py,sha256=c2GEbIHvOT34IhpiMyqA7Tn83hEmnwx6Q7BuxURp97k,379
|
|
14
|
-
wintertoo/models/image.py,sha256=
|
|
14
|
+
wintertoo/models/image.py,sha256=KG07tysYHPiFcQplkC4aZ9NjoQLb8TNl2Cy5WFU2a5w,3926
|
|
15
15
|
wintertoo/models/program.py,sha256=mtewVnt7NxSK0hxX8aUO8qehEtOi_Cieli4voCCRh4I,1804
|
|
16
|
-
wintertoo/models/too.py,sha256=
|
|
17
|
-
wintertoo-1.
|
|
18
|
-
wintertoo-1.
|
|
19
|
-
wintertoo-1.
|
|
20
|
-
wintertoo-1.
|
|
21
|
-
wintertoo-1.
|
|
16
|
+
wintertoo/models/too.py,sha256=SXaAx_nkPyqYaUS7UChA86TkeKrIOqvxccrNXaXXvbo,6098
|
|
17
|
+
wintertoo-1.5.0.dist-info/LICENSE,sha256=1-4yY2S7St-8Koy4JGheNG9QPkwff7831u2JITQ2oQs,1063
|
|
18
|
+
wintertoo-1.5.0.dist-info/METADATA,sha256=rgU0vbaECPDD6ye9eVTVGCwPKSa9BGvBe1c4rcRCiKg,2498
|
|
19
|
+
wintertoo-1.5.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
20
|
+
wintertoo-1.5.0.dist-info/top_level.txt,sha256=6SMjMBzaNrD77erdCiVcRTrPZ-x98SDX43akRjWj4T8,10
|
|
21
|
+
wintertoo-1.5.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|