Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use allowed_rolldev in Ska.Sun #168

Merged
merged 1 commit into from
Mar 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
zip_safe=False,
entry_points=entry_points,
packages=['sparkles', 'sparkles.tests'],
package_data={'sparkles': ['index_template*.html', 'pitch_rolldev.csv'],
package_data={'sparkles': ['index_template*.html'],
'sparkles.tests': ['data/*pkl.gz']},
tests_require=['pytest'],
cmdclass=cmdclass,
Expand Down
268 changes: 0 additions & 268 deletions sparkles/pitch_rolldev.csv

This file was deleted.

18 changes: 1 addition & 17 deletions sparkles/roll_optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
Roll optimization during preliminary review of ACA catalogs.
"""
from copy import deepcopy
from pathlib import Path
import numpy as np
import warnings

Expand All @@ -20,21 +19,6 @@
from proseco import get_aca_catalog


ROLL_TABLE = Table.read(str(Path(__file__).parent / 'pitch_rolldev.csv'), format='ascii.basic',
guess=False, delimiter=',')


def allowed_rolldev(pitch):
"""Get allowed roll deviation (off-nominal roll) for the given ``pitch``.
This uses the OFLS table and is an approximation to the true planning limit.
This is basically the same as https://github.com/sot/Ska.Sun/pull/5.
:param pitch: Sun pitch angle (deg)
:returns: Roll deviation (deg)
"""
idx = np.searchsorted(ROLL_TABLE['pitch'], pitch, side='right')
return ROLL_TABLE['rolldev'][idx - 1]


def logical_intervals(vals, x=None):
"""
Determine contiguous intervals during which ``vals`` is True.
Expand Down Expand Up @@ -190,7 +174,7 @@ def get_ids_list(roll_offsets):
roll_nom = att_nom_targ.roll

if roll_dev is None:
roll_dev = allowed_rolldev(pitch)
roll_dev = Ska.Sun.allowed_rolldev(pitch)

if max_roll_dev is not None:
roll_dev = min(roll_dev, max_roll_dev)
Expand Down