def _model_mask(self, wavelengths=None):
        """
        Apply pre-defined model masks.
        """

        if wavelengths is None:
            wavelengths = self.wavelengths
        wavelengths = np.array(wavelengths)

        mask = np.ones_like(wavelengths, dtype=bool)
        model_mask = self._configuration.get("masks", {}).get("model", [])
        logger.debug("Applying model mask: {0}".format(model_mask))
        for start, end in model_mask:
            idx = np.clip(wavelengths.searchsorted([start, end]) + [0, 1], 0,
                wavelengths.size)
            mask[idx[0]:idx[1]] = False
        return mask
def _model_mask ( self , wavelengths = None ) : if wavelengths is None : wavelengths = self . wavelengths wavelengths = np . array ( wavelengths ) mask = np . ones_like ( wavelengths , dtype = bool ) model_mask = self . _configuration . get ( "masks" , { } ) . get ( "model" , [ ] ) logger . debug ( "Applying model mask: {0}" . format ( model_mask ) ) for start , end in model_mask : idx = np . clip ( wavelengths . searchsorted ( [ start , end ] ) + [ 0 , 1 ] , 0 , wavelengths . size ) mask [ idx [ 0 ] : idx [ 1 ] ] = False return mask
Apply pre-defined model masks.