wintertoo 1.3.2__tar.gz → 1.5.0__tar.gz

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.

Files changed (38) hide show
  1. {wintertoo-1.3.2 → wintertoo-1.5.0}/PKG-INFO +1 -1
  2. {wintertoo-1.3.2 → wintertoo-1.5.0}/pyproject.toml +1 -1
  3. {wintertoo-1.3.2 → wintertoo-1.5.0}/tests/test_schedule.py +2 -0
  4. wintertoo-1.5.0/tests/testdata/test_schedule.json +1 -0
  5. {wintertoo-1.3.2 → wintertoo-1.5.0}/wintertoo/data/__init__.py +1 -1
  6. {wintertoo-1.3.2 → wintertoo-1.5.0}/wintertoo/data/observing_request_schema.json +2 -2
  7. {wintertoo-1.3.2 → wintertoo-1.5.0}/wintertoo/models/image.py +5 -3
  8. {wintertoo-1.3.2 → wintertoo-1.5.0}/wintertoo/models/too.py +28 -4
  9. {wintertoo-1.3.2 → wintertoo-1.5.0}/wintertoo/schedule.py +12 -4
  10. {wintertoo-1.3.2 → wintertoo-1.5.0}/wintertoo.egg-info/PKG-INFO +1 -1
  11. wintertoo-1.3.2/tests/testdata/test_schedule.json +0 -1
  12. {wintertoo-1.3.2 → wintertoo-1.5.0}/.github/dependabot.yml +0 -0
  13. {wintertoo-1.3.2 → wintertoo-1.5.0}/.github/workflows/automerge.yml +0 -0
  14. {wintertoo-1.3.2 → wintertoo-1.5.0}/.github/workflows/black.yml +0 -0
  15. {wintertoo-1.3.2 → wintertoo-1.5.0}/.github/workflows/continuous_integration.yml +0 -0
  16. {wintertoo-1.3.2 → wintertoo-1.5.0}/.github/workflows/isort.yml +0 -0
  17. {wintertoo-1.3.2 → wintertoo-1.5.0}/.github/workflows/pylint.yml +0 -0
  18. {wintertoo-1.3.2 → wintertoo-1.5.0}/.gitignore +0 -0
  19. {wintertoo-1.3.2 → wintertoo-1.5.0}/.pre-commit-config.yaml +0 -0
  20. {wintertoo-1.3.2 → wintertoo-1.5.0}/LICENSE +0 -0
  21. {wintertoo-1.3.2 → wintertoo-1.5.0}/README.md +0 -0
  22. {wintertoo-1.3.2 → wintertoo-1.5.0}/setup.cfg +0 -0
  23. {wintertoo-1.3.2 → wintertoo-1.5.0}/tests/test_fields.py +0 -0
  24. {wintertoo-1.3.2 → wintertoo-1.5.0}/wintertoo/__init__.py +0 -0
  25. {wintertoo-1.3.2 → wintertoo-1.5.0}/wintertoo/data/summer_fields.txt +0 -0
  26. {wintertoo-1.3.2 → wintertoo-1.5.0}/wintertoo/data/winter_fields.txt +0 -0
  27. {wintertoo-1.3.2 → wintertoo-1.5.0}/wintertoo/database.py +0 -0
  28. {wintertoo-1.3.2 → wintertoo-1.5.0}/wintertoo/errors.py +0 -0
  29. {wintertoo-1.3.2 → wintertoo-1.5.0}/wintertoo/fields.py +0 -0
  30. {wintertoo-1.3.2 → wintertoo-1.5.0}/wintertoo/models/__init__.py +0 -0
  31. {wintertoo-1.3.2 → wintertoo-1.5.0}/wintertoo/models/program.py +0 -0
  32. {wintertoo-1.3.2 → wintertoo-1.5.0}/wintertoo/submit.py +0 -0
  33. {wintertoo-1.3.2 → wintertoo-1.5.0}/wintertoo/utils.py +0 -0
  34. {wintertoo-1.3.2 → wintertoo-1.5.0}/wintertoo/validate.py +0 -0
  35. {wintertoo-1.3.2 → wintertoo-1.5.0}/wintertoo.egg-info/SOURCES.txt +0 -0
  36. {wintertoo-1.3.2 → wintertoo-1.5.0}/wintertoo.egg-info/dependency_links.txt +0 -0
  37. {wintertoo-1.3.2 → wintertoo-1.5.0}/wintertoo.egg-info/requires.txt +0 -0
  38. {wintertoo-1.3.2 → wintertoo-1.5.0}/wintertoo.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wintertoo
3
- Version: 1.3.2
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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "wintertoo"
7
- version = "1.3.2"
7
+ version = "1.5.0"
8
8
  description = ""
9
9
  authors = [
10
10
  {name = "Robert Stein", email = "rdstein@caltech.edu"},
@@ -79,6 +79,8 @@ class TestSchedule(unittest.TestCase):
79
79
  too=SummerRaDecToO(
80
80
  ra_deg=173.7056754,
81
81
  dec_deg=11.253441,
82
+ total_exposure_time=100.0,
83
+ n_dither=1,
82
84
  ),
83
85
  program=program,
84
86
  )
@@ -0,0 +1 @@
1
+ {"targName":{"0":null,"1":null,"2":null,"3":null},"raDeg":{"0":173.7056754,"1":173.7056754,"2":173.7056754,"3":173.7056754},"decDeg":{"0":11.253441,"1":11.253441,"2":11.253441,"3":11.253441},"fieldID":{"0":999999999,"1":999999999,"2":999999999,"3":999999999},"filter":{"0":"u","1":"g","2":"r","3":"i"},"visitExpTime":{"0":960.0,"1":960.0,"2":960.0,"3":960.0},"singleExpTime":{"0":120.0,"1":120.0,"2":120.0,"3":120.0},"priority":{"0":50.0,"1":50.0,"2":50.0,"3":50.0},"progPI":{"0":"Stein","1":"Stein","2":"Stein","3":"Stein"},"progName":{"0":"2021A000","1":"2021A000","2":"2021A000","3":"2021A000"},"progID":{"0":1,"1":1,"2":1,"3":1},"validStart":{"0":62721.1894969287,"1":62721.1894969287,"2":62721.1894969287,"3":62721.1894969287},"validStop":{"0":62722.1894969452,"1":62722.1894969452,"2":62722.1894969452,"3":62722.1894969452},"observed":{"0":false,"1":false,"2":false,"3":false},"maxAirmass":{"0":2.0,"1":2.0,"2":2.0,"3":2.0},"ditherNumber":{"0":8,"1":8,"2":8,"3":8},"ditherStepSize":{"0":30.0,"1":30.0,"2":30.0,"3":30.0},"bestDetector":{"0":true,"1":true,"2":true,"3":true},"obsHistID":{"0":0,"1":1,"2":2,"3":3}}
@@ -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": 30.0},
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": 1},
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},
@@ -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
- kind: WinterImageTypes = Field(
43
- default=DEFAULT_IMAGE_TYPE, example="raw/science/diff"
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")
@@ -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 BaseModel, ConfigDict, Field, model_validator
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
- t_exp: float = Field(
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.t_exp
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:
@@ -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.n_exp):
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.t_exp,
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(field_id=field_id, **too.model_dump())
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(ra_deg=ra_deg, dec_deg=dec_deg, **too.model_dump())
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.2
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
@@ -1 +0,0 @@
1
- {"targName":{"0":null,"1":null,"2":null,"3":null},"raDeg":{"0":173.7056754,"1":173.7056754,"2":173.7056754,"3":173.7056754},"decDeg":{"0":11.253441,"1":11.253441,"2":11.253441,"3":11.253441},"fieldID":{"0":999999999,"1":999999999,"2":999999999,"3":999999999},"filter":{"0":"u","1":"g","2":"r","3":"i"},"visitExpTime":{"0":30.0,"1":30.0,"2":30.0,"3":30.0},"priority":{"0":50.0,"1":50.0,"2":50.0,"3":50.0},"progPI":{"0":"Stein","1":"Stein","2":"Stein","3":"Stein"},"progName":{"0":"2021A000","1":"2021A000","2":"2021A000","3":"2021A000"},"progID":{"0":1,"1":1,"2":1,"3":1},"validStart":{"0":62721.1894969287,"1":62721.1894969287,"2":62721.1894969287,"3":62721.1894969287},"validStop":{"0":62722.1894969452,"1":62722.1894969452,"2":62722.1894969452,"3":62722.1894969452},"observed":{"0":false,"1":false,"2":false,"3":false},"maxAirmass":{"0":2.0,"1":2.0,"2":2.0,"3":2.0},"ditherNumber":{"0":1,"1":1,"2":1,"3":1},"ditherStepSize":{"0":30.0,"1":30.0,"2":30.0,"3":30.0},"bestDetector":{"0":true,"1":true,"2":true,"3":true},"obsHistID":{"0":0,"1":1,"2":2,"3":3}}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes