satpy.writers package¶
Submodules¶
satpy.writers.cf_writer module¶
Writer for netCDF4/CF.
-
class
satpy.writers.cf_writer.
CFWriter
(name=None, filename=None, base_dir=None, **kwargs)¶ Bases:
satpy.writers.Writer
Writer producing NetCDF/CF compatible datasets.
Initialize the writer object.
Parameters: - name (str) – A name for this writer for log and error messages. If this writer is configured in a YAML file its name should match the name of the YAML file. Writer names may also appear in output file attributes.
- filename (str) –
Filename to save data to. This filename can and should specify certain python string formatting fields to differentiate between data written to the files. Any attributes provided by the
.attrs
of a DataArray object may be included. Format and conversion specifiers provided by thetrollsift
package may also be used. Any directories in the provided pattern will be created if they do not exist. Example:{platform_name}_{sensor}_{name}_{start_time:%Y%m%d_%H%M%S.tif
- base_dir (str) – Base destination directories for all created files.
- kwargs (dict) – Additional keyword arguments to pass to the
Plugin
class.
-
static
da2cf
(dataarray, epoch='seconds since 1970-01-01 00:00:00')¶ Convert the dataarray to something cf-compatible.
-
save_dataset
(dataset, filename=None, fill_value=None, **kwargs)¶ Save the dataset to a given filename.
-
save_datasets
(datasets, filename=None, **kwargs)¶ Save all datasets to one or more files.
-
satpy.writers.cf_writer.
area2cf
(dataarray, strict=False)¶
-
satpy.writers.cf_writer.
area2gridmapping
(dataarray)¶
-
satpy.writers.cf_writer.
area2lonlat
(dataarray)¶ Convert an area to longitudes and latitudes.
-
satpy.writers.cf_writer.
create_grid_mapping
(area)¶ Create the grid mapping instance for area.
-
satpy.writers.cf_writer.
geos2cf
(area)¶ Return the cf grid mapping for the geos projection.
-
satpy.writers.cf_writer.
get_extra_ds
(dataset)¶ Get the extra datasets associated to dataset.
-
satpy.writers.cf_writer.
laea2cf
(area)¶ Return the cf grid mapping for the laea projection.
-
satpy.writers.cf_writer.
make_time_bounds
(dataarray, start_times, end_times)¶
-
satpy.writers.cf_writer.
omerc2cf
(area)¶ Return the cf grid mapping for the omerc projection.
satpy.writers.geotiff module¶
GeoTIFF writer objects for creating GeoTIFF files from Dataset objects.
-
class
satpy.writers.geotiff.
GeoTIFFWriter
(dtype=None, tags=None, **kwargs)¶ Bases:
satpy.writers.ImageWriter
Writer to save GeoTIFF images.
Basic example from Scene:
scn.save_datasets(writer=’geotiff’)Un-enhanced float geotiff with NaN for fill values:
scn.save_datasets(writer=’geotiff’, dtype=np.float32, enhance=False)-
GDAL_OPTIONS
= ('tfw', 'rpb', 'rpctxt', 'interleave', 'tiled', 'blockxsize', 'blockysize', 'nbits', 'compress', 'num_threads', 'predictor', 'discard_lsb', 'sparse_ok', 'jpeg_quality', 'jpegtablesmode', 'zlevel', 'photometric', 'alpha', 'profile', 'bigtiff', 'pixeltype', 'copy_src_overviews')¶
-
save_image
(img, filename=None, dtype=None, fill_value=None, floating_point=None, compute=True, **kwargs)¶ Save the image to the given filename in geotiff format. floating_point allows the saving of ‘L’ mode images in floating point format if set to True.
-
classmethod
separate_init_kwargs
(kwargs)¶ Helper class method to separate arguments between init and save methods.
Currently the
Scene
is passed one set of arguments to represent the Writer creation and saving steps. This is not preferred for Writer structure, but provides a simpler interface to users. This method splits the provided keyword arguments between those needed for initialization and those needed for thesave_dataset
andsave_datasets
method calls.Writer subclasses should try to prefer keyword arguments only for the save methods only and leave the init keyword arguments to the base classes when possible.
-
satpy.writers.mitiff module¶
MITIFF writer objects for creating MITIFF files from Dataset objects.
-
class
satpy.writers.mitiff.
MITIFFWriter
(name=None, tags=None, **kwargs)¶ Bases:
satpy.writers.ImageWriter
-
save_dataset
(dataset, filename=None, fill_value=None, compute=True, **kwargs)¶ Saves the
dataset
to a givenfilename
.This method creates an enhanced image using get_enhanced_image. The image is then passed to save_image. See both of these functions for more details on the arguments passed to this method.
-
save_datasets
(datasets, filename=None, fill_value=None, compute=True, **kwargs)¶ Save all datasets to one or more files.
-
save_image
()¶ Save Image object to a given
filename
.Parameters: - img (trollimage.xrimage.XRImage) – Image object to save to disk.
- filename (str) – Optionally specify the filename to save this dataset to. It may include string formatting patterns that will be filled in by dataset attributes.
- compute (bool) – If True (default), compute and save the dataset. If False return either a dask.delayed.Delayed object or tuple of (source, target). See the return values below for more information.
- **kwargs – Other keyword arguments to pass to this writer.
Returns: Value returned depends on compute. If compute is True then the return value is the result of computing a dask.delayed.Delayed object or running dask.array.store. If compute is False then the returned value is either a dask.delayed.Delayed object that can be computed using delayed.compute() or a tuple of (source, target) that should be passed to dask.array.store. If target is provided the the caller is responsible for calling target.close() if the target has this method.
-
satpy.writers.ninjotiff module¶
GeoTIFF writer objects for creating GeoTIFF files from Dataset objects.
-
class
satpy.writers.ninjotiff.
NinjoTIFFWriter
(tags=None, **kwargs)¶ Bases:
satpy.writers.ImageWriter
satpy.writers.scmi module¶
The SCMI AWIPS writer is used to create AWIPS compatible tiled NetCDF4 files. The Advanced Weather Interactive Processing System (AWIPS) is a program used by the United States National Weather Service (NWS) and others to view different forms of weather imagery. Sectorized Cloud and Moisture Imagery (SCMI) is a netcdf format accepted by AWIPS to store one image broken up in to one or more “tiles”. Once AWIPS is configured for specific products the SCMI NetCDF backend can be used to provide compatible products to the system. The files created by this backend are compatible with AWIPS II (AWIPS I is no longer supported).
The SCMI writer takes remapped binary image data and creates an AWIPS-compatible NetCDF4 file. The SCMI writer and the AWIPS client may need to be configured to make things appear the way the user wants in the AWIPS client. The SCMI writer can only produce files for datasets mapped to areas with specific projections:
- lcc
- geos
- merc
- stere
This is a limitation of the AWIPS client and not of the SCMI writer.
Numbered versus Lettered Grids¶
By default the SCMI writer will save tiles by number starting with ‘1’ representing the upper-left image tile. Tile numbers then increase along the column and then on to the next row.
By specifying lettered_grid as True tiles can be designated with a letter. Lettered grids or sectors are preconfigured in the scmi.yaml configuration file. The lettered tile locations are static and will not change with the data being written to them. Each lettered tile is split in to a certain number of subtiles (num_subtiles), default 2 rows by 2 columns. Lettered tiles are meant to make it easier for receiving AWIPS clients/stations to filter what tiles they receive; saving time, bandwidth, and space.
Any tiles (numbered or lettered) not containing any valid data are not created.
-
class
satpy.writers.scmi.
AttributeHelper
(ds_info)¶ Bases:
object
helper object which wraps around a HimawariScene to provide SCMI attributes
-
apply_attributes
(nc, table, prefix='')¶ apply fixed attributes, or look up attributes needed and apply them
-
-
class
satpy.writers.scmi.
LetteredTileGenerator
(area_definition, extents, cell_size=(2000000, 2000000), num_subtiles=None)¶
-
class
satpy.writers.scmi.
NetCDFWrapper
(filename, sector_id, ds_info, awips_info, xy_factors, tile_info, compress=False, fix_awips=False)¶ Bases:
object
Object to wrap all NetCDF data-based operations in to a single call.
This makes it possible to do SCMI writing with dask’s delayed da.store function.
-
class
satpy.writers.scmi.
NetCDFWriter
(filename, include_fgf=True, ds_info=None, compress=False)¶ Bases:
object
Write a basic NetCDF4 file with header data mapped to global attributes, and BT/ALB/RAD variables FUTURE: optionally add time dimension (CF) FUTURE: optionally add zenith and azimuth angles
-
apply_data_attributes
(bitdepth, scale_factor, add_offset, valid_min=None, valid_max=None)¶
-
close
()¶
-
col_dim_name
= 'x'¶
-
create_dimensions
(lines, columns)¶
-
create_variables
(bitdepth, fill_value, scale_factor=None, add_offset=None, valid_min=None, valid_max=None)¶
-
fgf_x
= None¶
-
fgf_y
= None¶
-
image_var_name
= 'data'¶
-
nc
¶
-
projection
= None¶
-
row_dim_name
= 'y'¶
-
set_fgf
(x, mx, bx, y, my, by, units='meters', downsample_factor=1)¶
-
set_global_attrs
(physical_element, awips_id, sector_id, creating_entity, total_tiles, total_pixels, tile_row, tile_column, tile_height, tile_width, creator=None)¶
-
set_image_data
(data)¶
-
set_projection_attrs
(area_id, proj4_info)¶ Assign projection attributes per GRB standard
-
x_var_name
= 'x'¶
-
y_var_name
= 'y'¶
-
-
class
satpy.writers.scmi.
NumberedTileGenerator
(area_definition, tile_shape=None, tile_count=None)¶ Bases:
object
-
class
satpy.writers.scmi.
SCMIDatasetDecisionTree
(decision_dicts, **kwargs)¶ Bases:
satpy.writers.DecisionTree
-
class
satpy.writers.scmi.
SCMIWriter
(compress=False, fix_awips=False, **kwargs)¶ Bases:
satpy.writers.Writer
-
check_tile_exists
(output_filename)¶
-
enhancer
¶ Lazy loading of enhancements only if needed.
-
get_filename
(area_def, tile_info, sector_id, **kwargs)¶ Create a filename where output data will be saved.
Parameters: kwargs (dict) – Attributes and other metadata to use for formatting the previously provided filename.
-
save_dataset
(dataset, **kwargs)¶ Saves the
dataset
to a givenfilename
.This method must be overloaded by the subclass.
Parameters: - dataset (xarray.DataArray) – Dataset to save using this writer.
- filename (str) – Optionally specify the filename to save this dataset to. If not provided then filename which can be provided to the init method will be used and formatted by dataset attributes.
- fill_value (int or float) – Replace invalid values in the dataset with this fill value if applicable to this writer.
- compute (bool) – If True (default), compute and save the dataset. If False return either a dask.delayed.Delayed object or tuple of (source, target). See the return values below for more information.
- **kwargs – Other keyword arguments for this particular writer.
Returns: Value returned depends on compute. If compute is True then the return value is the result of computing a dask.delayed.Delayed object or running dask.array.store. If compute is False then the returned value is either a dask.delayed.Delayed object that can be computed using delayed.compute() or a tuple of (source, target) that should be passed to dask.array.store. If target is provided the the caller is responsible for calling target.close() if the target has this method.
-
save_datasets
(datasets, sector_id=None, source_name=None, filename=None, tile_count=(1, 1), tile_size=None, lettered_grid=False, num_subtiles=None, compute=True, **kwargs)¶ Save all datasets to one or more files.
Subclasses can use this method to save all datasets to one single file or optimize the writing of individual datasets. By default this simply calls save_dataset for each dataset provided.
Parameters: - datasets (iterable) – Iterable of xarray.DataArray objects to save using this writer.
- compute (bool) – If True (default), compute all of the saves to disk. If False then the return value is either a dask.delayed.Delayed object or two lists to be passed to a dask.array.store call. See return values below for more details.
- **kwargs – Keyword arguments to pass to save_dataset. See that documentation for more details.
Returns: Value returned depends on compute keyword argument. If compute is True the value is the result of a either a dask.array.store operation or a dask.delayed.Delayed compute, typically this is None. If compute is False then the result is either a dask.delayed.Delayed object that can be computed with delayed.compute() or a two element tuple of sources and targets to be passed to dask.array.store. If targets is provided then it is the caller’s responsibility to close any objects that have a “close” method.
-
classmethod
separate_init_kwargs
(kwargs)¶ Helper class method to separate arguments between init and save methods.
Currently the
Scene
is passed one set of arguments to represent the Writer creation and saving steps. This is not preferred for Writer structure, but provides a simpler interface to users. This method splits the provided keyword arguments between those needed for initialization and those needed for thesave_dataset
andsave_datasets
method calls.Writer subclasses should try to prefer keyword arguments only for the save methods only and leave the init keyword arguments to the base classes when possible.
-
-
class
satpy.writers.scmi.
TileInfo
(tile_count, image_shape, tile_shape, tile_row_offset, tile_column_offset, tile_id, x, y, tile_slices, data_slices)¶ Bases:
tuple
Create new instance of TileInfo(tile_count, image_shape, tile_shape, tile_row_offset, tile_column_offset, tile_id, x, y, tile_slices, data_slices)
-
data_slices
¶ Alias for field number 9
-
image_shape
¶ Alias for field number 1
-
tile_column_offset
¶ Alias for field number 4
-
tile_count
¶ Alias for field number 0
-
tile_id
¶ Alias for field number 5
-
tile_row_offset
¶ Alias for field number 3
-
tile_shape
¶ Alias for field number 2
-
tile_slices
¶ Alias for field number 8
-
x
¶ Alias for field number 6
-
y
¶ Alias for field number 7
-
-
class
satpy.writers.scmi.
XYFactors
(mx, bx, my, by)¶ Bases:
tuple
Create new instance of XYFactors(mx, bx, my, by)
-
bx
¶ Alias for field number 1
-
by
¶ Alias for field number 3
-
mx
¶ Alias for field number 0
-
my
¶ Alias for field number 2
-
-
satpy.writers.scmi.
add_backend_argument_groups
(parser)¶
-
satpy.writers.scmi.
create_debug_lettered_tiles
(init_args, create_args)¶
-
satpy.writers.scmi.
draw_rectangle
(draw, coordinates, outline=None, fill=None, width=1)¶
-
satpy.writers.scmi.
fix_awips_file
(fn)¶
-
satpy.writers.scmi.
main
()¶
satpy.writers.simple_image module¶
-
class
satpy.writers.simple_image.
PillowWriter
(**kwargs)¶ Bases:
satpy.writers.ImageWriter
-
save_image
(img, filename=None, compute=True, **kwargs)¶ Save Image object to a given
filename
.Parameters: - img (trollimage.xrimage.XRImage) – Image object to save to disk.
- filename (str) – Optionally specify the filename to save this dataset to. It may include string formatting patterns that will be filled in by dataset attributes.
- compute (bool) – If True (default), compute and save the dataset. If False return either a dask.delayed.Delayed object or tuple of (source, target). See the return values below for more information.
- **kwargs – Keyword arguments to pass to the images save method.
Returns: Value returned depends on compute. If compute is True then the return value is the result of computing a dask.delayed.Delayed object or running dask.array.store. If compute is False then the returned value is either a dask.delayed.Delayed object that can be computed using delayed.compute() or a tuple of (source, target) that should be passed to dask.array.store. If target is provided the the caller is responsible for calling target.close() if the target has this method.
-
Module contents¶
Shared objects of the various writer classes.
For now, this includes enhancement configuration utilities.
-
class
satpy.writers.
DecisionTree
(decision_dicts, attrs, **kwargs)¶ Bases:
object
-
add_config_to_tree
(*decision_dicts)¶
-
any_key
= None¶
-
find_match
(**kwargs)¶
-
-
class
satpy.writers.
EnhancementDecisionTree
(*decision_dicts, **kwargs)¶ Bases:
satpy.writers.DecisionTree
-
add_config_to_tree
(*decision_dict)¶
-
find_match
(**kwargs)¶
-
-
class
satpy.writers.
Enhancer
(ppp_config_dir=None, enhancement_config_file=None)¶ Bases:
object
Helper class to get enhancement information for images.
Initialize an Enhancer instance.
Parameters: - ppp_config_dir – Points to the base configuration directory
- enhancement_config_file – The enhancement configuration to apply, False to leave as is.
-
add_sensor_enhancements
(sensor)¶
-
apply
(img, **info)¶
-
get_sensor_enhancement_config
(sensor)¶
-
class
satpy.writers.
ImageWriter
(name=None, filename=None, base_dir=None, enhance=None, enhancement_config=None, **kwargs)¶ Bases:
satpy.writers.Writer
Base writer for image file formats.
Initialize image writer object.
Parameters: - name (str) – A name for this writer for log and error messages. If this writer is configured in a YAML file its name should match the name of the YAML file. Writer names may also appear in output file attributes.
- filename (str) –
Filename to save data to. This filename can and should specify certain python string formatting fields to differentiate between data written to the files. Any attributes provided by the
.attrs
of a DataArray object may be included. Format and conversion specifiers provided by thetrollsift
package may also be used. Any directories in the provided pattern will be created if they do not exist. Example:{platform_name}_{sensor}_{name}_{start_time:%Y%m%d_%H%M%S.tif
- base_dir (str) – Base destination directories for all created files.
- enhance (bool or Enhancer) – Whether to automatically enhance
data to be more visually useful and to fit inside the file
format being saved to. By default this will default to using
the enhancement configuration files found using the default
Enhancer
class. This can be set to False so that no enhancments are performed. This can also be an instance of theEnhancer
class if further custom enhancement is needed. - enhancement_config (str) – Deprecated.
- kwargs (dict) – Additional keyword arguments to pass to the
Writer
base class.
Changed in version 0.10: Deprecated enhancement_config_file and ‘enhancer’ in favor of enhance. Pass an instance of the Enhancer class to enhance instead.
-
save_dataset
(dataset, filename=None, fill_value=None, overlay=None, decorate=None, compute=True, **kwargs)¶ Saves the
dataset
to a givenfilename
.This method creates an enhanced image using get_enhanced_image. The image is then passed to save_image. See both of these functions for more details on the arguments passed to this method.
-
save_image
(img, filename=None, compute=True, **kwargs)¶ Save Image object to a given
filename
.Parameters: - img (trollimage.xrimage.XRImage) – Image object to save to disk.
- filename (str) – Optionally specify the filename to save this dataset to. It may include string formatting patterns that will be filled in by dataset attributes.
- compute (bool) – If True (default), compute and save the dataset. If False return either a dask.delayed.Delayed object or tuple of (source, target). See the return values below for more information.
- **kwargs – Other keyword arguments to pass to this writer.
Returns: Value returned depends on compute. If compute is True then the return value is the result of computing a dask.delayed.Delayed object or running dask.array.store. If compute is False then the returned value is either a dask.delayed.Delayed object that can be computed using delayed.compute() or a tuple of (source, target) that should be passed to dask.array.store. If target is provided the the caller is responsible for calling target.close() if the target has this method.
-
classmethod
separate_init_kwargs
(kwargs)¶ Helper class method to separate arguments between init and save methods.
Currently the
Scene
is passed one set of arguments to represent the Writer creation and saving steps. This is not preferred for Writer structure, but provides a simpler interface to users. This method splits the provided keyword arguments between those needed for initialization and those needed for thesave_dataset
andsave_datasets
method calls.Writer subclasses should try to prefer keyword arguments only for the save methods only and leave the init keyword arguments to the base classes when possible.
-
class
satpy.writers.
Writer
(name=None, filename=None, base_dir=None, **kwargs)¶ Bases:
satpy.plugin_base.Plugin
Base Writer class for all other writers.
A minimal writer subclass should implement the save_dataset method.
Initialize the writer object.
Parameters: - name (str) – A name for this writer for log and error messages. If this writer is configured in a YAML file its name should match the name of the YAML file. Writer names may also appear in output file attributes.
- filename (str) –
Filename to save data to. This filename can and should specify certain python string formatting fields to differentiate between data written to the files. Any attributes provided by the
.attrs
of a DataArray object may be included. Format and conversion specifiers provided by thetrollsift
package may also be used. Any directories in the provided pattern will be created if they do not exist. Example:{platform_name}_{sensor}_{name}_{start_time:%Y%m%d_%H%M%S.tif
- base_dir (str) – Base destination directories for all created files.
- kwargs (dict) – Additional keyword arguments to pass to the
Plugin
class.
-
create_filename_parser
(base_dir)¶ Create a
trollsift.parser.Parser
object for later use.
-
get_filename
(**kwargs)¶ Create a filename where output data will be saved.
Parameters: kwargs (dict) – Attributes and other metadata to use for formatting the previously provided filename.
-
save_dataset
(dataset, filename=None, fill_value=None, compute=True, **kwargs)¶ Saves the
dataset
to a givenfilename
.This method must be overloaded by the subclass.
Parameters: - dataset (xarray.DataArray) – Dataset to save using this writer.
- filename (str) – Optionally specify the filename to save this dataset to. If not provided then filename which can be provided to the init method will be used and formatted by dataset attributes.
- fill_value (int or float) – Replace invalid values in the dataset with this fill value if applicable to this writer.
- compute (bool) – If True (default), compute and save the dataset. If False return either a dask.delayed.Delayed object or tuple of (source, target). See the return values below for more information.
- **kwargs – Other keyword arguments for this particular writer.
Returns: Value returned depends on compute. If compute is True then the return value is the result of computing a dask.delayed.Delayed object or running dask.array.store. If compute is False then the returned value is either a dask.delayed.Delayed object that can be computed using delayed.compute() or a tuple of (source, target) that should be passed to dask.array.store. If target is provided the the caller is responsible for calling target.close() if the target has this method.
-
save_datasets
(datasets, compute=True, **kwargs)¶ Save all datasets to one or more files.
Subclasses can use this method to save all datasets to one single file or optimize the writing of individual datasets. By default this simply calls save_dataset for each dataset provided.
Parameters: - datasets (iterable) – Iterable of xarray.DataArray objects to save using this writer.
- compute (bool) – If True (default), compute all of the saves to disk. If False then the return value is either a dask.delayed.Delayed object or two lists to be passed to a dask.array.store call. See return values below for more details.
- **kwargs – Keyword arguments to pass to save_dataset. See that documentation for more details.
Returns: Value returned depends on compute keyword argument. If compute is True the value is the result of a either a dask.array.store operation or a dask.delayed.Delayed compute, typically this is None. If compute is False then the result is either a dask.delayed.Delayed object that can be computed with delayed.compute() or a two element tuple of sources and targets to be passed to dask.array.store. If targets is provided then it is the caller’s responsibility to close any objects that have a “close” method.
-
classmethod
separate_init_kwargs
(kwargs)¶ Helper class method to separate arguments between init and save methods.
Currently the
Scene
is passed one set of arguments to represent the Writer creation and saving steps. This is not preferred for Writer structure, but provides a simpler interface to users. This method splits the provided keyword arguments between those needed for initialization and those needed for thesave_dataset
andsave_datasets
method calls.Writer subclasses should try to prefer keyword arguments only for the save methods only and leave the init keyword arguments to the base classes when possible.
-
satpy.writers.
add_decorate
(orig, fill_value=None, **decorate)¶ Decorate an image with text and/or logos/images.
This call adds text/logos in order as given in the input to keep the alignment features available in pydecorate.
An example of the decorate config:
decorate = { 'decorate': [ {'logo': {'logo_path': <path to a logo>, 'height': 143, 'bg': 'white', 'bg_opacity': 255}}, {'text': {'txt': start_time_txt, 'align': {'top_bottom': 'bottom', 'left_right': 'right'}, 'font': <path to ttf font>, 'font_size': 22, 'height': 30, 'bg': 'black', 'bg_opacity': 255, 'line': 'white'}} ] }
Any numbers of text/logo in any order can be added to the decorate list, but the order of the list is kept as described above.
Note that a feature given in one element, eg. bg (which is the background color) will also apply on the next elements unless a new value is given.
align is a special keyword telling where in the image to start adding features, top_bottom is either top or bottom and left_right is either left or right.
-
satpy.writers.
add_logo
(orig, dc, img, logo=None)¶ Add logos or other images to an image using the pydecorate package.
All the features of pydecorate’s
add_logo
are available. See documentation of pydecorate:index for more info.
-
satpy.writers.
add_overlay
(orig, area, coast_dir, color=(0, 0, 0), width=0.5, resolution=None, level_coast=1, level_borders=1, fill_value=None)¶ Add coastline and political borders to image.
Uses
color
for feature colors wherecolor
is a 3-element tuple of integers between 0 and 255 representing (R, G, B).Warning
This function currently loses the data mask (alpha band).
resolution
is chosen automatically if None (default), otherwise it should be one of:‘f’ ‘h’ ‘i’ ‘l’ ‘c’ Full resolution High resolution Intermediate resolution Low resolution Crude resolution 0.04 km 0.2 km 1.0 km 5.0 km 25 km
-
satpy.writers.
add_text
(orig, dc, img, text=None)¶ Add text to an image using the pydecorate package.
All the features of pydecorate’s
add_text
are available. See documentation of pydecorate:index for more info.
-
satpy.writers.
available_writers
(as_dict=False)¶ Available writers based on current configuration.
Parameters: as_dict (bool) – Optionally return writer information as a dictionary. Default: False - Returns: List of available writer names. If as_dict is True then
- a list of dictionaries including additionally writer information is returned.
-
satpy.writers.
compute_writer_results
(results)¶ Compute all the given dask graphs results so that the files are saved.
Parameters: results (iterable) – Iterable of dask graphs resulting from calls to scn.save_datasets(…, compute=False)
-
satpy.writers.
configs_for_writer
(writer=None, ppp_config_dir=None)¶ Generator of writer configuration files for one or more writers
Parameters: - writer (Optional[str]) – Yield configs only for this writer
- ppp_config_dir (Optional[str]) – Additional configuration directory to search for writer configuration files.
Returns: Generator of lists of configuration files
-
satpy.writers.
get_enhanced_image
(dataset, ppp_config_dir=None, enhance=None, enhancement_config_file=None, overlay=None, decorate=None, fill_value=None)¶ Get an enhanced version of dataset as an
XRImage
instance.Parameters: - dataset (xarray.DataArray) – Data to be enhanced and converted to an image.
- ppp_config_dir (str) – Root configuration directory.
- enhance (bool or Enhancer) – Whether to automatically enhance
data to be more visually useful and to fit inside the file
format being saved to. By default this will default to using
the enhancement configuration files found using the default
Enhancer
class. This can be set to False so that no enhancments are performed. This can also be an instance of theEnhancer
class if further custom enhancement is needed. - enhancement_config_file (str) – Deprecated.
- overlay (dict) – Options for image overlays. See
add_overlay()
for available options. - decorate (dict) – Options for decorating the image. See
add_decorate()
for available options. - fill_value (int or float) – Value to use when pixels are masked or
invalid. Default of None means to create an alpha channel.
See
finalize()
for more details. Only used when adding overlays or decorations. Otherwise it is up to the caller to “finalize” the image before using it except if callingimg.show()
or providing the image to a writer as these will finalize the image.
Changed in version 0.10: Deprecated enhancement_config_file and ‘enhancer’ in favor of enhance. Pass an instance of the Enhancer class to enhance instead.
-
satpy.writers.
load_writer
(writer, ppp_config_dir=None, **writer_kwargs)¶ Find and load writer writer in the available configuration files.
-
satpy.writers.
load_writer_configs
(writer_configs, ppp_config_dir, **writer_kwargs)¶ Load the writer from the provided writer_configs.
-
satpy.writers.
read_writer_config
(config_files, loader=<class 'yaml.loader.Loader'>)¶ Read the writer config_files and return the info extracted.
-
satpy.writers.
show
(dataset, **kwargs)¶ Display the dataset as an image.
-
satpy.writers.
split_results
(results)¶ Get sources, targets and delayed objects to separate lists from a list of results collected from (multiple) writer(s).
-
satpy.writers.
to_image
(dataset)¶