|
| 1 | +#!/usr/bin/env python |
| 2 | +# -*- coding: utf-8 -*- |
| 3 | +# Copyright (c) 2019 level1c4pps developers |
| 4 | +# |
| 5 | +# This file is part of level1c4pps |
| 6 | +# |
| 7 | +# level1c4pps is free software: you can redistribute it and/or modify it |
| 8 | +# under the terms of the GNU General Public License as published by |
| 9 | +# the Free Software Foundation, either version 3 of the License, or |
| 10 | +# (at your option) any later version. |
| 11 | +# |
| 12 | +# level1c4pps is distributed in the hope that it will be useful, but |
| 13 | +# WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | +# General Public License for more details. |
| 16 | +# |
| 17 | +# You should have received a copy of the GNU General Public License |
| 18 | +# along with level1c4pps. If not, see <http://www.gnu.org/licenses/>. |
| 19 | +# Author(s): |
| 20 | + |
| 21 | +# Martin Raspaud <martin.raspaud@smhi.se> |
| 22 | +# Nina Hakansson <nina.hakansson@smhi.se> |
| 23 | +# Adam.Dybbroe <adam.dybbroe@smhi.se> |
| 24 | + |
| 25 | +"""Script to convert MERSI-2 level-1 to PPS level-1c format using Pytroll/Satpy.""" |
| 26 | + |
| 27 | +import argparse |
| 28 | +from level1c4pps.mersi2pps_lib import process_one_scene |
| 29 | + |
| 30 | + |
| 31 | +if __name__ == "__main__": |
| 32 | + """ Create PPS-format level1c data |
| 33 | + From a list of MERSI-2/3 level-1 files create a NWCSAF/PPS formatet level1c file for pps. |
| 34 | + """ |
| 35 | + parser = argparse.ArgumentParser( |
| 36 | + description=('Script to produce a PPS-level1c file for a MERSI-2/3 level-1 scene')) |
| 37 | + parser.add_argument('files', metavar='fileN', type=str, nargs='+', |
| 38 | + help='List of MERSI-2/3 files to process') |
| 39 | + parser.add_argument('-o', '--out_dir', type=str, nargs='?', |
| 40 | + required=False, default='.', |
| 41 | + help="Output directory where to store the level1c file") |
| 42 | + parser.add_argument('-ne', '--nc_engine', type=str, nargs='?', |
| 43 | + required=False, default='h5netcdf', |
| 44 | + help="Engine for saving netcdf files netcdf4 or h5netcdf (default).") |
| 45 | + parser.add_argument('-on', '--orbit_number', type=int, nargs='?', |
| 46 | + required=False, default=0, |
| 47 | + help="Orbit number (default is 00000).") |
| 48 | + options = parser.parse_args() |
| 49 | + process_one_scene(options.files, options.out_dir, engine=options.nc_engine, |
| 50 | + orbit_n=options.orbit_number) |
0 commit comments