Skip to content

Commit

Permalink
More renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
taldcroft committed Jan 2, 2024
1 parent 705eea9 commit ee2f79e
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 54 deletions.
2 changes: 1 addition & 1 deletion sparkles/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__version__ = ska_helpers.get_version(__package__)

from .aca_checks_table import get_t_ccds_bonus # noqa: F401
from .aca_check_table import get_t_ccds_bonus # noqa: F401
from .core import ACAReviewTable, run_aca_review # noqa: F401


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def get_t_ccds_bonus(mags, t_ccd, dyn_bgd_n_faint, dyn_bgd_dt_ccd):
return t_ccds


class ACAChecksTable(ACATable):
class ACACheckTable(ACATable):
messages = MetaAttribute()

def __init__(self, *args, **kwargs):
Expand Down
30 changes: 14 additions & 16 deletions sparkles/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from chandra_aca.transform import mag_to_count_rate, snr_mag_for_t_ccd
from proseco.core import ACACatalogTableRow, StarsTableRow

from sparkles.aca_checks_table import ACAChecksTable
from sparkles.aca_check_table import ACACheckTable
from sparkles.messages import Message

# Observations with man_angle_next less than or equal to CREEP_AWAY_THRESHOLD
Expand All @@ -24,7 +24,7 @@ def acar_check_wrapper(func):
"""

@functools.wraps(func)
def wrapper(acar: ACAChecksTable, *args, **kwargs):
def wrapper(acar: ACACheckTable, *args, **kwargs):
msgs: list[Message] = func(acar, *args, **kwargs)
messages = [
{
Expand All @@ -40,7 +40,7 @@ def wrapper(acar: ACAChecksTable, *args, **kwargs):
return wrapper


def check_guide_overlap(acar: ACAChecksTable) -> list[Message]:
def check_guide_overlap(acar: ACACheckTable) -> list[Message]:
"""Check for overlapping tracked items.
Overlap is defined as within 12 pixels.
Expand All @@ -62,7 +62,7 @@ def check_guide_overlap(acar: ACAChecksTable) -> list[Message]:
return msgs


def check_guide_geometry(acar: ACAChecksTable) -> list[Message]:
def check_guide_geometry(acar: ACACheckTable) -> list[Message]:
"""Check for guide stars too tightly clustered.
(1) Check for any set of n_guide-2 stars within 500" of each other.
Expand Down Expand Up @@ -123,7 +123,7 @@ def dist2(g1, g2):


def check_guide_fid_position_on_ccd(
acar: ACAChecksTable, entry: ACACatalogTableRow
acar: ACACheckTable, entry: ACACatalogTableRow
) -> list[Message]:
"""Check position of guide stars and fid lights on CCD."""
msgs = []
Expand Down Expand Up @@ -186,7 +186,7 @@ def sign(axis):
# }


def check_acq_p2(acar: ACAChecksTable) -> list[Message]:
def check_acq_p2(acar: ACACheckTable) -> list[Message]:
"""Check acquisition catalog safing probability."""
msgs = []
P2 = -np.log10(acar.acqs.calc_p_safe())
Expand All @@ -202,7 +202,7 @@ def check_acq_p2(acar: ACAChecksTable) -> list[Message]:
return msgs


def check_include_exclude(acar: ACAChecksTable) -> list[Message]:
def check_include_exclude(acar: ACACheckTable) -> list[Message]:
"""Check for included or excluded guide or acq stars or fids (info)"""
msgs = []
call_args = acar.call_args
Expand All @@ -222,7 +222,7 @@ def check_include_exclude(acar: ACAChecksTable) -> list[Message]:
return msgs


def check_guide_count(acar: ACAChecksTable) -> list[Message]:
def check_guide_count(acar: ACACheckTable) -> list[Message]:
"""
Check for sufficient guide star fractional count.
Expand Down Expand Up @@ -327,7 +327,7 @@ def check_guide_count(acar: ACAChecksTable) -> list[Message]:

# Add a check that for ORs with guide count between 3.5 and 4.0, the
# dither is 4 arcsec if dynamic background not enabled.
def check_dither(acar: ACAChecksTable) -> list[Message]:
def check_dither(acar: ACACheckTable) -> list[Message]:
"""Check dither.
This presently checks that dither is 4x4 arcsec if dynamic background is not in
Expand All @@ -354,7 +354,7 @@ def check_dither(acar: ACAChecksTable) -> list[Message]:
return msgs


def check_pos_err_guide(acar: ACAChecksTable, star: StarsTableRow) -> list[Message]:
def check_pos_err_guide(acar: ACACheckTable, star: StarsTableRow) -> list[Message]:
"""Warn on stars with larger POS_ERR (warning at 1" critical at 2")"""
msgs = []
agasc_id = star["id"]
Expand All @@ -377,7 +377,7 @@ def check_pos_err_guide(acar: ACAChecksTable, star: StarsTableRow) -> list[Messa
return msgs


def check_imposters_guide(acar: ACAChecksTable, star: StarsTableRow) -> list[Message]:
def check_imposters_guide(acar: ACACheckTable, star: StarsTableRow) -> list[Message]:
"""Warn on stars with larger imposter centroid offsets"""

# Borrow the imposter offset method from starcheck
Expand Down Expand Up @@ -410,9 +410,7 @@ def imposter_offset(cand_mag, imposter_mag):
return msgs


def check_guide_is_candidate(
acar: ACAChecksTable, star: StarsTableRow
) -> list[Message]:
def check_guide_is_candidate(acar: ACACheckTable, star: StarsTableRow) -> list[Message]:
"""Critical for guide star that is not a valid guide candidate.
This can occur for a manually included guide star. In rare cases
Expand All @@ -432,7 +430,7 @@ def check_guide_is_candidate(
return msgs


def check_too_bright_guide(acar: ACAChecksTable, star: StarsTableRow) -> list[Message]:
def check_too_bright_guide(acar: ACACheckTable, star: StarsTableRow) -> list[Message]:
"""Warn on guide stars that may be too bright.
- Critical if within 2 * mag_err of the hard 5.2 limit, caution within 3 * mag_err
Expand Down Expand Up @@ -495,7 +493,7 @@ def check_fid_spoiler_score(idx, fid) -> list[Message]:
return msgs


def check_fid_count(acar: ACAChecksTable) -> list[Message]:
def check_fid_count(acar: ACACheckTable) -> list[Message]:
"""
Check for the correct number of fids.
Expand Down
6 changes: 3 additions & 3 deletions sparkles/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from proseco.core import MetaAttribute

from sparkles import checks
from sparkles.aca_checks_table import ACAChecksTable
from sparkles.aca_check_table import ACACheckTable
from sparkles.messages import Message, MessagesList
from sparkles.roll_optimize import RollOptimizeMixin

Expand Down Expand Up @@ -568,7 +568,7 @@ def get_summary_text(acas):
return "\n".join(lines)


class ACAReviewTable(ACAChecksTable, RollOptimizeMixin):
class ACAReviewTable(ACACheckTable, RollOptimizeMixin):
# Whether this instance is a roll option (controls how HTML report page is formatted)
is_roll_option = MetaAttribute()
roll_options = MetaAttribute()
Expand Down Expand Up @@ -1033,7 +1033,7 @@ def from_ocat(cls, obsid, t_ccd=-5, man_angle=5, date=None, roll=None, **kwargs)
check_too_bright_guide = checks.acar_check_wrapper(checks.check_too_bright_guide)


def check_catalog(acar: ACAChecksTable) -> None:
def check_catalog(acar: ACACheckTable) -> None:
"""Perform all star catalog checks."""
msgs: list[Message] = []
for entry in acar:
Expand Down
Loading

0 comments on commit ee2f79e

Please sign in to comment.