/usr/share/doc/python-mpop/html/image.html is in python-mpop 1.0.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Geographic images — mpop v1.0.0 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: 'v1.0.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="mpop v1.0.0 documentation" href="index.html" />
<link rel="next" title="Tools for batch production" href="saturn.html" />
<link rel="prev" title="Input plugins: the mpop.satin package" href="input.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="saturn.html" title="Tools for batch production"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="input.html" title="Input plugins: the mpop.satin package"
accesskey="P">previous</a> |</li>
<li><a href="index.html">mpop v1.0.0 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="geographic-images">
<span id="id1"></span><h1>Geographic images<a class="headerlink" href="#geographic-images" title="Permalink to this headline">¶</a></h1>
<p>In order to build satellite composites, mpop has to handle images. We could
have used PIL, but we felt the need to use numpy masked arrays as base for our
image channels, and we had to handle geographically enriched images. Hence the
two following modules: <a class="reference internal" href="#module-mpop.imageo.image" title="mpop.imageo.image"><tt class="xref py py-mod docutils literal"><span class="pre">mpop.imageo.image</span></tt></a> to handle simple images, and
<a class="reference internal" href="#module-mpop.imageo.geo_image" title="mpop.imageo.geo_image"><tt class="xref py py-mod docutils literal"><span class="pre">mpop.imageo.geo_image</span></tt></a>.</p>
<div class="section" id="module-mpop.imageo.image">
<span id="simple-images"></span><h2>Simple images<a class="headerlink" href="#module-mpop.imageo.image" title="Permalink to this headline">¶</a></h2>
<p>This module defines the image class. It overlaps largely the PIL library,
but has the advandage of using masked arrays as pixel arrays, so that data
arrays containing invalid values may be properly handled.</p>
<dl class="class">
<dt id="mpop.imageo.image.Image">
<em class="property">class </em><tt class="descclassname">mpop.imageo.image.</tt><tt class="descname">Image</tt><big>(</big><em>channels=None</em>, <em>mode='L'</em>, <em>color_range=None</em>, <em>fill_value=None</em>, <em>palette=None</em><big>)</big><a class="headerlink" href="#mpop.imageo.image.Image" title="Permalink to this definition">¶</a></dt>
<dd><p>This class defines images. As such, it contains data of the different
<em>channels</em> of the image (red, green, and blue for example). The <em>mode</em>
tells if the channels define a black and white image (“L”), an rgb image
(“RGB”), an YCbCr image (“YCbCr”), or an indexed image (“P”), in which case
a <em>palette</em> is needed. Each mode has also a corresponding alpha mode, which
is the mode with an “A” in the end: for example “RGBA” is rgb with an alpha
channel. <em>fill_value</em> sets how the image is filled where data is missing,
since channels are numpy masked arrays. Setting it to (0,0,0) in RGB mode
for example will produce black where data is missing.”None” (default) will
produce transparency (thus adding an alpha channel) if the file format
allows it, black otherwise.</p>
<p>The channels are considered to contain floating point values in the range
[0.0,1.0]. In order to normalize the input data, the <em>color_range</em>
parameter defines the original range of the data. The conversion to the
classical [0,255] range and byte type is done automagically when saving the
image to file.</p>
<dl class="attribute">
<dt id="mpop.imageo.image.Image.channels">
<tt class="descname">channels</tt><em class="property"> = None</em><a class="headerlink" href="#mpop.imageo.image.Image.channels" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="mpop.imageo.image.Image.clip">
<tt class="descname">clip</tt><big>(</big><em>channels=True</em><big>)</big><a class="headerlink" href="#mpop.imageo.image.Image.clip" title="Permalink to this definition">¶</a></dt>
<dd><p>Limit the values of the array to the default [0,1] range. <em>channels</em>
says which channels should be clipped.</p>
</dd></dl>
<dl class="method">
<dt id="mpop.imageo.image.Image.convert">
<tt class="descname">convert</tt><big>(</big><em>mode</em><big>)</big><a class="headerlink" href="#mpop.imageo.image.Image.convert" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert the current image to the given <em>mode</em>. See <a class="reference internal" href="#mpop.imageo.image.Image" title="mpop.imageo.image.Image"><tt class="xref py py-class docutils literal"><span class="pre">Image</span></tt></a>
for a list of available modes.</p>
</dd></dl>
<dl class="method">
<dt id="mpop.imageo.image.Image.crude_stretch">
<tt class="descname">crude_stretch</tt><big>(</big><em>ch_nb</em>, <em>min_stretch=None</em>, <em>max_stretch=None</em><big>)</big><a class="headerlink" href="#mpop.imageo.image.Image.crude_stretch" title="Permalink to this definition">¶</a></dt>
<dd><p>Perform simple linear stretching (without any cutoff) on the channel
<em>ch_nb</em> of the current image and normalize to the [0,1] range.</p>
</dd></dl>
<dl class="method">
<dt id="mpop.imageo.image.Image.enhance">
<tt class="descname">enhance</tt><big>(</big><em>inverse=False</em>, <em>gamma=1.0</em>, <em>stretch='no'</em><big>)</big><a class="headerlink" href="#mpop.imageo.image.Image.enhance" title="Permalink to this definition">¶</a></dt>
<dd><p>Image enhancement function. It applies <strong>in this order</strong> inversion,
gamma correction, and stretching to the current image, with parameters
<em>inverse</em> (see <a class="reference internal" href="#mpop.imageo.image.Image.invert" title="mpop.imageo.image.Image.invert"><tt class="xref py py-meth docutils literal"><span class="pre">Image.invert()</span></tt></a>), <em>gamma</em> (see
<a class="reference internal" href="#mpop.imageo.image.Image.gamma" title="mpop.imageo.image.Image.gamma"><tt class="xref py py-meth docutils literal"><span class="pre">Image.gamma()</span></tt></a>), and <em>stretch</em> (see <a class="reference internal" href="#mpop.imageo.image.Image.stretch" title="mpop.imageo.image.Image.stretch"><tt class="xref py py-meth docutils literal"><span class="pre">Image.stretch()</span></tt></a>).</p>
</dd></dl>
<dl class="attribute">
<dt id="mpop.imageo.image.Image.fill_value">
<tt class="descname">fill_value</tt><em class="property"> = None</em><a class="headerlink" href="#mpop.imageo.image.Image.fill_value" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="mpop.imageo.image.Image.gamma">
<tt class="descname">gamma</tt><big>(</big><em>gamma=1.0</em><big>)</big><a class="headerlink" href="#mpop.imageo.image.Image.gamma" title="Permalink to this definition">¶</a></dt>
<dd><p>Apply gamma correction to the channels of the image. If <em>gamma</em> is a
tuple, then it should have as many elements as the channels of the
image, and the gamma correction is applied elementwise. If <em>gamma</em> is a
number, the same gamma correction is applied on every channel, if there
are several channels in the image. The behaviour of <a class="reference internal" href="#mpop.imageo.image.Image.gamma" title="mpop.imageo.image.Image.gamma"><tt class="xref py py-func docutils literal"><span class="pre">gamma()</span></tt></a> is
undefined outside the normal [0,1] range of the channels.</p>
</dd></dl>
<dl class="attribute">
<dt id="mpop.imageo.image.Image.height">
<tt class="descname">height</tt><em class="property"> = 0</em><a class="headerlink" href="#mpop.imageo.image.Image.height" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="mpop.imageo.image.Image.invert">
<tt class="descname">invert</tt><big>(</big><em>invert=True</em><big>)</big><a class="headerlink" href="#mpop.imageo.image.Image.invert" title="Permalink to this definition">¶</a></dt>
<dd><p>Inverts all the channels of a image according to <em>invert</em>. If invert
is a tuple or a list, elementwise invertion is performed, otherwise all
channels are inverted if <em>invert</em> is true (default).</p>
</dd></dl>
<dl class="method">
<dt id="mpop.imageo.image.Image.is_empty">
<tt class="descname">is_empty</tt><big>(</big><big>)</big><a class="headerlink" href="#mpop.imageo.image.Image.is_empty" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks for an empty image.</p>
</dd></dl>
<dl class="method">
<dt id="mpop.imageo.image.Image.merge">
<tt class="descname">merge</tt><big>(</big><em>img</em><big>)</big><a class="headerlink" href="#mpop.imageo.image.Image.merge" title="Permalink to this definition">¶</a></dt>
<dd><p>Use the provided image as background for the current <em>img</em> image,
that is if the current image has missing data.</p>
</dd></dl>
<dl class="attribute">
<dt id="mpop.imageo.image.Image.mode">
<tt class="descname">mode</tt><em class="property"> = None</em><a class="headerlink" href="#mpop.imageo.image.Image.mode" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="mpop.imageo.image.Image.modes">
<tt class="descname">modes</tt><em class="property"> = ['L', 'LA', 'RGB', 'RGBA', 'YCbCr', 'YCbCrA', 'P', 'PA']</em><a class="headerlink" href="#mpop.imageo.image.Image.modes" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="mpop.imageo.image.Image.palette">
<tt class="descname">palette</tt><em class="property"> = None</em><a class="headerlink" href="#mpop.imageo.image.Image.palette" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="mpop.imageo.image.Image.pil_image">
<tt class="descname">pil_image</tt><big>(</big><big>)</big><a class="headerlink" href="#mpop.imageo.image.Image.pil_image" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a PIL image from the current image.</p>
</dd></dl>
<dl class="method">
<dt id="mpop.imageo.image.Image.pil_save">
<tt class="descname">pil_save</tt><big>(</big><em>filename</em>, <em>compression=6</em>, <em>fformat=None</em><big>)</big><a class="headerlink" href="#mpop.imageo.image.Image.pil_save" title="Permalink to this definition">¶</a></dt>
<dd><p>Save the image to the given <em>filename</em> using PIL. For now, the
compression level [0-9] is ignored, due to PIL’s lack of support. See
also <a class="reference internal" href="#mpop.imageo.image.Image.save" title="mpop.imageo.image.Image.save"><tt class="xref py py-meth docutils literal"><span class="pre">save()</span></tt></a>.</p>
</dd></dl>
<dl class="method">
<dt id="mpop.imageo.image.Image.putalpha">
<tt class="descname">putalpha</tt><big>(</big><em>alpha</em><big>)</big><a class="headerlink" href="#mpop.imageo.image.Image.putalpha" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds an <em>alpha</em> channel to the current image, or replaces it with
<em>alpha</em> if it already exists.</p>
</dd></dl>
<dl class="method">
<dt id="mpop.imageo.image.Image.replace_luminance">
<tt class="descname">replace_luminance</tt><big>(</big><em>luminance</em><big>)</big><a class="headerlink" href="#mpop.imageo.image.Image.replace_luminance" title="Permalink to this definition">¶</a></dt>
<dd><p>Replace the Y channel of the image by the array <em>luminance</em>. If the
image is not in YCbCr mode, it is converted automatically to and
from that mode.</p>
</dd></dl>
<dl class="method">
<dt id="mpop.imageo.image.Image.resize">
<tt class="descname">resize</tt><big>(</big><em>shape</em><big>)</big><a class="headerlink" href="#mpop.imageo.image.Image.resize" title="Permalink to this definition">¶</a></dt>
<dd><p>Resize the image to the given <em>shape</em> tuple, in place. For zooming,
nearest neighbour method is used, while for shrinking, decimation is
used. Therefore, <em>shape</em> must be a multiple or a divisor of the image
shape.</p>
</dd></dl>
<dl class="method">
<dt id="mpop.imageo.image.Image.save">
<tt class="descname">save</tt><big>(</big><em>filename</em>, <em>compression=6</em>, <em>fformat=None</em><big>)</big><a class="headerlink" href="#mpop.imageo.image.Image.save" title="Permalink to this definition">¶</a></dt>
<dd><p>Save the image to the given <em>filename</em>.</p>
</dd></dl>
<dl class="attribute">
<dt id="mpop.imageo.image.Image.shape">
<tt class="descname">shape</tt><em class="property"> = None</em><a class="headerlink" href="#mpop.imageo.image.Image.shape" title="Permalink to this definition">¶</a></dt>
<dd><p>Shape (dimensions) of the image.</p>
</dd></dl>
<dl class="method">
<dt id="mpop.imageo.image.Image.show">
<tt class="descname">show</tt><big>(</big><big>)</big><a class="headerlink" href="#mpop.imageo.image.Image.show" title="Permalink to this definition">¶</a></dt>
<dd><p>Display the image on screen.</p>
</dd></dl>
<dl class="method">
<dt id="mpop.imageo.image.Image.stretch">
<tt class="descname">stretch</tt><big>(</big><em>stretch='no'</em>, <em>**kwarg</em><big>)</big><a class="headerlink" href="#mpop.imageo.image.Image.stretch" title="Permalink to this definition">¶</a></dt>
<dd><p>Apply stretching to the current image. The value of <em>stretch</em> sets
the type of stretching applied. The values “histogram”, “linear”,
“crude” (or “crude-stretch”) perform respectively histogram
equalization, contrast stretching (with 5% cutoff on both sides), and
contrast stretching without cutoff. The value “logarithmic” or “log”
will do a logarithmic enhancement towards white. If a tuple or a list
of two values is given as input, then a contrast stretching is performed
with the values as cutoff. These values should be normalized in the
range [0.0,1.0].</p>
</dd></dl>
<dl class="method">
<dt id="mpop.imageo.image.Image.stretch_hist_equalize">
<tt class="descname">stretch_hist_equalize</tt><big>(</big><em>ch_nb</em><big>)</big><a class="headerlink" href="#mpop.imageo.image.Image.stretch_hist_equalize" title="Permalink to this definition">¶</a></dt>
<dd><p>Stretch the current image’s colors by performing histogram
equalization on channel <em>ch_nb</em>.</p>
</dd></dl>
<dl class="method">
<dt id="mpop.imageo.image.Image.stretch_linear">
<tt class="descname">stretch_linear</tt><big>(</big><em>ch_nb</em>, <em>cutoffs=(0.005</em>, <em>0.005)</em><big>)</big><a class="headerlink" href="#mpop.imageo.image.Image.stretch_linear" title="Permalink to this definition">¶</a></dt>
<dd><p>Stretch linearly the contrast of the current image on channel
<em>ch_nb</em>, using <em>cutoffs</em> for left and right trimming.</p>
</dd></dl>
<dl class="method">
<dt id="mpop.imageo.image.Image.stretch_logarithmic">
<tt class="descname">stretch_logarithmic</tt><big>(</big><em>ch_nb</em>, <em>factor=100.0</em><big>)</big><a class="headerlink" href="#mpop.imageo.image.Image.stretch_logarithmic" title="Permalink to this definition">¶</a></dt>
<dd><p>Move data into range [1:factor] and do a normalized logarithmic
enhancement.</p>
</dd></dl>
<dl class="attribute">
<dt id="mpop.imageo.image.Image.width">
<tt class="descname">width</tt><em class="property"> = 0</em><a class="headerlink" href="#mpop.imageo.image.Image.width" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="exception">
<dt id="mpop.imageo.image.UnknownImageFormat">
<em class="property">exception </em><tt class="descclassname">mpop.imageo.image.</tt><tt class="descname">UnknownImageFormat</tt><a class="headerlink" href="#mpop.imageo.image.UnknownImageFormat" title="Permalink to this definition">¶</a></dt>
<dd><p>Exception to be raised when image format is unknown to MPOP</p>
</dd></dl>
<dl class="function">
<dt id="mpop.imageo.image.all">
<tt class="descclassname">mpop.imageo.image.</tt><tt class="descname">all</tt><big>(</big><em>iterable</em><big>)</big><a class="headerlink" href="#mpop.imageo.image.all" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="mpop.imageo.image.check_image_format">
<tt class="descclassname">mpop.imageo.image.</tt><tt class="descname">check_image_format</tt><big>(</big><em>fformat</em><big>)</big><a class="headerlink" href="#mpop.imageo.image.check_image_format" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="mpop.imageo.image.rgb2ycbcr">
<tt class="descclassname">mpop.imageo.image.</tt><tt class="descname">rgb2ycbcr</tt><big>(</big><em>r__</em>, <em>g__</em>, <em>b__</em><big>)</big><a class="headerlink" href="#mpop.imageo.image.rgb2ycbcr" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert the three RGB channels to YCbCr.</p>
</dd></dl>
<dl class="function">
<dt id="mpop.imageo.image.ycbcr2rgb">
<tt class="descclassname">mpop.imageo.image.</tt><tt class="descname">ycbcr2rgb</tt><big>(</big><em>y__</em>, <em>cb_</em>, <em>cr_</em><big>)</big><a class="headerlink" href="#mpop.imageo.image.ycbcr2rgb" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert the three YCbCr channels to RGB channels.</p>
</dd></dl>
</div>
<div class="section" id="module-mpop.imageo.geo_image">
<span id="geographically-enriched-images"></span><h2>Geographically enriched images<a class="headerlink" href="#module-mpop.imageo.geo_image" title="Permalink to this headline">¶</a></h2>
<p>Module for geographic images.</p>
<dl class="class">
<dt id="mpop.imageo.geo_image.GeoImage">
<em class="property">class </em><tt class="descclassname">mpop.imageo.geo_image.</tt><tt class="descname">GeoImage</tt><big>(</big><em>channels</em>, <em>area</em>, <em>time_slot</em>, <em>mode='L'</em>, <em>crange=None</em>, <em>fill_value=None</em>, <em>palette=None</em><big>)</big><a class="headerlink" href="#mpop.imageo.geo_image.GeoImage" title="Permalink to this definition">¶</a></dt>
<dd><p>This class defines geographic images. As such, it contains not only data
of the different <em>channels</em> of the image, but also the area on which it is
defined (<em>area</em> parameter) and <em>time_slot</em> of the snapshot.</p>
<p>The channels are considered to contain floating point values in the range
[0.0,1.0]. In order to normalize the input data, the <em>crange</em> parameter
defines the original range of the data. The conversion to the classical
[0,255] range and byte type is done automagically when saving the image to
file.</p>
<p>See also <tt class="xref py py-class docutils literal"><span class="pre">image.Image</span></tt> for more information.</p>
<dl class="method">
<dt id="mpop.imageo.geo_image.GeoImage.add_overlay">
<tt class="descname">add_overlay</tt><big>(</big><em>color=(0</em>, <em>0</em>, <em>0)</em>, <em>width=0.5</em>, <em>resolution=None</em><big>)</big><a class="headerlink" href="#mpop.imageo.geo_image.GeoImage.add_overlay" title="Permalink to this definition">¶</a></dt>
<dd><p>Add coastline and political borders to image, using <em>color</em> (tuple
of integers between 0 and 255).
Warning: Loses the masks !</p>
<p><em>resolution</em> is chosen automatically if None (default), otherwise it should be one of:
+—–+————————-+———+
| ‘f’ | Full resolution | 0.04 km |
| ‘h’ | High resolution | 0.2 km |
| ‘i’ | Intermediate resolution | 1.0 km |
| ‘l’ | Low resolution | 5.0 km |
| ‘c’ | Crude resolution | 25 km |
+—–+————————-+———+</p>
</dd></dl>
<dl class="method">
<dt id="mpop.imageo.geo_image.GeoImage.geotiff_save">
<tt class="descname">geotiff_save</tt><big>(</big><em>filename</em>, <em>compression=6</em>, <em>tags=None</em>, <em>gdal_options=None</em>, <em>blocksize=0</em>, <em>geotransform=None</em>, <em>spatialref=None</em>, <em>floating_point=False</em><big>)</big><a class="headerlink" href="#mpop.imageo.geo_image.GeoImage.geotiff_save" title="Permalink to this definition">¶</a></dt>
<dd><p>Save the image to the given <em>filename</em> in <a class="reference external" href="http://trac.osgeo.org/geotiff/">geotiff</a> format, with the
<em>compression</em> level in [0, 9]. 0 means not compressed. The <em>tags</em>
argument is a dict of tags to include in the image (as metadata). By
default it uses the ‘area’ instance to generate geotransform and
spatialref information, this can be overwritten by the arguments
<em>geotransform</em> and <em>spatialref</em>. <em>floating_point</em> allows the saving of
‘L’ mode images in floating point format if set to True.</p>
</dd></dl>
<dl class="method">
<dt id="mpop.imageo.geo_image.GeoImage.save">
<tt class="descname">save</tt><big>(</big><em>filename</em>, <em>compression=6</em>, <em>tags=None</em>, <em>gdal_options=None</em>, <em>fformat=None</em>, <em>blocksize=256</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#mpop.imageo.geo_image.GeoImage.save" title="Permalink to this definition">¶</a></dt>
<dd><p>Save the image to the given <em>filename</em>. If the extension is “tif”,
the image is saved to <a class="reference external" href="http://trac.osgeo.org/geotiff/">geotiff</a> format, in which case the <em>compression</em>
level can be given ([0, 9], 0 meaning off). See also
<tt class="xref py py-meth docutils literal"><span class="pre">image.Image.save()</span></tt>, <tt class="xref py py-meth docutils literal"><span class="pre">image.Image.double_save()</span></tt>, and
<tt class="xref py py-meth docutils literal"><span class="pre">image.Image.secure_save()</span></tt>. The <em>tags</em> argument is a dict of tags
to include in the image (as metadata), and the <em>gdal_options</em> holds
options for the gdal saving driver. A <em>blocksize</em> other than 0 will
result in a tiled image (if possible), with tiles of size equal to
<em>blocksize</em>.</p>
<p>If the specified format <em>fformat</em> is not know to MPOP (and PIL), we
will try to import module <em>fformat</em> and call the method <cite>fformat.save</cite>.</p>
</dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Geographic images</a><ul>
<li><a class="reference internal" href="#module-mpop.imageo.image">Simple images</a></li>
<li><a class="reference internal" href="#module-mpop.imageo.geo_image">Geographically enriched images</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="input.html"
title="previous chapter">Input plugins: the <tt class="docutils literal"><span class="pre">mpop.satin</span></tt> package</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="saturn.html"
title="next chapter">Tools for batch production</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/image.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="saturn.html" title="Tools for batch production"
>next</a> |</li>
<li class="right" >
<a href="input.html" title="Input plugins: the mpop.satin package"
>previous</a> |</li>
<li><a href="index.html">mpop v1.0.0 documentation</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2009-2013, The pytroll crew.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>
</html>
|