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)
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)
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)
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
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)