From 0f85abdbefff446a882051023e095d6ca9de9011 Mon Sep 17 00:00:00 2001 From: Michael Reuter Date: Fri, 21 Aug 2015 10:00:29 -0700 Subject: [PATCH] Removing EUPS and replacing productDir calls. --- .../matchSEDs_examples/matchGalSEDs.ipynb | 4 +-- .../readGalfastExample.ipynb | 4 +-- python/lsst/sims/photUtils/Photometry.py | 4 +-- python/lsst/sims/photUtils/matchUtils.py | 6 ++-- .../sims/photUtils/readGalfast/readGalfast.py | 4 +-- python/lsst/sims/photUtils/selectGalaxySED.py | 6 ++-- python/lsst/sims/photUtils/selectStarSED.py | 6 ++-- tests/testMatchSEDs.py | 28 +++++++++---------- tests/testPhotometricParameters.py | 4 +-- tests/testPhotometry.py | 22 +++++++-------- tests/testReadGalfast.py | 8 +++--- tests/testSNR.py | 14 +++++----- tests/testSed.py | 2 +- 13 files changed, 56 insertions(+), 56 deletions(-) diff --git a/examples/matchSEDs_examples/matchGalSEDs.ipynb b/examples/matchSEDs_examples/matchGalSEDs.ipynb index be4b472..f62589a 100644 --- a/examples/matchSEDs_examples/matchGalSEDs.ipynb +++ b/examples/matchSEDs_examples/matchGalSEDs.ipynb @@ -88,7 +88,7 @@ "input": [ "import os\n", "import numpy as np\n", - "import eups\n", + "import lsst.utils\n", "from lsst.sims.photUtils.Photometry import PhotometryBase as phot\n", "\n", "#Import sample galaxy catalog organized as [RA, Dec, z, mag_g, mag_r, mag_i, mag_z, mag_y]\n", @@ -140,7 +140,7 @@ "#If using full SDSS ugriz then you do not have to load the Bandpasses ahead of time\n", "#or specify the extCoeffs since these are the default values for matchToObserved.\n", "sdssPhot = phot()\n", - "sdssPhot.loadTotalBandpassesFromFiles(['g', 'r', 'i', 'z'], bandpassDir = os.path.join(eups.productDir('throughputs'),'sdss'),\n", + "sdssPhot.loadTotalBandpassesFromFiles(['g', 'r', 'i', 'z'], bandpassDir = os.path.join(lsst.utils.getPackageDir('throughputs'),'sdss'),\n", " bandpassRoot ='sdss_')\n", "\n", "catMagsObs = np.transpose([mag_g, mag_r, mag_i, mag_z])\n", diff --git a/examples/readGalfast_examples/readGalfastExample.ipynb b/examples/readGalfast_examples/readGalfastExample.ipynb index 27ff0ed..5cd7efe 100644 --- a/examples/readGalfast_examples/readGalfastExample.ipynb +++ b/examples/readGalfast_examples/readGalfastExample.ipynb @@ -29,11 +29,11 @@ "input": [ "import numpy as np\n", "import os\n", - "import eups\n", + "import lsst.utils\n", "from lsst.sims.photUtils.readGalfast import readGalfast\n", "\n", "#Setup list of km01 metallicity Kurucz SEDs\n", - "kuruczList = os.listdir(str(eups.productDir('sims_sed_library') + '/starSED/kurucz/'))\n", + "kuruczList = os.listdir(str(lsst.utils.getPackageDir('sims_sed_library') + '/starSED/kurucz/'))\n", "km01List = []\n", "for kuruczName in kuruczList:\n", " if kuruczName.startswith('km01'):\n", diff --git a/python/lsst/sims/photUtils/Photometry.py b/python/lsst/sims/photUtils/Photometry.py index 75fdd3a..425ffdb 100644 --- a/python/lsst/sims/photUtils/Photometry.py +++ b/python/lsst/sims/photUtils/Photometry.py @@ -12,8 +12,8 @@ import os import numpy -import eups from collections import OrderedDict +import lsst.utils from lsst.sims.photUtils import Sed, Bandpass, LSSTdefaults, calcGamma, \ calcMagError_m5, PhotometricParameters, magErrorFromSNR from lsst.sims.utils import defaultSpecMap @@ -63,7 +63,7 @@ class PhotometryHardware(object): waveLenStep = None def loadBandpassesFromFiles(self, bandpassNames=['u', 'g', 'r', 'i', 'z', 'y'], - filedir = os.path.join(eups.productDir('throughputs'), 'baseline'), + filedir = os.path.join(lsst.utils.getPackageDir('throughputs'), 'baseline'), bandpassRoot = 'filter_', componentList = ['detector.dat', 'm1.dat', 'm2.dat', 'm3.dat', 'lens1.dat', 'lens2.dat', 'lens3.dat'], diff --git a/python/lsst/sims/photUtils/matchUtils.py b/python/lsst/sims/photUtils/matchUtils.py index 5797b8c..c580d31 100644 --- a/python/lsst/sims/photUtils/matchUtils.py +++ b/python/lsst/sims/photUtils/matchUtils.py @@ -5,10 +5,10 @@ @author: Bryce Kalmbach """ import numpy as np -import eups import os import re +import lsst.utils from lsst.sims.photUtils.Sed import Sed from lsst.sims.photUtils.Bandpass import Bandpass from lsst.sims.utils import SpecMap @@ -158,7 +158,7 @@ def __init__(self, sEDDir = None, kuruczDir = None, mltDir = None, wdDir = None) """ if sEDDir is None: - self.sEDDir = eups.productDir('sims_sed_library') + self.sEDDir = lsst.utils.getPackageDir('sims_sed_library') else: self.sEDDir = sEDDir #Use SpecMap to pull the directory locations @@ -359,7 +359,7 @@ def __init__(self, galDir = None): for key, val in sorted(specMap.subdir_map.iteritems()): if re.match(key, specFileStart): galSpecDir = str(val) - self.galDir = str(eups.productDir('sims_sed_library') + '/' + galSpecDir) + self.galDir = str(lsst.utils.getPackageDir('sims_sed_library') + '/' + galSpecDir) else: self.galDir = galDir diff --git a/python/lsst/sims/photUtils/readGalfast/readGalfast.py b/python/lsst/sims/photUtils/readGalfast/readGalfast.py index 7ed20e7..21358cb 100644 --- a/python/lsst/sims/photUtils/readGalfast/readGalfast.py +++ b/python/lsst/sims/photUtils/readGalfast/readGalfast.py @@ -1,10 +1,10 @@ import os import gzip import pyfits -import eups import itertools import numpy as np +import lsst.utils from lsst.sims.photUtils.Sed import Sed from lsst.sims.photUtils.Bandpass import Bandpass from lsst.sims.photUtils.selectStarSED import selectStarSED @@ -206,7 +206,7 @@ def loadGalfast(self, filenameList, outFileList, sEDPath = None, kuruczPath = No sdssPhot = phot() sdssPhot.loadTotalBandpassesFromFiles(['u','g','r','i','z'], - bandpassDir = os.path.join(eups.productDir('throughputs'), + bandpassDir = os.path.join(lsst.utils.getPackageDir('throughputs'), 'sdss'), bandpassRoot = 'sdss_') sdssPhot.setupPhiArray_dict() diff --git a/python/lsst/sims/photUtils/selectGalaxySED.py b/python/lsst/sims/photUtils/selectGalaxySED.py index 8ca0c03..26ec27c 100644 --- a/python/lsst/sims/photUtils/selectGalaxySED.py +++ b/python/lsst/sims/photUtils/selectGalaxySED.py @@ -1,7 +1,7 @@ import os import numpy as np -import eups +import lsst.utils from lsst.sims.photUtils.Sed import Sed from lsst.sims.photUtils.matchUtils import matchGalaxy from lsst.sims.photUtils.Photometry import PhotometryBase as phot @@ -51,7 +51,7 @@ def matchToRestFrame(self, sedList, catMags, mag_error = None, bandpassDict = No galPhot = phot() if bandpassDict is None: galPhot.loadTotalBandpassesFromFiles(['u','g','r','i','z'], - bandpassDir = os.path.join(eups.productDir('throughputs'),'sdss'), + bandpassDir = os.path.join(lsst.utils.getPackageDir('throughputs'),'sdss'), bandpassRoot = 'sdss_') else: galPhot.bandpassDict = bandpassDict @@ -171,7 +171,7 @@ def matchToObserved(self, sedList, catMags, catRedshifts, catRA = None, catDec = galPhot = phot() if bandpassDict is None: galPhot.loadTotalBandpassesFromFiles(['u','g','r','i','z'], - bandpassDir = os.path.join(eups.productDir('throughputs'),'sdss'), + bandpassDir = os.path.join(lsst.utils.getPackageDir('throughputs'),'sdss'), bandpassRoot = 'sdss_') else: galPhot.bandpassDict = bandpassDict diff --git a/python/lsst/sims/photUtils/selectStarSED.py b/python/lsst/sims/photUtils/selectStarSED.py index f7f9306..0ded7b5 100644 --- a/python/lsst/sims/photUtils/selectStarSED.py +++ b/python/lsst/sims/photUtils/selectStarSED.py @@ -1,8 +1,8 @@ import os import numpy as np -import eups import warnings +import lsst.utils from lsst.sims.photUtils.matchUtils import matchStar from lsst.sims.photUtils.Photometry import PhotometryBase as phot from lsst.sims.photUtils.EBV import EBVbase as ebv @@ -72,8 +72,8 @@ def findSED(self, sedList, catMags, catRA = None, catDec = None, mag_error = Non starPhot = phot() if bandpassDict is None: - starPhot.loadTotalBandpassesFromFiles(['u','g','r','i','z'], - bandpassDir = os.path.join(eups.productDir('throughputs'), + starPhot.loadTotalBandpassesFromFiles(['u','g','r','i','z'], + bandpassDir = os.path.join(lsst.utils.getPackageDir('throughputs'), 'sdss'), bandpassRoot = 'sdss_') else: diff --git a/tests/testMatchSEDs.py b/tests/testMatchSEDs.py index c78812a..a125d64 100644 --- a/tests/testMatchSEDs.py +++ b/tests/testMatchSEDs.py @@ -3,7 +3,7 @@ import shutil import numpy as np import re -import eups +import lsst.utils import lsst.utils.tests as utilsTests from lsst.sims.photUtils.selectStarSED import selectStarSED from lsst.sims.photUtils.selectGalaxySED import selectGalaxySED @@ -26,7 +26,7 @@ def setUpClass(cls): for key, val in sorted(specMap.subdir_map.iteritems()): if re.match(key, specFileStart): galSpecDir = str(val) - cls.galDir = str(eups.productDir('sims_sed_library') + '/' + galSpecDir + '/') + cls.galDir = str(lsst.utils.getPackageDir('sims_sed_library') + '/' + galSpecDir + '/') cls.filterList = ('u', 'g', 'r', 'i', 'z') @classmethod @@ -42,7 +42,7 @@ def testCalcMagNorm(self): testUtils = matchBase() testPhot = phot() testPhot.loadTotalBandpassesFromFiles(self.filterList, - bandpassDir = os.path.join(eups.productDir('throughputs'),'sdss'), + bandpassDir = os.path.join(lsst.utils.getPackageDir('throughputs'),'sdss'), bandpassRoot = 'sdss_') testPhot.setupPhiArray_dict() @@ -82,7 +82,7 @@ def testCalcBasicColors(self): testSED = Sed() testPhot = phot() testPhot.loadTotalBandpassesFromFiles(self.filterList, - bandpassDir = os.path.join(eups.productDir('throughputs'),'sdss'), + bandpassDir = os.path.join(lsst.utils.getPackageDir('throughputs'),'sdss'), bandpassRoot = 'sdss_') testPhot.setupPhiArray_dict() @@ -106,7 +106,7 @@ def testSEDCopyBasicColors(self): testPhot = phot() testPhot.loadTotalBandpassesFromFiles(self.filterList, - bandpassDir = os.path.join(eups.productDir('throughputs'),'sdss'), + bandpassDir = os.path.join(lsst.utils.getPackageDir('throughputs'),'sdss'), bandpassRoot = 'sdss_') testSED.readSED_flambda(str(self.galDir + os.listdir(self.galDir)[0])) copyTest.setSED(wavelen = testSED.wavelen, flambda = testSED.flambda) @@ -164,9 +164,9 @@ def setUpClass(cls): os.makedirs(cls.testKDir) os.mkdir(cls.testMLTDir) os.mkdir(cls.testWDDir) - cls.kDir = eups.productDir('sims_sed_library') + '/' + cls._specMapDict['kurucz'] + '/' - cls.mltDir = eups.productDir('sims_sed_library') + '/' + cls._specMapDict['mlt'] + '/' - cls.wdDir = eups.productDir('sims_sed_library') + '/' + cls._specMapDict['wd'] + '/' + cls.kDir = lsst.utils.getPackageDir('sims_sed_library') + '/' + cls._specMapDict['kurucz'] + '/' + cls.mltDir = lsst.utils.getPackageDir('sims_sed_library') + '/' + cls._specMapDict['mlt'] + '/' + cls.wdDir = lsst.utils.getPackageDir('sims_sed_library') + '/' + cls._specMapDict['wd'] + '/' kList = os.listdir(cls.kDir)[0:20] #Use particular indices to get different types of seds within mlt and wds for kFile, mltFile, wdFile in zip(kList, @@ -324,7 +324,7 @@ def setUpClass(cls): for key, val in sorted(specMap.subdir_map.iteritems()): if re.match(key, specFileStart): galSpecDir = str(val) - cls.galDir = str(eups.productDir('sims_sed_library') + '/' + galSpecDir + '/') + cls.galDir = str(lsst.utils.getPackageDir('sims_sed_library') + '/' + galSpecDir + '/') #Set up Test Spectra Directory cls.testSpecDir = 'testGalaxySEDSpectrum/' @@ -388,7 +388,7 @@ def setUpClass(cls): for key, val in sorted(specMap.subdir_map.iteritems()): if re.match(key, specFileStart): galSpecDir = str(val) - cls.galDir = str(eups.productDir('sims_sed_library') + '/' + galSpecDir + '/') + cls.galDir = str(lsst.utils.getPackageDir('sims_sed_library') + '/' + galSpecDir + '/') #Set up Test Spectra Directory cls.testSpecDir = 'testGalaxySEDSpectrum/' @@ -599,9 +599,9 @@ def setUpClass(cls): os.makedirs(cls.testKDir) os.mkdir(cls.testMLTDir) os.mkdir(cls.testWDDir) - cls.kDir = eups.productDir('sims_sed_library') + '/' + cls._specMapDict['kurucz'] + '/' - cls.mltDir = eups.productDir('sims_sed_library') + '/' + cls._specMapDict['mlt'] + '/' - cls.wdDir = eups.productDir('sims_sed_library') + '/' + cls._specMapDict['wd'] + '/' + cls.kDir = lsst.utils.getPackageDir('sims_sed_library') + '/' + cls._specMapDict['kurucz'] + '/' + cls.mltDir = lsst.utils.getPackageDir('sims_sed_library') + '/' + cls._specMapDict['mlt'] + '/' + cls.wdDir = lsst.utils.getPackageDir('sims_sed_library') + '/' + cls._specMapDict['wd'] + '/' kList = os.listdir(cls.kDir)[0:3] #Use particular indices to get different types of seds within mlt and wds for kFile, mltFile, wdFile in zip(kList, @@ -633,7 +633,7 @@ def testFindSED(self): np.random.seed(42) starPhot = phot() starPhot.loadTotalBandpassesFromFiles(('u','g','r','i','z'), - bandpassDir = os.path.join(eups.productDir('throughputs'),'sdss'), + bandpassDir = os.path.join(lsst.utils.getPackageDir('throughputs'),'sdss'), bandpassRoot = 'sdss_') starPhot.setupPhiArray_dict() diff --git a/tests/testPhotometricParameters.py b/tests/testPhotometricParameters.py index ac41e44..e4a4061 100644 --- a/tests/testPhotometricParameters.py +++ b/tests/testPhotometricParameters.py @@ -2,7 +2,7 @@ import os import numpy import unittest -import eups +import lsst.utils import lsst.utils.tests as utilsTests from lsst.sims.photUtils import Bandpass, Sed, PhotometricParameters, \ @@ -209,7 +209,7 @@ def testApplication(self): testSed.setFlatSED() testBandpass = Bandpass() - testBandpass.readThroughput(os.path.join(eups.productDir('throughputs'), + testBandpass.readThroughput(os.path.join(lsst.utils.getPackageDir('throughputs'), 'baseline','total_g.dat')) control = testSed.calcADU(testBandpass, diff --git a/tests/testPhotometry.py b/tests/testPhotometry.py index febb37f..177d9d5 100644 --- a/tests/testPhotometry.py +++ b/tests/testPhotometry.py @@ -2,7 +2,7 @@ import os import unittest -import eups +import lsst.utils import lsst.utils.tests as utilsTests from lsst.sims.utils import ObservationMetaData from lsst.sims.utils import defaultSpecMap @@ -41,7 +41,7 @@ def testAlternateBandpassesStars(self): boundType='circle',unrefractedRA=200.0,unrefractedDec=-30.0, boundLength=1.0) - bandpassDir=os.path.join(eups.productDir('sims_photUtils'),'tests','cartoonSedTestData') + bandpassDir=os.path.join(lsst.utils.getPackageDir('sims_photUtils'),'tests','cartoonSedTestData') cartoon_phot = PhotometryBase() cartoon_phot.loadTotalBandpassesFromFiles(['u','g','r','i','z'],bandpassDir = bandpassDir, @@ -60,7 +60,7 @@ def testAlternateBandpassesStars(self): sedObj = Sed() phiArray, waveLenStep = sedObj.setupPhiArray(bplist) - sedFileName = os.path.join(eups.productDir('sims_sed_library'),'starSED','kurucz') + sedFileName = os.path.join(lsst.utils.getPackageDir('sims_sed_library'),'starSED','kurucz') sedFileName = os.path.join(sedFileName,'km20_5750.fits_g40_5790.gz') ss = Sed() ss.readSED_flambda(sedFileName) @@ -117,7 +117,7 @@ class uncertaintyUnitTest(unittest.TestCase): """ def setUp(self): - starName = os.path.join(eups.productDir('sims_sed_library'),defaultSpecMap['km20_5750.fits_g40_5790']) + starName = os.path.join(lsst.utils.getPackageDir('sims_sed_library'),defaultSpecMap['km20_5750.fits_g40_5790']) self.starSED = Sed() self.starSED.readSED_flambda(starName) imsimband = Bandpass() @@ -132,16 +132,16 @@ def setUp(self): 'lens1.dat', 'lens2.dat', 'lens3.dat'] hardwareComponents = [] for c in componentList: - hardwareComponents.append(os.path.join(eups.productDir('throughputs'),'baseline',c)) + hardwareComponents.append(os.path.join(lsst.utils.getPackageDir('throughputs'),'baseline',c)) self.bandpasses = ['u', 'g', 'r', 'i', 'z', 'y'] for b in self.bandpasses: - filterName = os.path.join(eups.productDir('throughputs'),'baseline','filter_%s.dat' % b) + filterName = os.path.join(lsst.utils.getPackageDir('throughputs'),'baseline','filter_%s.dat' % b) components = hardwareComponents + [filterName] bandpassDummy = Bandpass() bandpassDummy.readThroughputList(components) self.hardwareBandpasses.append(bandpassDummy) - components = components + [os.path.join(eups.productDir('throughputs'),'baseline','atmos.dat')] + components = components + [os.path.join(lsst.utils.getPackageDir('throughputs'),'baseline','atmos.dat')] bandpassDummy = Bandpass() bandpassDummy.readThroughputList(components) self.totalBandpasses.append(bandpassDummy) @@ -190,7 +190,7 @@ def testSignalToNoise(self): photParams, seeing=defaults.seeing(filt))) - sedDir = eups.productDir('sims_sed_library') + sedDir = lsst.utils.getPackageDir('sims_sed_library') sedDir = os.path.join(sedDir, 'starSED', 'kurucz') fileNameList = os.listdir(sedDir) @@ -242,7 +242,7 @@ def testRawUncertainty(self): for i in range(len(self.bandpasses)): skyDummy = Sed() - skyDummy.readSED_flambda(os.path.join(eups.productDir('throughputs'), 'baseline', 'darksky.dat')) + skyDummy.readSED_flambda(os.path.join(lsst.utils.getPackageDir('throughputs'), 'baseline', 'darksky.dat')) normalizedSkyDummy = setM5(obs_metadata.m5[self.bandpasses[i]], skyDummy, self.totalBandpasses[i], self.hardwareBandpasses[i], seeing=LSSTdefaults().seeing(self.bandpasses[i]), @@ -280,7 +280,7 @@ def testSystematicUncertainty(self): for i in range(len(self.bandpasses)): skyDummy = Sed() - skyDummy.readSED_flambda(os.path.join(eups.productDir('throughputs'), 'baseline', 'darksky.dat')) + skyDummy.readSED_flambda(os.path.join(lsst.utils.getPackageDir('throughputs'), 'baseline', 'darksky.dat')) normalizedSkyDummy = setM5(obs_metadata.m5[self.bandpasses[i]], skyDummy, self.totalBandpasses[i], self.hardwareBandpasses[i], seeing=LSSTdefaults().seeing(self.bandpasses[i]), @@ -325,7 +325,7 @@ def testNoSystematicUncertainty(self): for i in range(len(self.bandpasses)): skyDummy = Sed() - skyDummy.readSED_flambda(os.path.join(eups.productDir('throughputs'), 'baseline', 'darksky.dat')) + skyDummy.readSED_flambda(os.path.join(lsst.utils.getPackageDir('throughputs'), 'baseline', 'darksky.dat')) normalizedSkyDummy = setM5(obs_metadata.m5[self.bandpasses[i]], skyDummy, self.totalBandpasses[i], self.hardwareBandpasses[i], seeing=LSSTdefaults().seeing(self.bandpasses[i]), diff --git a/tests/testReadGalfast.py b/tests/testReadGalfast.py index 3b872b8..9e3a4e5 100644 --- a/tests/testReadGalfast.py +++ b/tests/testReadGalfast.py @@ -5,7 +5,7 @@ import gzip import pyfits import re -import eups +import lsst.utils import lsst.utils.tests as utilsTests from lsst.sims.photUtils.readGalfast.readGalfast import readGalfast from lsst.sims.utils import SpecMap @@ -38,9 +38,9 @@ def setUpClass(cls): os.makedirs(cls.testKDir) os.mkdir(cls.testMLTDir) os.mkdir(cls.testWDDir) - cls.kDir = eups.productDir('sims_sed_library') + '/' + cls._specMapDict['kurucz'] + '/' - cls.mltDir = eups.productDir('sims_sed_library') + '/' + cls._specMapDict['mlt'] + '/' - cls.wdDir = eups.productDir('sims_sed_library') + '/' + cls._specMapDict['wd'] + '/' + cls.kDir = lsst.utils.getPackageDir('sims_sed_library') + '/' + cls._specMapDict['kurucz'] + '/' + cls.mltDir = lsst.utils.getPackageDir('sims_sed_library') + '/' + cls._specMapDict['mlt'] + '/' + cls.wdDir = lsst.utils.getPackageDir('sims_sed_library') + '/' + cls._specMapDict['wd'] + '/' #Use particular indices to get different types of seds within mlt and wds for kFile, mltFile, wdFile in zip(os.listdir(cls.kDir)[0:20], np.array(os.listdir(cls.mltDir))[np.arange(-10,11)], diff --git a/tests/testSNR.py b/tests/testSNR.py index 1293e45..9827825 100644 --- a/tests/testSNR.py +++ b/tests/testSNR.py @@ -1,7 +1,7 @@ import os import numpy -import eups import unittest +import lsst.utils import lsst.utils.tests as utilsTests from lsst.sims.utils import ObservationMetaData import lsst.sims.photUtils.SignalToNoise as snr @@ -14,9 +14,9 @@ class TestSNRmethods(unittest.TestCase): def setUp(self): - starFileName = os.path.join(eups.productDir('sims_sed_library'),'starSED') + starFileName = os.path.join(lsst.utils.getPackageDir('sims_sed_library'),'starSED') starFileName = os.path.join(starFileName, 'kurucz','km20_5750.fits_g40_5790.gz') - starName = os.path.join(eups.productDir('sims_sed_library'),starFileName) + starName = os.path.join(lsst.utils.getPackageDir('sims_sed_library'),starFileName) self.starSED = Sed() self.starSED.readSED_flambda(starName) imsimband = Bandpass() @@ -24,7 +24,7 @@ def setUp(self): fNorm = self.starSED.calcFluxNorm(22.0, imsimband) self.starSED.multiplyFluxNorm(fNorm) - hardwareDir = os.path.join(eups.productDir('throughputs'),'baseline') + hardwareDir = os.path.join(lsst.utils.getPackageDir('throughputs'),'baseline') componentList = ['detector.dat', 'm1.dat', 'm2.dat', 'm3.dat', 'lens1.dat', 'lens2.dat', 'lens3.dat'] self.skySed = Sed() @@ -138,7 +138,7 @@ def testSignalToNoise(self): photParams, seeing=defaults.seeing(self.filterNameList[i]))) - sedDir = eups.productDir('sims_sed_library') + sedDir = lsst.utils.getPackageDir('sims_sed_library') sedDir = os.path.join(sedDir, 'starSED', 'kurucz') fileNameList = os.listdir(sedDir) @@ -192,7 +192,7 @@ def testSystematicUncertainty(self): for bp, hardware, filterName in zip(self.bpList, self.hardwareList, self.filterNameList): skyDummy = Sed() - skyDummy.readSED_flambda(os.path.join(eups.productDir('throughputs'), 'baseline', 'darksky.dat')) + skyDummy.readSED_flambda(os.path.join(lsst.utils.getPackageDir('throughputs'), 'baseline', 'darksky.dat')) normalizedSkyDummy = setM5(obs_metadata.m5[filterName], skyDummy, bp, hardware, seeing=LSSTdefaults().seeing(filterName), @@ -241,7 +241,7 @@ def testNoSystematicUncertainty(self): for bp, hardware, filterName in zip(self.bpList, self.hardwareList, self.filterNameList): skyDummy = Sed() - skyDummy.readSED_flambda(os.path.join(eups.productDir('throughputs'), 'baseline', 'darksky.dat')) + skyDummy.readSED_flambda(os.path.join(lsst.utils.getPackageDir('throughputs'), 'baseline', 'darksky.dat')) normalizedSkyDummy = setM5(obs_metadata.m5[filterName], skyDummy, bp, hardware, seeing=LSSTdefaults().seeing(filterName), diff --git a/tests/testSed.py b/tests/testSed.py index 1ff6c7b..073135e 100644 --- a/tests/testSed.py +++ b/tests/testSed.py @@ -2,7 +2,7 @@ import warnings import unittest import os -import eups + import lsst.utils.tests as utilsTests import lsst.sims.photUtils.Sed as Sed import lsst.sims.photUtils.Bandpass as Bandpass