wintertoo 1.6.2__tar.gz → 1.7.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.
- {wintertoo-1.6.2 → wintertoo-1.7.0}/PKG-INFO +1 -1
- {wintertoo-1.6.2 → wintertoo-1.7.0}/pyproject.toml +1 -1
- {wintertoo-1.6.2 → wintertoo-1.7.0}/tests/test_schedule.py +2 -0
- {wintertoo-1.6.2 → wintertoo-1.7.0}/wintertoo/data/__init__.py +1 -5
- {wintertoo-1.6.2 → wintertoo-1.7.0}/wintertoo/database.py +1 -1
- {wintertoo-1.6.2 → wintertoo-1.7.0}/wintertoo/models/too.py +20 -0
- {wintertoo-1.6.2 → wintertoo-1.7.0}/wintertoo/schedule.py +1 -1
- {wintertoo-1.6.2 → wintertoo-1.7.0}/wintertoo/submit.py +1 -1
- {wintertoo-1.6.2 → wintertoo-1.7.0}/wintertoo/utils.py +15 -23
- {wintertoo-1.6.2 → wintertoo-1.7.0}/wintertoo/validate.py +3 -3
- {wintertoo-1.6.2 → wintertoo-1.7.0}/wintertoo.egg-info/PKG-INFO +1 -1
- {wintertoo-1.6.2 → wintertoo-1.7.0}/.github/dependabot.yml +0 -0
- {wintertoo-1.6.2 → wintertoo-1.7.0}/.github/workflows/automerge.yml +0 -0
- {wintertoo-1.6.2 → wintertoo-1.7.0}/.github/workflows/black.yml +0 -0
- {wintertoo-1.6.2 → wintertoo-1.7.0}/.github/workflows/continuous_integration.yml +0 -0
- {wintertoo-1.6.2 → wintertoo-1.7.0}/.github/workflows/isort.yml +0 -0
- {wintertoo-1.6.2 → wintertoo-1.7.0}/.github/workflows/pylint.yml +0 -0
- {wintertoo-1.6.2 → wintertoo-1.7.0}/.gitignore +0 -0
- {wintertoo-1.6.2 → wintertoo-1.7.0}/.pre-commit-config.yaml +0 -0
- {wintertoo-1.6.2 → wintertoo-1.7.0}/LICENSE +0 -0
- {wintertoo-1.6.2 → wintertoo-1.7.0}/README.md +0 -0
- {wintertoo-1.6.2 → wintertoo-1.7.0}/setup.cfg +0 -0
- {wintertoo-1.6.2 → wintertoo-1.7.0}/tests/test_fields.py +0 -0
- {wintertoo-1.6.2 → wintertoo-1.7.0}/tests/testdata/test_schedule.json +0 -0
- {wintertoo-1.6.2 → wintertoo-1.7.0}/wintertoo/__init__.py +0 -0
- {wintertoo-1.6.2 → wintertoo-1.7.0}/wintertoo/data/observing_request_schema.json +0 -0
- {wintertoo-1.6.2 → wintertoo-1.7.0}/wintertoo/data/summer_fields.txt +0 -0
- {wintertoo-1.6.2 → wintertoo-1.7.0}/wintertoo/data/winter_fields.txt +0 -0
- {wintertoo-1.6.2 → wintertoo-1.7.0}/wintertoo/errors.py +0 -0
- {wintertoo-1.6.2 → wintertoo-1.7.0}/wintertoo/fields.py +0 -0
- {wintertoo-1.6.2 → wintertoo-1.7.0}/wintertoo/models/__init__.py +0 -0
- {wintertoo-1.6.2 → wintertoo-1.7.0}/wintertoo/models/image.py +0 -0
- {wintertoo-1.6.2 → wintertoo-1.7.0}/wintertoo/models/program.py +0 -0
- {wintertoo-1.6.2 → wintertoo-1.7.0}/wintertoo.egg-info/SOURCES.txt +0 -0
- {wintertoo-1.6.2 → wintertoo-1.7.0}/wintertoo.egg-info/dependency_links.txt +0 -0
- {wintertoo-1.6.2 → wintertoo-1.7.0}/wintertoo.egg-info/requires.txt +0 -0
- {wintertoo-1.6.2 → wintertoo-1.7.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
|
+
Version: 1.7.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
|
|
@@ -54,10 +54,6 @@ def get_default_value(key: str):
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
# define location of Palomar Observatory
|
|
57
|
-
PALOMAR_LOC = coords.EarthLocation(
|
|
58
|
-
lat=coords.Latitude("33d21m25.5s"),
|
|
59
|
-
lon=coords.Longitude("-116d51m58.4s"),
|
|
60
|
-
height=1696.0,
|
|
61
|
-
)
|
|
57
|
+
PALOMAR_LOC = coords.EarthLocation.of_site("Palomar")
|
|
62
58
|
|
|
63
59
|
palomar_observer = astroplan.Observer(location=PALOMAR_LOC)
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Models for ToO requests
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
+
import logging
|
|
5
6
|
from typing import List, Optional, Union
|
|
6
7
|
|
|
7
8
|
from astropy.time import Time
|
|
@@ -24,6 +25,8 @@ from wintertoo.data import (
|
|
|
24
25
|
)
|
|
25
26
|
from wintertoo.errors import WinterValidationError
|
|
26
27
|
|
|
28
|
+
logger = logging.getLogger(__name__)
|
|
29
|
+
|
|
27
30
|
MIN_EXPOSURE_TIME = 0.28
|
|
28
31
|
MAX_EXPOSURE_TIME = 300.0
|
|
29
32
|
|
|
@@ -248,3 +251,20 @@ class WinterRaDecToO(Winter, RaDecToO):
|
|
|
248
251
|
|
|
249
252
|
|
|
250
253
|
AllTooClasses = Union[SummerFieldToO, SummerRaDecToO, WinterFieldToO, WinterRaDecToO]
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
def is_summer(too: Union[Winter, Summer]) -> bool:
|
|
257
|
+
"""
|
|
258
|
+
Checks a ToO Request to ensure it is either a Summer or Winter request
|
|
259
|
+
|
|
260
|
+
:param too: ToO request
|
|
261
|
+
:return: boolean
|
|
262
|
+
"""
|
|
263
|
+
if isinstance(too, Summer):
|
|
264
|
+
return True
|
|
265
|
+
if isinstance(too, Winter):
|
|
266
|
+
return False
|
|
267
|
+
|
|
268
|
+
err = f"Unrecognised ToO type {type(too)}"
|
|
269
|
+
logger.error(err)
|
|
270
|
+
raise TypeError(err)
|
|
@@ -66,7 +66,7 @@ def export_schedule_to_sqlitedb(schedule: pd.DataFrame, base_save_path: str) ->
|
|
|
66
66
|
return save_path
|
|
67
67
|
|
|
68
68
|
|
|
69
|
-
def submit_schedule( # pylint: disable=
|
|
69
|
+
def submit_schedule( # pylint: disable=R0913,R0917
|
|
70
70
|
schedule: pd.DataFrame,
|
|
71
71
|
program_api_key: str,
|
|
72
72
|
program_name: str,
|
|
@@ -5,16 +5,16 @@ Created on Tue Jan 25 13:51:59 2022
|
|
|
5
5
|
@author: frostig, belatedly edited by Robert Stein
|
|
6
6
|
"""
|
|
7
7
|
import logging
|
|
8
|
-
from typing import Union
|
|
9
8
|
|
|
10
9
|
import astropy.time
|
|
11
10
|
import numpy as np
|
|
12
11
|
import pandas as pd
|
|
12
|
+
from astropy import units as u
|
|
13
13
|
from astropy.coordinates import AltAz, SkyCoord
|
|
14
14
|
from astropy.time import Time
|
|
15
|
+
from astropy.utils.masked import Masked
|
|
15
16
|
|
|
16
17
|
from wintertoo.data import PALOMAR_LOC, palomar_observer
|
|
17
|
-
from wintertoo.models.too import Summer, Winter
|
|
18
18
|
|
|
19
19
|
logger = logging.getLogger(__name__)
|
|
20
20
|
|
|
@@ -51,8 +51,15 @@ def up_tonight(time_mjd: astropy.time.Time, ra: str, dec: str) -> tuple[bool, st
|
|
|
51
51
|
"""
|
|
52
52
|
loc = SkyCoord(ra=ra, dec=dec, frame="icrs")
|
|
53
53
|
time = Time(time_mjd, format="mjd")
|
|
54
|
+
|
|
55
|
+
# Rise/fade can fail if target is close to a bin edge
|
|
54
56
|
sun_rise = palomar_observer.sun_rise_time(time, which="previous")
|
|
57
|
+
if isinstance(sun_rise.value, Masked):
|
|
58
|
+
sun_rise = palomar_observer.sun_rise_time(time - 0.05 * u.day, which="previous")
|
|
55
59
|
sun_set = palomar_observer.sun_set_time(time, which="next")
|
|
60
|
+
if isinstance(sun_rise.value, Masked):
|
|
61
|
+
sun_set = palomar_observer.sun_rise_time(time + 0.05 * u.day, which="next")
|
|
62
|
+
|
|
56
63
|
night = sun_set.jd - sun_rise.jd
|
|
57
64
|
if night >= 1:
|
|
58
65
|
# if next day, subtract a day
|
|
@@ -66,10 +73,12 @@ def up_tonight(time_mjd: astropy.time.Time, ra: str, dec: str) -> tuple[bool, st
|
|
|
66
73
|
df = pd.DataFrame(data={"time": time_array, "alt": altaz.alt})
|
|
67
74
|
df = df[df["alt"] >= MINIMUM_ELEVATION]
|
|
68
75
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
76
|
+
time_up = 0
|
|
77
|
+
if len(df) > 0:
|
|
78
|
+
try:
|
|
79
|
+
time_up = df["time"].iloc[-1] - df["time"].iloc[0]
|
|
80
|
+
except KeyError:
|
|
81
|
+
pass
|
|
73
82
|
|
|
74
83
|
if time_up > 0:
|
|
75
84
|
is_available = (
|
|
@@ -85,23 +94,6 @@ def up_tonight(time_mjd: astropy.time.Time, ra: str, dec: str) -> tuple[bool, st
|
|
|
85
94
|
return avail_bool, is_available
|
|
86
95
|
|
|
87
96
|
|
|
88
|
-
def is_summer(too: Union[Winter, Summer]) -> bool:
|
|
89
|
-
"""
|
|
90
|
-
Checks a ToO Request to ensure it is either a Summer or Winter request
|
|
91
|
-
|
|
92
|
-
:param too: ToO request
|
|
93
|
-
:return: boolean
|
|
94
|
-
"""
|
|
95
|
-
if isinstance(too, Summer):
|
|
96
|
-
return True
|
|
97
|
-
if isinstance(too, Winter):
|
|
98
|
-
return False
|
|
99
|
-
|
|
100
|
-
err = f"Unrecognised ToO type {type(too)}"
|
|
101
|
-
logger.error(err)
|
|
102
|
-
raise TypeError(err)
|
|
103
|
-
|
|
104
|
-
|
|
105
97
|
def get_date(time: Time) -> int:
|
|
106
98
|
"""
|
|
107
99
|
Get the date from a time object
|
|
@@ -20,7 +20,7 @@ from wintertoo.utils import up_tonight
|
|
|
20
20
|
logger = logging.getLogger(__name__)
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
def get_and_validate_program_details( # pylint: disable=
|
|
23
|
+
def get_and_validate_program_details( # pylint: disable=R0913,R0917
|
|
24
24
|
program_name: str,
|
|
25
25
|
program_api_key: str,
|
|
26
26
|
program_db_user: str = None,
|
|
@@ -256,7 +256,7 @@ def validate_time_allocation(
|
|
|
256
256
|
raise WinterValidationError(err)
|
|
257
257
|
|
|
258
258
|
|
|
259
|
-
def validate_schedule_with_program(
|
|
259
|
+
def validate_schedule_with_program(
|
|
260
260
|
schedule_request: pd.DataFrame,
|
|
261
261
|
program: Program,
|
|
262
262
|
):
|
|
@@ -297,7 +297,7 @@ def validate_schedule_with_program( # pylint: disable=too-many-arguments
|
|
|
297
297
|
)
|
|
298
298
|
|
|
299
299
|
|
|
300
|
-
def validate_schedule_request( # pylint: disable=
|
|
300
|
+
def validate_schedule_request( # pylint: disable=R0913,R0917
|
|
301
301
|
schedule_request: pd.DataFrame,
|
|
302
302
|
program_name: str,
|
|
303
303
|
program_api_key: str,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: wintertoo
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.7.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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|