Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(SingleTask): pull tag from input_tags, when not explicitly configured #170

Merged
merged 2 commits into from
Jan 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions draco/analysis/delay.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,9 @@ def process(self, ss):
delays = np.fft.fftshift(np.fft.fftfreq(ndelay, d=self.freq_spacing)) # in us

# Initialise the spectrum container
delay_spec = containers.DelaySpectrum(baseline=baselines, delay=delays)
delay_spec = containers.DelaySpectrum(
baseline=baselines, delay=delays, attrs_from=ss
)
delay_spec.redistribute("baseline")
delay_spec.spectrum[:] = 0.0

Expand Down Expand Up @@ -609,7 +611,9 @@ def process(self, ss: FreqContainerType) -> containers.DelaySpectrum:
# Use the "baselines" axis to generically represent all the other axes

# Initialise the spectrum container
delay_spec = containers.DelaySpectrum(baseline=nbase, delay=delays)
delay_spec = containers.DelaySpectrum(
baseline=nbase, delay=delays, attrs_from=ss
)
delay_spec.redistribute("baseline")
delay_spec.spectrum[:] = 0.0
bl_axes = [da for da in data_axes if da not in [self.average_axis, "freq"]]
Expand Down
9 changes: 8 additions & 1 deletion draco/core/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,15 @@ def _nan_process_output(self, output):
def _interpolation_dict(self, output):
# Get the set of variables the can be interpolated into the various strings
idict = dict(output.attrs)
if "tag" in output.attrs:
tag = output.attrs["tag"]
elif "input_tags" in output.attrs and len(output.attrs["input_tags"]):
tag = output.attrs["input_tags"][0]
else:
tag = self._count

idict.update(
tag=(output.attrs["tag"] if "tag" in output.attrs else self._count),
tag=tag,
count=self._count,
task=self.__class__.__name__,
key=(
Expand Down