Exemplo n.º 1
0
    def obs_data(self, data):

        if self._grad_data_type in (float, np.floating):
            data = check_float(data)
        check_npndarray(data, dtype=self._grad_data_type, writeable=False)

        self._obs_data = data
Exemplo n.º 2
0
    def obs_data(self, input_data):

        if self._grad_data_type in {float, np.floating}:
            input_data = check_float(input_data)
        check_npndarray(
            input_data,
            dtype=self._grad_data_type,
            writeable=False,
            verbose=self.verbose,
        )

        self._obs_data = input_data
Exemplo n.º 3
0
    def __init__(self, data, psf, psf_type='fixed', convolve_method='astropy'):

        self.obs_data = data
        self.op = self._H_op_method
        self.trans_op = self._Ht_op_method
        check_float(psf)
        check_npndarray(psf, writeable=False)
        self._psf = psf
        self._psf_type = psf_type
        self._convolve_method = convolve_method

        PowerMethod.__init__(self, self.trans_op_op, self.obs_data.shape)
Exemplo n.º 4
0
def check_data_format(data, n_dim):
    """Check data format

    This method checks that the input data has the correct number of dimensions

    Parameters
    ----------
    data : np.ndarray
        Input data array
    n_dim : int or list of ints
        Expected number of dimensions

    Raises
    ------
    ValueError
        For invalid array dimensions

    """

    check_npndarray(data, dtype=float, writeable=False, verbose=False)

    if data.ndim not in list(n_dim):
        raise ValueError('Input data array has an invalid number of '
                         'dimensions.')