Skip to content

Commit

Permalink
Merge pull request #54 from LSSTDESC/u/jchiang/remove_SKYCATALOGS_DIR…
Browse files Browse the repository at this point in the history
…_dependence

remove reliance on SKYCATALOGS_DIR env var
  • Loading branch information
jchiang87 authored Aug 3, 2023
2 parents 19f7c42 + cc6c9c1 commit 9ff4d46
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion python/desc/skycatalogs/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.5.0-rc1"
__version__ = "1.5.0-rc2"
12 changes: 9 additions & 3 deletions python/desc/skycatalogs/objects/gaia_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import sys
import warnings
import itertools
from pathlib import PurePath
import numpy as np
import erfa
import astropy.modeling
Expand All @@ -13,18 +14,23 @@
from desc.skycatalogs.utils.shapes import Disk, PolygonalRegion
from desc.skycatalogs.objects.base_object import BaseObject, ObjectCollection


__all__ = ['GaiaObject', 'GaiaCollection']


_FILE_PATH = str(PurePath(__file__))
_SKYCATALOGS_DIR = _FILE_PATH[:_FILE_PATH.rindex('/python')]


# Read in function for stellar temperature estimation given bp and rp
# fluxes
_TEMP_EST_DATA_FILE = os.path.join(os.environ['SKYCATALOGS_DIR'],
'data', 'gaia_dr2',
_TEMP_EST_DATA_FILE = os.path.join(_SKYCATALOGS_DIR, 'data', 'gaia_dr2',
'gaia_dr2_temp_from_bp-rp_ratio.txt')
_TEMP_FUNC = galsim.LookupTable(*np.genfromtxt(_TEMP_EST_DATA_FILE))

# Read in the Gaia DR2 passband for the bp flux to use for setting the
# SED normalizations.
_GAIA_PB_FILE = os.path.join(os.environ['SKYCATALOGS_DIR'], 'data', 'gaia_dr2',
_GAIA_PB_FILE = os.path.join(_SKYCATALOGS_DIR, 'data', 'gaia_dr2',
'GaiaDR2_RevisedPassbands.dat')
_GAIA_PBS = np.genfromtxt(_GAIA_PB_FILE, names=['wl', 'g', 'g_err', 'bp',
'bp_err', 'rp', 'rp_err'])
Expand Down

0 comments on commit 9ff4d46

Please sign in to comment.