Skip to content

Commit

Permalink
Merge pull request #79 from lsst/u/yoachim/euclid_detailer_clean
Browse files Browse the repository at this point in the history
U/yoachim/euclid detailer clean
  • Loading branch information
yoachim committed Aug 1, 2024
2 parents 8cbed76 + 3a62753 commit c520088
Showing 1 changed file with 42 additions and 11 deletions.
53 changes: 42 additions & 11 deletions rubin_scheduler/scheduler/detailers/dither_detailer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
_approx_altaz2pa,
_approx_ra_dec2_alt_az,
bearing,
ddf_locations,
dest_latlon,
gnomonic_project_tosky,
rotation_converter,
Expand Down Expand Up @@ -82,8 +83,25 @@ class EuclidDitherDetailer(BaseDetailer):
Parameters
----------
XXX--fill in docstring
dither_bearing_dir : `list`
A list with the dither amplitude in along the axis
connecting the two positions. Default [-0.25, 1] in degrees.
dither_bearing_perp : `list`
A list with the dither amplitude perpendicular to the
axis connecting the two positions. Default [-0.25, 1]
in degrees.
seed : `float`
Random number seed to use (42).
per_night : `bool`
If dither shifts should be per night (default True),
or if dithers should be every pointing (False).
ra_a, dec_a, ra_b, dec_b : `float`
Positions for the two field centers. Default None
will load the positions from
rubin_scheduler.utils.ddf_locations
nnights : `int`
Number of nights to generate dither positions for.
Default 7305 (20 years).
"""

def __init__(
Expand All @@ -92,18 +110,32 @@ def __init__(
dither_bearing_perp=[-0.25, 0.25],
seed=42,
per_night=True,
ra_a=58.90,
dec_a=-49.315,
ra_b=63.6,
dec_b=-47.60,
ra_a=None,
dec_a=None,
ra_b=None,
dec_b=None,
nnights=7305,
):
self.survey_features = {}

self.ra_a = np.radians(ra_a)
self.ra_b = np.radians(ra_b)
self.dec_a = np.radians(dec_a)
self.dec_b = np.radians(dec_b)
default_locations = ddf_locations()

if ra_a is None:
self.ra_a = np.radians(default_locations["EDFS_a"][0])
else:
self.ra_a = np.radians(ra_a)
if ra_b is None:
self.ra_b = np.radians(default_locations["EDFS_b"][0])
else:
self.ra_b = np.radians(ra_b)
if dec_a is None:
self.dec_a = np.radians(default_locations["EDFS_a"][1])
else:
self.dec_a = np.radians(dec_a)
if dec_b is None:
self.dec_b = np.radians(default_locations["EDFS_b"][1])
else:
self.dec_b = np.radians(dec_b)

self.dither_bearing_dir = np.radians(dither_bearing_dir)
self.dither_bearing_perp = np.radians(dither_bearing_perp)
Expand Down Expand Up @@ -173,7 +205,6 @@ def _generate_offsets(self, n_offsets, night):
self.shifted_ra_b,
)
else:
# XXX--not implamented
ValueError("not implamented")

return (
Expand Down

0 comments on commit c520088

Please sign in to comment.