You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a suggestion, or maybe it can be called a bug.
Since 1.7, use pandas to load the Hipparcos star catalog as a Pandas dataframe, then use Star.from_dataframe to get a specified star. It is very convenient. BUT, the parallax_mas is ignored (ps: I am using v1.10).
from skyfield.api import Star, load
from skyfield.data import hipparcos
with load.open(hipparcos.URL) as f:
df = hipparcos.load_dataframe(f)
barnards_star = Star.from_dataframe(df.loc[87937])
print(barnards_star)
giving the following result: Star(ra_hours=17.963601536666665, dec_degrees=4.66828815, ra_mas_per_year=-797.84, dec_mas_per_year=10326.93, epoch=2448349.0625)
While the parallax of HIP87937 is 549.01mas.
So in the method Star.from_dataframe, I suggest to add one line to use parallax value:
@classmethod
def from_dataframe(cls, df):
epoch = 1721045.0 + _unwrap(df['epoch_year']) * 365.25
return cls(
ra_hours=_unwrap(df['ra_hours']),
dec_degrees=_unwrap(df['dec_degrees']),
ra_mas_per_year=_unwrap(df.get('ra_mas_per_year', 0)),
dec_mas_per_year=_unwrap(df.get('dec_mas_per_year', 0)),
# add the following one line to use parallax value
parallax_mas=_unwrap(df.get('parallax_mas', 0)),
epoch=epoch,
)
The text was updated successfully, but these errors were encountered:
Great project, thanks!
I have a suggestion, or maybe it can be called a bug.
Since 1.7, use pandas to load the Hipparcos star catalog as a Pandas dataframe, then use Star.from_dataframe to get a specified star. It is very convenient. BUT, the parallax_mas is ignored (ps: I am using v1.10).
giving the following result:
Star(ra_hours=17.963601536666665, dec_degrees=4.66828815, ra_mas_per_year=-797.84, dec_mas_per_year=10326.93, epoch=2448349.0625)
While the parallax of HIP87937 is 549.01mas.
So in the method
Star.from_dataframe
, I suggest to add one line to use parallax value:The text was updated successfully, but these errors were encountered: