src/coecms/um/um2oasis.py
def transform(self, source, dest):
        """
        Replaces data in the field with the values from `self.lfrac`
        """
        data = source.get_data()
        data_orig = numpy.copy(data)

        if source.lbuser4 == 30:
            # Land mask
            data = numpy.where(self.lfrac > 0, 1, 0)

        if source.lbuser4 == 33:
            # Orography - set to minimum 1 where there's land
            data = numpy.where(numpy.logical_and(data < 0, self.lfrac > 0), 1, data)

        if source.lbuser4 == 505:
            # Land fraction
            data = self.lfrac

        # Remove missing data that's been unmasked
        data = numpy.where(numpy.logical_and(data == -1073741824, self.lfrac > 0), 0, data)

        return data

        Replaces data in the field with the values from `self.lfrac`
        
Replaces data in the field with the values from `self.lfrac`
Replaces data in the field with the values from ` self . lfrac `
def transform(self, source, dest):
        data = source.get_data()
        data_orig = numpy.copy(data)
        if source.lbuser4 == 30:
            data = numpy.where(self.lfrac > 0, 1, 0)
        if source.lbuser4 == 33:
            data = numpy.where(numpy.logical_and(data < 0, self.lfrac > 0), 1, data)
        if source.lbuser4 == 505:
            data = self.lfrac
        data = numpy.where(numpy.logical_and(data == -1073741824, self.lfrac > 0), 0, data)
        return data
def transform ( self , source , dest ) : data = source . get_data ( ) data_orig = numpy . copy ( data ) if source . lbuser4 == 30 : data = numpy . where ( self . lfrac > 0 , 1 , 0 ) if source . lbuser4 == 33 : data = numpy . where ( numpy . logical_and ( data < 0 , self . lfrac > 0 ) , 1 , data ) if source . lbuser4 == 505 : data = self . lfrac data = numpy . where ( numpy . logical_and ( data == - 1073741824 , self . lfrac > 0 ) , 0 , data ) return data
Replaces data in the field with the values from `self.lfrac`
Replaces data in the field with the values from ` self . lfrac `
"""
        Replaces data in the field with the values from `self.lfrac`
        """ # Land mask # Orography - set to minimum 1 where there's land # Land fraction # Remove missing data that's been unmasked
self
source
dest