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 get_stars() function to get multiple ids / dates #40

Merged
merged 2 commits into from
Jan 9, 2020
Merged

Conversation

taldcroft
Copy link
Member

This is about 25 times faster than running get_star() individually when getting large numbers of stars (e.g. more than 1000). On a fast SSD drive this runs in about 2 msec per star.

Along the way I think I found a way to simplify the code wrt to the proper motion handling.

ok = has_pm & ~epoch_is_2000
dyear[ok] = (DateTime(date) - DateTime(stars['EPOCH'][ok], format='frac_year')) / 365.25
pm_to_degrees = dyear / (3600. * 1000.)
if np.asarray(date).shape == ():
Copy link
Contributor

Choose a reason for hiding this comment

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

@taldcroft Would you please remind me of the expected types and shapes of date? It isn't clear to me which problem this is code change is solving.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I see. The new get_stars() routine repurposes add_pmcorr_columns() to receive date possibly as a thing with the same length as stars. I think add_pmcorr_columns probably needs a real docstring now and maybe a rename of date to dates in the args.

Copy link
Member Author

Choose a reason for hiding this comment

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

Documentation update done. I left the arg as date on the off chance this non-public method is being used directly somewhere.

@jeanconn jeanconn merged commit 1b193bd into master Jan 9, 2020
@jeanconn jeanconn deleted the get-stars branch January 9, 2020 15:30
@jeanconn jeanconn mentioned this pull request Jan 10, 2020
22 tasks
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