Skip to content

Commit

Permalink
Use extract_tags_from_ref to compute tags in trace and modelmap
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiopasra committed May 16, 2019
1 parent 4d7deeb commit 4e81dd0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
8 changes: 1 addition & 7 deletions megaradrp/recipes/calibration/modelmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,7 @@ def run(self, rinput):
fiberconf = self.datamodel.get_fiberconf(reduced)
model_map.total_fibers = fiberconf.nfibers
model_map.missing_fibers = rinput.master_traces.missing_fibers

for key in model_map.tag_names():
if key in obresult.labels:
model_map.tags[key] = obresult.labels[key]
else:
model_map.tags[key] = reduced[0].header[key]

model_map.tags = self.extract_tags_from_ref(reduced, model_map.tag_names(), base=obresult.labels)
# model_map.boxes_positions = box_borders
# model_map.ref_column = cstart
model_map.update_metadata(self)
Expand Down
8 changes: 1 addition & 7 deletions megaradrp/recipes/calibration/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,7 @@ def run(self, rinput):
final = megaradrp.products.TraceMap(instrument=obresult.instrument)
fiberconf = self.datamodel.get_fiberconf(reduced)
final.total_fibers = fiberconf.nfibers

for key in final.tag_names():
if key in obresult.labels:
final.tags[key] = obresult.labels[key]
else:
final.tags[key] = reduced[0].header[key]

final.tags = self.extract_tags_from_ref(reduced, final.tag_names(), base=obresult.labels)
final.boxes_positions = box_borders
final.ref_column = cstart

Expand Down

0 comments on commit 4e81dd0

Please sign in to comment.