diff --git a/py/fastspecfit/io.py b/py/fastspecfit/io.py index 7bd274b9..a73b4730 100644 --- a/py/fastspecfit/io.py +++ b/py/fastspecfit/io.py @@ -408,9 +408,11 @@ def __init__(self, phot, cosmo, redux_dir=None, fphotodir=None, mapdir=None): if fphotodir is None: self.fphotoext = None self.fphotodir = os.path.expandvars(os.environ.get('FPHOTO_DIR')) + self.fphotodir_default = True else: # parse the extension name, if any fphotoext = None + self.fphotodir_default = False photodir = os.path.dirname(fphotodir) photobase = os.path.basename(fphotodir) if '[' in photobase and ']' in photobase: @@ -1413,9 +1415,18 @@ def _gather_photometry(self, specprod=None, alltiles=None): legacysurveydr = self.phot.legacysurveydr - # targeting and Tractor columns to read from disk - tractor = gather_tractorphot(input_meta, columns=PHOTCOLS, legacysurveydir=self.fphotodir) - + # targeting and Tractor columns to read from disk but need + # to be careful about passing DR9 values of BRICKNAME and + # BRICK_OBJID to the DR10 LEGACY_SURVEY_DIR + if self.fphotodir_default: + tractor = gather_tractorphot(input_meta, columns=PHOTCOLS, legacysurveydir=self.fphotodir) + else: + _input_meta = input_meta.copy() + for col in ['RELEASE', 'BRICKID', 'BRICK_OBJID', 'PHOTSYS']: + if col in _input_meta.colnames: + _input_meta.remove_column(col) + tractor = gather_tractorphot(_input_meta, columns=PHOTCOLS, legacysurveydir=self.fphotodir) + # DR9-specific stuff if legacysurveydr.lower() == 'dr9' or legacysurveydr.lower() == 'dr10': metas = [] diff --git a/py/fastspecfit/qa.py b/py/fastspecfit/qa.py index 72789a83..03403154 100644 --- a/py/fastspecfit/qa.py +++ b/py/fastspecfit/qa.py @@ -768,6 +768,8 @@ def major_formatter(x, pos): medmag = 0.0 sedmodel_abmag = np.zeros_like(templates.wave) + medmag else: + #flam = sedmodel / FLUXNORM / CTools.massnorm + #np.savetxt('makani-sed.txt', np.array([[sedwave], [flam]]).squeeze().T) factor = 10**(0.4 * 48.6) * sedwave**2 / (C_LIGHT * 1e13) / FLUXNORM / CTools.massnorm # [erg/s/cm2/A --> maggies] sedmodel_abmag = -2.5*np.log10(sedmodel * factor) sedax.plot(sedwave / 1e4, sedmodel_abmag, color='grey', # ='~tan'