3 from .base
import Creator
4 from .value
import CreatorFlaggedValue, CreatorFlaggedValueMultiChannel
7 from refractor
import framework
as rf
21 ils_vec = rf.vector_ils()
23 ils_vec.push_back( rf.IlsConvolution(disp, ils_func, half_width) )
38 ret_flag[:, slice(self.
num_parameters(), ret_flag.shape[1])] =
False 43 disp_coeffs = self.
value()
51 vec_disp = rf.vector_dispersion()
53 chan_disp = rf.DispersionPolynomial(disp_coeffs.value[chan_idx, :], retrieval_flag[chan_idx, :], disp_coeffs.units,
54 desc_band_name[chan_idx], int(number_samples[chan_idx]), is_one_based)
55 disp.append(chan_disp)
56 vec_disp.push_back(chan_disp)
65 if hasattr(spec_win,
"dispersion"):
66 self.
spec_win().dispersion = vec_disp
90 if type(delta_lambda) != type(response)
or (wavenumber
and type(wavenumber) != type(delta_lambda)):
91 raise param.ParamError(
"delta_lambda, response and wavenumber (if supplied) must have the same data type")
93 if isinstance(delta_lambda, np.ndarray):
104 IlsClass = rf.IlsTableLog
106 IlsClass = rf.IlsTableLinear
110 if wavenumber
is None:
111 chan_wn = dispersion[chan_idx].pixel_grid.data
114 chan_wn = wavenumber[chan_idx, :]
116 chan_wn = wavenumber[chan_idx]
119 ils_func.append( IlsClass(chan_wn, delta_lambda[chan_idx, :, :], response[chan_idx, :, :],
120 desc_band_name[chan_idx], hdf_band_name[chan_idx], interpolate) )
122 ils_func.append( IlsClass(chan_wn, delta_lambda[chan_idx], response[chan_idx],
123 desc_band_name[chan_idx], hdf_band_name[chan_idx], interpolate) )
142 ils_func.append( rf.IlsGaussian(hwhm.value[chan_idx], desc_band_name[chan_idx], hdf_band_name[chan_idx]) )
152 rel_vel = self.
value()
157 inst_doppler.append( rf.InstrumentDoppler(rel_vel[chan_idx], bool(ret_flag[chan_idx])) )
171 all_corrections.append(self.
param(correction_name))
174 inst_corr = rf.vector_vector_instrument_correction()
176 per_channel_corr = rf.vector_instrument_correction()
178 for correction
in all_corrections:
179 per_channel_corr.push_back(correction[chan_index])
181 inst_corr.push_back(per_channel_corr)
193 params = self.
value()
201 rad_scaling.append( rf.RadianceScalingSvFit(params[chan_index, :], retrieval_flag[chan_index, :], band_ref[chan_index], band_name[chan_index]) )
def retrieval_flag(self, kwargs)
def register_parameter(self, param_name, param_def)
def param(self, param_name, kwargs)
def retrieval_flag(self, kwargs)