From 453de19387c6aa3d316c0a42dc26edef49de68af Mon Sep 17 00:00:00 2001 From: Martin Raspaud Date: Mon, 21 May 2012 20:31:49 +0200 Subject: [PATCH 1/5] Bumped up version number. --- doc/source/conf.py | 4 ++-- doc/source/pp.rst | 2 +- setup.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 9e6bb1c3..42273f33 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -22,7 +22,7 @@ # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage'] +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinxtogithub'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -47,7 +47,7 @@ # The short X.Y version. version = '0.11' # The full version, including alpha/beta/rc tags. -release = '0.11.3' +release = '0.11.5' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/source/pp.rst b/doc/source/pp.rst index 58d8458f..157fa58d 100644 --- a/doc/source/pp.rst +++ b/doc/source/pp.rst @@ -93,7 +93,7 @@ Adding a new satellite: configuration file A satellite configuration file looks like the following (here meteosat 7, mviri instrument): -.. literalinclude:: ../../../mpop-smhi/etc/meteosat07.cfg +.. literalinclude:: ../../../satprod/etc/meteosat07.cfg :language: ini :linenos: diff --git a/setup.py b/setup.py index 57135083..7ce2f2da 100644 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ NAME = 'mpop' setup(name=NAME, - version="v0.11.3", + version="v0.11.5", description='Meteorological post processing package', author='Martin Raspaud', author_email='martin.raspaud@smhi.se', @@ -50,7 +50,7 @@ "Programming Language :: Python", "Topic :: Scientific/Engineering"], url="https://github.com/mraspaud/mpop", - download_url="https://github.com/mraspaud/mpop/tarball/master#egg=mpop-v0.11.0", + download_url="https://github.com/mraspaud/mpop/tarball/master#egg=mpop-v0.11.5", packages=['mpop', 'mpop.satellites', 'mpop.instruments', 'mpop.satin', 'mpop.satout', 'mpop.saturn', 'mpop.imageo'], data_files=[('etc',[os.path.join('etc', 'geo_image.cfg')], @@ -70,7 +70,7 @@ os.path.join('doc', 'examples', 'polar_segments.py')])], zip_safe=False, requires=['numpy (>=1.4.1)'], - extras_require={ 'xRIT': ['mipp >= 0.6.0'], + extras_require={ 'xRIT': ['mipp >= 0.7.1'], 'proj': ['pyresample'], 'hdf_eos': ['pyhdf'], 'aapp': ['ahamap']} From a938106524d8c8fa2cdbf5e32da8a3cc9e865832 Mon Sep 17 00:00:00 2001 From: Sajid Pareeth Date: Sat, 19 Sep 2015 11:04:08 +0200 Subject: [PATCH 2/5] minor corr. on ascat driver --- mpop/satin/ascat_nc.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mpop/satin/ascat_nc.py b/mpop/satin/ascat_nc.py index 51f3c8cf..28682cea 100644 --- a/mpop/satin/ascat_nc.py +++ b/mpop/satin/ascat_nc.py @@ -46,9 +46,7 @@ def load(satscene): "satname": satscene.satname, "number": satscene.number, "instrument": satscene.instrument_name, - "satellite": satscene.fullname, - "time_slot": satscene.time_slot - "time": satscene.time_slot.strftime('%Y%m%d%H%M%S') + "satellite": satscene.fullname } filename = os.path.join( conf.get("ascat-level2", "dir"), From 395badb3a83f749c4c49ae83d91e9a5703272291 Mon Sep 17 00:00:00 2001 From: Sajid Pareeth Date: Thu, 10 Sep 2015 12:18:10 +0200 Subject: [PATCH 3/5] add new reader and config files for ASCAT SAR soil moisture level 2 netcdf data from EUMETSAT --- etc/metop.ASCAT.cfg.template | 62 ++++++++++++++++++++++++++++++++++++ mpop/satin/ascat_nc.py | 49 ++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+) create mode 100644 etc/metop.ASCAT.cfg.template create mode 100644 mpop/satin/ascat_nc.py diff --git a/etc/metop.ASCAT.cfg.template b/etc/metop.ASCAT.cfg.template new file mode 100644 index 00000000..0d92ce23 --- /dev/null +++ b/etc/metop.ASCAT.cfg.template @@ -0,0 +1,62 @@ +##Rename this file to metop.cfg to read ASCAT data +[satellite] +satname = metop +variant = +number = '' +instruments = ('ascat',) + +[ascat-level2] +filename = W_XX-EUMETSAT-Darmstadt,SURFACE+SATELLITE,METOPA+ASCAT_C_EUMP_%Y%m%d%H%M%S_%(orbit)s_eps_o_125_ssm_l2.nc +dir = ~/eumetsat/data +format = ascat_nc + +[ascat-1] +name = 'soil_moisture' + +[ascat-2] +name = 'soil_moisture_error' + +[ascat-3] +name = 'soil_moisture_sensitivity' + +[ascat-4] +name = 'mean_soil_moisture' + +[ascat-5] +name = 'sigma40' + +[ascat-6] +name = 'slope40_error' + +[ascat-7] +name = 'dry_backscatter' + +[ascat-8] +name = 'rainfall_flag' + +[ascat-9] +name = 'wet_backscatter' + +[ascat-10] +name = 'corr_flags' + +[ascat-11] +name = 'proc_flag1' + +[ascat-12] +name = 'proc_flag2' + +[ascat-13] +name = 'aggregated_quality_flag' + +[ascat-14] +name = 'snow_cover_probability' + +[ascat-15] +name = 'frozen_soil_probability' + +[ascat-16] +name = 'wetland_flag' + +[ascat-17] +name = 'topography_flag' diff --git a/mpop/satin/ascat_nc.py b/mpop/satin/ascat_nc.py new file mode 100644 index 00000000..bfe7e705 --- /dev/null +++ b/mpop/satin/ascat_nc.py @@ -0,0 +1,49 @@ +"""Loader for ascat, netcdf format. + The driver works for netcdf format of ASCAT soil moisture swath data downloaded from + here: http://navigator.eumetsat.int/discovery/Start/DirectSearch/DetailResult.do?f%28r0%29=EO:EUM:DAT:METOP:SOMO12 + rename the CONFIG file mpop/mpop/etc/metop.ascat.cfg.template to metop.cfg to read the ASCAT data +""" +import numpy as np +from ConfigParser import ConfigParser +from mpop import CONFIG_PATH +import os + +from netCDF4 import Dataset + + +def load(satscene): + """Load ascat data. + """ + + # Read config file content + conf = ConfigParser() + conf.read(os.path.join(CONFIG_PATH, satscene.fullname + ".cfg")) + values = {"orbit": satscene.orbit, + "satname": satscene.satname, + "number": satscene.number, + "instrument": satscene.instrument_name, + "satellite": satscene.fullname + } + filename = os.path.join( + conf.get("ascat-level2", "dir"), + satscene.time_slot.strftime(conf.get("ascat-level2", + "filename", + raw=True)) % values) + # Load data from netCDF file + ds = Dataset(filename, 'r') + for chn_name in satscene.channels_to_load: + # Read variable corresponding to channel name + data = np.ma.masked_array(ds.variables[chn_name][:],np.isnan(ds.variables[chn_name][:])) + satscene[chn_name] = data + lons = ds.variables['longitude'][:] + lats = ds.variables['latitude'][:] + + # Set scene area as pyresample geometry object + try: + from pyresample import geometry + satscene.area = geometry.SwathDefinition(lons=lons, lats=lats) + except ImportError: + # pyresample not available. Set lon and lats directly + satscene.area = None + satscene.lat = lats + satscene.lon = lons From 6af6531910de1380eb419a1cdb05d167ca79c3fd Mon Sep 17 00:00:00 2001 From: Sajid Pareeth Date: Thu, 10 Sep 2015 12:39:30 +0200 Subject: [PATCH 4/5] add new reader and config files for ASCAT SAR soil moisture level 2 netcdf data from EUMETSAT --- mpop/satin/ascat_nc.py | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/mpop/satin/ascat_nc.py b/mpop/satin/ascat_nc.py index bfe7e705..51f3c8cf 100644 --- a/mpop/satin/ascat_nc.py +++ b/mpop/satin/ascat_nc.py @@ -1,3 +1,27 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2014 Abhay Devasthale and Martin Raspaud + +# Author(s): + +# Martin Raspaud +# Adam Dybbroe +# Sajid Pareeth + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + """Loader for ascat, netcdf format. The driver works for netcdf format of ASCAT soil moisture swath data downloaded from here: http://navigator.eumetsat.int/discovery/Start/DirectSearch/DetailResult.do?f%28r0%29=EO:EUM:DAT:METOP:SOMO12 @@ -22,7 +46,9 @@ def load(satscene): "satname": satscene.satname, "number": satscene.number, "instrument": satscene.instrument_name, - "satellite": satscene.fullname + "satellite": satscene.fullname, + "time_slot": satscene.time_slot + "time": satscene.time_slot.strftime('%Y%m%d%H%M%S') } filename = os.path.join( conf.get("ascat-level2", "dir"), @@ -47,3 +73,5 @@ def load(satscene): satscene.area = None satscene.lat = lats satscene.lon = lons + + From 8b50cf2d13a3951db57a2460a701dc191402532b Mon Sep 17 00:00:00 2001 From: Sajid Pareeth Date: Sat, 19 Sep 2015 11:04:08 +0200 Subject: [PATCH 5/5] minor corr. on ascat driver --- mpop/satin/ascat_nc.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mpop/satin/ascat_nc.py b/mpop/satin/ascat_nc.py index 51f3c8cf..28682cea 100644 --- a/mpop/satin/ascat_nc.py +++ b/mpop/satin/ascat_nc.py @@ -46,9 +46,7 @@ def load(satscene): "satname": satscene.satname, "number": satscene.number, "instrument": satscene.instrument_name, - "satellite": satscene.fullname, - "time_slot": satscene.time_slot - "time": satscene.time_slot.strftime('%Y%m%d%H%M%S') + "satellite": satscene.fullname } filename = os.path.join( conf.get("ascat-level2", "dir"),