How to use the trollimage.colormap.ylorrd function in trollimage

To help you get started, we’ve selected a few trollimage examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pytroll / fogpy / fogpy / algorithms.py View on Github external
self.time,
                                      mode="L")
            else:
                result_img = Image(self.result.squeeze(), mode='L',
                                   fill_value=None)
        else:
            self.plotrange = (np.nanmin(array), np.nanmax(array))
            if type == 'tif':
                result_img = GeoImage(array.squeeze(), area,
                                      self.time,
                                      mode="L")
            else:
                result_img = Image(array.squeeze(), mode='L', fill_value=None)
        result_img.stretch("crude")
        # Colorize image
        ylorrd.set_range(*self.plotrange)
        logger.info("Set color range to {}".format(self.plotrange))
        if not floating_point:
            result_img.colorize(ylorrd)
        if array is None:
            shape = self.result.shape
        else:
            shape = array.shape
        result_img.resize((shape[0] * int(resize),
                           shape[1] * int(resize)))
        if save:
            # Get output directory and image name
            if array is None:
                outname = self.name
            else:
                outname = self.name + '_' + name
            savedir = os.path.join(dir, outname + '_' +
github pytroll / fogpy / fogpy / algorithms.py View on Github external
result_img = Image(self.result.squeeze(), mode='L',
                                   fill_value=None)
        else:
            self.plotrange = (np.nanmin(array), np.nanmax(array))
            if type == 'tif':
                result_img = GeoImage(array.squeeze(), area,
                                      self.time,
                                      mode="L")
            else:
                result_img = Image(array.squeeze(), mode='L', fill_value=None)
        result_img.stretch("crude")
        # Colorize image
        ylorrd.set_range(*self.plotrange)
        logger.info("Set color range to {}".format(self.plotrange))
        if not floating_point:
            result_img.colorize(ylorrd)
        if array is None:
            shape = self.result.shape
        else:
            shape = array.shape
        result_img.resize((shape[0] * int(resize),
                           shape[1] * int(resize)))
        if save:
            # Get output directory and image name
            if array is None:
                outname = self.name
            else:
                outname = self.name + '_' + name
            savedir = os.path.join(dir, outname + '_' +
                                   datetime.strftime(self.time,
                                                     '%Y%m%d%H%M') +
                                   '.' + type)