Skip to content

Commit

Permalink
Merge pull request #56 from LSSTDESC/issue/55/pipe_fixes
Browse files Browse the repository at this point in the history
Issue/55/pipe fixes
  • Loading branch information
eacharles authored Aug 16, 2024
2 parents 0f4f53a + 4ebbe8f commit 6a8dca9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 2 additions & 0 deletions src/rail/pipelines/degradation/apply_phot_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def __init__(self, error_models=None):

self.reddener = Reddener.build(
dustmap_dir=dustmap_dir,
copy_all_cols=True,
)

previous_stage = self.reddener
Expand All @@ -68,4 +69,5 @@ def __init__(self, error_models=None):
self.dereddener_errors = Dereddener.build(
dustmap_dir=dustmap_dir,
connections=dict(input=previous_stage.io.output),
copy_all_cols=True,
)
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@

SELECTORS = dict(
GAMA = dict(
Selector='SpecSelection_GAMA',
Select='SpecSelection_GAMA',
Module='rail.creation.degraders.spectroscopic_selections',
),
BOSS = dict(
Selector='SpecSelection_BOSS',
Select='SpecSelection_BOSS',
Module='rail.creation.degraders.spectroscopic_selections',
),
VVDSf02 = dict(
Selector='SpecSelection_VVDSf02',
Select='SpecSelection_VVDSf02',
Module='rail.creation.degraders.spectroscopic_selections',
),
zCOSMOS = dict(
Selector='SpecSelection_zCOSMOS',
Select='SpecSelection_zCOSMOS',
Module='rail.creation.degraders.spectroscopic_selections',
),
HSC = dict(
Selector='SpecSelection_HSC',
Select='SpecSelection_HSC',
Module='rail.creation.degraders.spectroscopic_selections',
),
)
Expand Down Expand Up @@ -66,7 +66,7 @@ def __init__(self, selectors=None):
config_pars['colnames'] = colnames

for key, val in selectors.items():
the_class = ceci.PipelineStage.get_stage(val['Selector'], val['Module'])
the_class = ceci.PipelineStage.get_stage(val['Select'], val['Module'])
the_selector = the_class.make_and_connect(
name=f'select_{key}',
**config_pars,
Expand Down
9 changes: 4 additions & 5 deletions src/rail/tools/photometry_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,16 +420,16 @@ class DustMapBase(RailStage):

config_options = RailStage.config_options.copy()
config_options.update(
bands=Param(str, default='ugrizy', msg="Names of the bands"),
ra_name=Param(str, default='ra', msg="Name of the RA column"),
dec_name=Param(str, default='dec', msg="Name of the DEC column"),
mag_name=Param(str, default="mag_{band}_lsst", msg="Template for the magnitude columns"),
band_a_env=Param(list, default=[4.81,3.64,2.70,2.06,1.58,1.31], msg="Extinction values"),
band_a_env=SHARED_PARAMS,
dustmap_name=Param(str, default='sfd', msg="Name of the dustmap in question"),
dustmap_dir=Param(str, required=True, msg="Directory with dustmaps"),
copy_cols=Param(list, default=[], msg="Additional columns to copy"),
copy_all_cols=Param(bool, default=False, msg="Copy all the columns"),
)

inputs = [('input', PqHandle)]
outputs = [('output', PqHandle)]

Expand Down Expand Up @@ -470,10 +470,9 @@ def run(self):
raise KeyError(f"Unknown dustmap {self.config.dustmap_name}, options are {list(dust_map_dict.keys())}") from msg
ebvvec = dust_map(coords)
band_mag_name_list=[]
for i, band_ in enumerate(self.config.bands):
band_mag_name = self.config.mag_name.format(band=band_)
for band_mag_name, a_env_value in self.config.band_a_env.items():
mag_vals = data[band_mag_name]
out_data[band_mag_name] = self._calc_values(mag_vals, ebvvec, self.config.band_a_env[i])
out_data[band_mag_name] = self._calc_values(mag_vals, ebvvec, a_env_value)
band_mag_name_list.append(band_mag_name)

# check if copy_all_cols set to true:
Expand Down

0 comments on commit 6a8dca9

Please sign in to comment.