Skip to content

Commit

Permalink
make it easier to get id_prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
JoanneBogart committed May 2, 2024
1 parent d8901d6 commit aaa953d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions skycatalogs/objects/gaia_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ def __init__(self, obj_pars, parent_collection, index):
# dec = np.degrees(obj_pars['coord_dec'])
ra = obj_pars['ra_deg']
dec = obj_pars['dec_deg']
# Form the object id from the GAIA catalog id with the string
# 'gaia_dr2_' prepended.
id_prefix = GaiaCollection.get_config()['id_prefix']
# Form the object id from the GAIA catalog id with a string
# like 'gaia_dr2_' prepended.
id_prefix = GaiaCollection._id_prefix
obj_id = f"{id_prefix}{obj_pars['id']}"
super().__init__(ra, dec, obj_id, 'gaia_star',
belongs_to=parent_collection, belongs_index=index)
Expand Down Expand Up @@ -235,7 +235,7 @@ class GaiaCollection(ObjectCollection):
@classmethod
def set_config(cls, config):
GaiaCollection._gaia_config = config

GaiaCollection._id_prefix = config['id_prefix']
@classmethod
def get_config(cls):
return GaiaCollection._gaia_config
Expand Down

0 comments on commit aaa953d

Please sign in to comment.