{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Sentinel 2 MSI true color\n", "\n", "Created with:\n", "\n", "Package | Version\n", "--- | ---\n", "SatPy | 0.9.0\n", "PyResample | 1.10.1\n", "Trollimage | 1.5.3\n", "PyKdtree | 1.3.1\n" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from satpy import Scene, find_files_and_readers\n", "\n", "files = find_files_and_readers(base_dir=\"/home/a000680/data/Sentinel-2/\",\n", " reader='msi_safe')\n", "scn = Scene(filenames=files)" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/home/a000680/.local/lib/python2.7/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.\n", " from ._conv import register_converters as _register_converters\n" ] }, { "data": { "text/plain": [ "" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "composite = 'true_color'\n", "scn.load([composite])\n", "scn.show(composite)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "scn.save_dataset(composite, './sentinel2_msi_%s_rgb_%s.png' %\n", " (composite, scn.attrs['start_time'].strftime('%Y%m%d%H%M')))" ] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.5" } }, "nbformat": 4, "nbformat_minor": 2 }