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

Add includes_for_obsid helper function #311

Merged
merged 1 commit into from
Nov 18, 2019
Merged

Conversation

taldcroft
Copy link
Member

Closes #309. (Supercedes).

@taldcroft
Copy link
Member Author

@jeanconn - are you planning to review this then?

@jeanconn
Copy link
Contributor

jeanconn commented Nov 8, 2019

No, I was actively reviewing this item 😄

Copy link
Contributor

@jeanconn jeanconn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good and works for me.

def includes_for_obsid(obsid):
"""
Return a dict with the include_ids_acq, include_halfws_acq and include_ids_guide
lists for the as-run flight catalog of ``obsid``. Useful for forcing catalog.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I note that get_starcheck_catalog has both as-run catalogs and has ingested latest-version catalogs for obsids that haven't actually run yet. But that does not apply to this PR.


ok = np.in1d(cat['type'], ('ACQ', 'BOT'))
out['include_ids_acq'] = cat['id'][ok].tolist()
out['include_halfws_acq'] = cat['halfw'][ok].tolist()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good as I don't see any way the ids and the halfwidths can end up with mismatched indexes.

"""
from mica.starcheck import get_starcheck_catalog

obs = get_starcheck_catalog(obsid)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could use get_starcat here but get_starcheck_catalog is fine.

@jeanconn jeanconn merged commit b22b4cf into master Nov 18, 2019
@jeanconn jeanconn deleted the includes-from-obsid branch November 18, 2019 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants