From 59e1d30330035baea8e1758e7988b66cce155f4b Mon Sep 17 00:00:00 2001 From: James Chiang Date: Wed, 2 Aug 2023 17:09:21 -0700 Subject: [PATCH 1/2] remove reliance on SKYCATALOGS_DIR env var --- python/desc/skycatalogs/objects/gaia_object.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/python/desc/skycatalogs/objects/gaia_object.py b/python/desc/skycatalogs/objects/gaia_object.py index 59610eed..5a5ffc5a 100644 --- a/python/desc/skycatalogs/objects/gaia_object.py +++ b/python/desc/skycatalogs/objects/gaia_object.py @@ -2,6 +2,7 @@ import sys import warnings import itertools +from pathlib import PurePath import numpy as np import erfa import astropy.modeling @@ -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']) From cc6c9c1b7677b69f4b1f27e09f5b4b4019cf99b6 Mon Sep 17 00:00:00 2001 From: James Chiang Date: Wed, 2 Aug 2023 18:00:49 -0700 Subject: [PATCH 2/2] bump version to 1.5.0-rc2 --- python/desc/skycatalogs/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/desc/skycatalogs/_version.py b/python/desc/skycatalogs/_version.py index 4f191369..99b3f985 100644 --- a/python/desc/skycatalogs/_version.py +++ b/python/desc/skycatalogs/_version.py @@ -1 +1 @@ -__version__ = "1.5.0-rc1" +__version__ = "1.5.0-rc2"