예제 #1
0
    def __init__(self, cube, beam=None, mask=None, method="MAD", compute=True):

        # Initialize cube object
        self.cube = SpectralCube.read(cube)

        if mask is not None:
            _check_mask(mask)
        self.mask = mask

        if beam is not None:
            _check_beam(mask)

        # Initialize noise object
        self.noise = Noise(self.cube, beam=beam, method=method)
예제 #2
0
    def __init__(self, cube, mask=None, algorithm=None, beam=None):
        super(ObsCube, self).__init__()
        self.cube = sc.SpectralCube.read(cube)

        self.algorithm = algorithm

        # Make sure mask is an accepted type
        if mask is not None:
            _check_mask(mask)
        self.mask = mask

        if beam is not None:
            _check_beam(beam)
        self.noise = Noise(self.cube, beam=beam)
예제 #3
0
    def __init__(self, cube, mask=None, algorithm=None, beam=None):
        super(ObsCube, self).__init__()
        self.cube = sc.SpectralCube.read(cube)

        self.algorithm = algorithm

        # Make sure mask is an accepted type
        if mask is not None:
            _check_mask(mask)
        self.mask = mask

        if beam is not None:
            _check_beam(beam)
        self.noise = Noise(self.cube, beam=beam)
예제 #4
0
        def __init__(self, cube, mask=None, algorithm=None, beam=None):

            raise NotImplementedError("ObsCube is not yet implemented for "
                                      "general use.")

            super(ObsCube, self).__init__()
            self.cube = SpectralCube.read(cube)

            self.algorithm = algorithm

            # Make sure mask is an accepted type
            if mask is not None:
                _check_mask(mask)
            self.mask = mask

            if beam is not None:
                _check_beam(beam)
            self.noise = Noise(self.cube, beam=beam)
예제 #5
0
        def apply_mask(self, mask=None):
            '''
            Check if the given mask is acceptable abd apply to
            SpectralCube.
            '''

            # Update mask
            if mask is not None:
                _check_mask(mask)
                self.mask = mask

            # Create the mask, auto masking nan values
            default_mask = np.isfinite(self.cube.filled_data[:])
            if self.mask is not None:
                self.mask = CompositeMask(default_mask, self.mask)
            else:
                self.mask = default_mask

            # Apply mask to spectral cube object
            self.cube = self.cube.with_mask(mask)

            return self
예제 #6
0
    def apply_mask(self, mask=None):
        '''
        Check if the given mask is acceptable abd apply to
        SpectralCube.
        '''

        # Update mask
        if mask is not None:
            _check_mask(mask)
            self.mask = mask

        # Create the mask, auto masking nan values
        default_mask = np.isfinite(self.cube.filled_data[:])
        if self.mask is not None:
            self.mask = CompositeMask(default_mask, self.mask)
        else:
            self.mask = default_mask

        # Apply mask to spectral cube object
        self.cube = self.cube.with_mask(mask)

        return self
예제 #7
0
        def __init__(self,
                     cube,
                     beam=None,
                     mask=None,
                     method="MAD",
                     compute=True):

            raise NotImplementedError("SimCube is not yet implemented for "
                                      "general use.")

            # Initialize cube object
            self.cube = SpectralCube.read(cube)

            if mask is not None:
                _check_mask(mask)
            self.mask = mask

            if beam is not None:
                _check_beam(mask)

            # Initialize noise object
            self.noise = Noise(self.cube, beam=beam, method=method)