steveberardi / starplot

✨ Star charts and maps in Python
https://starplot.dev
MIT License
17 stars 7 forks source link

Clarification about the truncation of ra min/max values #80

Closed SultanOrazbayev closed 4 weeks ago

SultanOrazbayev commented 4 weeks ago

Hello, thank you for this great package!

While studying your code, I wanted to understand better the purpose of this adjustment:

https://github.com/steveberardi/starplot/blob/a67624f4ccded8d0979075d3e087fd0fc906ff8d/src/starplot/optic.py#L156-L159

Specifically, is it safe for me to use the following as the ra min/max for use in some downstream calculations?

ra_min = p.ra - p.optic.true_fov / 15 * 1.08
ra_max = p.ra + p.optic.true_fov / 15 * 1.08
steveberardi commented 4 weeks ago

That adjustment for declinations greater than 70 or less than -70 is just a very naive / unsophisticated / simple way of ensuring all stars are plotted if the target is near a celestial pole, since the star data is not stored in a way that allows geodesic queries. I would definitely like to improve this though :)

So, I would not rely on the optic plot's RA min/max properties for determining the min/max of the optic's field of view.

What are you interested in using those values for though? Because there are two other methods that might be helpful:

Those two functions will determine if a point is within the field of view of the optic, and should be extremely accurate.

SultanOrazbayev commented 4 weeks ago

Dear @steveberardi , thank you for the quick follow-up and the explanation! I understand the motivation for this fix now. It's related to the problem I am working on.

Apart from visualization, I'm trying to calculate the number of stars that have specific properties within a region that could be captured by a camera (so ignoring timing/visibility issue for the moment). My data comes from Vizier, and the problem I had was converting the camera dimensions to the relevant ra/dec bounds. This seems like a straightforward calculation, but I couldn't figure it out.

Tracing your suggestions, it looks like I might be able to solve my problem directly via optics.Camera:

https://github.com/steveberardi/starplot/blob/a67624f4ccded8d0979075d3e087fd0fc906ff8d/src/starplot/optics.py#L293-L301

I will look into this in the coming days. Thank you!

steveberardi commented 4 weeks ago

@SultanOrazbayev

Apart from visualization, I'm trying to calculate the number of stars that have specific properties within a region that could be captured by a camera (so ignoring timing/visibility issue for the moment).

ahh, maybe the plot's object list could help you too then? OpticPlot.objects.stars should give you a very accurate list of stars that were plotted, which have a few properties available too (e.g. HIP id) -- In the next version of Starplot I'm hoping to add the star's Tycho ID to the Star model

SultanOrazbayev commented 3 weeks ago

Thank you, @steveberardi!

The object list is super userful, I initially used that approach, but quickly found that I am missing some of the stars of interest (as they are in Vizier, but not in the HIPPARCOS/TYCHO_1).