3 from .base
import Creator
6 from refractor
import framework
as rf
13 "Issue a warning when the number of channels in some data source does not match the expected number" 28 if bad_sample_mask
is not None:
29 return rf.SpectralWindowRange(win_ranges, bad_sample_mask)
31 return rf.SpectralWindowRange(win_ranges)
38 "Returns the array with unit value for spacing specified regardless if it was specified as an array or scalar value with unit" 43 if isinstance(spacing_val, rf.DoubleWithUnit):
45 spacing_used = rf.ArrayWithUnit_double_1(np.full(num_channels, spacing_val.value), spacing_val.units)
48 spacing_used = spacing_val
55 return rf.SpectrumSamplingFixedSpacing(self.
spacing())
60 return rf.UniformSpectrumSampling(self.
spacing())
68 full_spec_spacing = rf.SpectrumSamplingFixedSpacing(self.
spacing())
73 for idx, dom
in enumerate(domains):
74 if not isinstance(dom, rf.SpectralDomain):
75 raise param.ParamError(
"Channel domain value at index %d is not a instance of SpectralDomain" % idx)
77 return rf.NonuniformSpectrumSampling(*domains, full_spec_spacing)
87 for effect_name
in self.
effects():
89 all_effects.append(self.
param(effect_name))
92 spec_eff = rf.vector_vector_spectrum_effect()
94 per_channel_eff = rf.vector_spectrum_effect()
96 for effect
in all_effects:
97 per_channel_eff.push_back(effect[chan_index])
99 spec_eff.push_back(per_channel_eff)
112 fm = rf.StandardForwardModel(self.
instrument(),
def check_num_channels(self, check_num)
def register_parameter(self, param_name, param_def)
def param(self, param_name, kwargs)