def __init__(self, data=None, freq=None, x=None, y=None, x_rep=None, y_rep=None, label=None, units=None, meta=None): super().__init__(data, freq, label, units, meta) self._x_rep = _Replicate() self._y_rep = _Replicate() self._mask = None self._x_rep = _Replicate(data=x) self._y_rep = _Replicate(data=y) if x is None and x_rep is not None: self.x_rep = _copy.deepcopy(x_rep) if y is None and y_rep is not None: self.y_rep = _copy.deepcopy(y_rep)
def __init__(self, data=None, freq=None, label=None, units=None, meta=None): self._data = None self._freq = _Frequency() self._label = None self._units = None self._meta = None self._reps = _Replicate() if data is not None: self.data = _copy.deepcopy(data) if freq is not None: self.freq = _copy.deepcopy(freq) else: self.freq = _Frequency() if label is not None: self.label = _copy.deepcopy(label) if units is not None: self.units = _copy.deepcopy(units) if meta is not None: self._meta = _copy.deepcopy(meta)
def __init__(self, data=None, freq=None, label=None, units=None, meta=None): super().__init__(data, freq, label, units, meta) self._reps = _Replicate()
def check(self): """ Check x, y, and freq to make sure the dimensions agree with data """ if self._data is None: print('Hsi check: data is None, not checking') else: if self._x_rep._data is None: self._x_rep._data = _np.arange(self.shape[1]) self._x_rep._label = 'X' self._x_rep._units = 'pix' print('Hsi check: setting x to pixels') elif self._x_rep._data.size != self._data.shape[1]: self._x_rep = _Replicate() self._x_rep._data = _np.arange(self.shape[1]) self._x_rep._label = 'X' self._x_rep._units = 'pix' print('Hsi check: setting x to pixels') if self._y_rep._data is None: self._y_rep._data = _np.arange(self.shape[0]) self._y_rep._label = 'Y' self._y_rep._units = 'pix' print('Hsi check: setting y to pixels') elif self._y_rep._data.size != self._data.shape[0]: self._y_rep = _Replicate() self._y_rep._data = _np.arange(self.shape[0]) self._y_rep._label = 'Y' self._y_rep._units = 'pix' print('Hsi check: setting y to pixels') if self.freq._data is None: self.freq._data = _np.arange(self.shape[-1]) self.freq._label = 'Frequency' self.freq._units = 'pix' print('Hsi check: setting freq to pixels') elif self.freq._data.size != self._data.shape[-1]: self.freq = _Frequency() self.freq._data = _np.arange(self.shape[-1]) print('Hsi check: setting freq to pixels') return None
def check(self): """ Check x, y, and freq to make sure the dimensions agree with data """ if self._data is None: print('Hsi check: data is None, not checking') else: if self._x_rep._data is None: self._x_rep._data = _np.arange(self.shape[1]) self._x_rep._label = 'X' self._x_rep._units = 'pix' print('Hsi check: setting x to pixels') elif self._x_rep._data.size != self._data.shape[1]: self._x_rep = _Replicate() self._x_rep._data = _np.arange(self.shape[1]) self._x_rep._label = 'X' self._x_rep._units = 'pix' print('Hsi check: setting x to pixels') if self._y_rep._data is None: self._y_rep._data = _np.arange(self.shape[0]) self._y_rep._label = 'Y' self._y_rep._units = 'pix' print('Hsi check: setting y to pixels') elif self._y_rep._data.size != self._data.shape[0]: self._y_rep = _Replicate() self._y_rep._data = _np.arange(self.shape[0]) self._y_rep._label = 'Y' self._y_rep._units = 'pix' print('Hsi check: setting y to pixels') if self.freq._data is None: self.freq._data = _np.arange(self.shape[-1]) self.freq._label = 'Frequency' self.freq._units = 'pix' print('Hsi check: setting freq to pixels') elif self.freq._data.size != self._data.shape[-1]: self.freq = _Frequency() self.freq._data = _np.arange(self.shape[-1]) print('Hsi check: setting freq to pixels') return None
def __init__(self, data=None, freq=None, x=None, y=None, x_rep=None, y_rep=None, label=None, units=None, meta=None): super().__init__(data, freq, label, units, meta) self._x_rep = _Replicate() self._y_rep = _Replicate() self._mask = None self._x_rep = _Replicate(data=x) self._y_rep = _Replicate(data=y) if x is None and x_rep is not None: self.x_rep = _copy.deepcopy(x_rep) if y is None and y_rep is not None: self.y_rep = _copy.deepcopy(y_rep)