Commit e7de75b4 authored by GROUAZEL's avatar GROUAZEL
Browse files

fix doc and import to cerinterp

parent 14615e1f
# -*- coding: utf-8 -*-
"""
cerbere.utils.resampler
cerinterp.resampler
=======================
Class for the resampling of features
......@@ -15,7 +15,7 @@ import logging
import copy
import numpy
from collections import OrderedDict
from pyresample import kd_tree, geometry
from pyresample import kd_tree, geometry,utils
from scipy import interpolate, ndimage
from scipy.stats import nanmean
import pdb
......@@ -301,6 +301,9 @@ class Resampler(object):
`pyresample <https://pyresample.readthedocs.org/en/latest/index.html>`_
package documentation.
"""
logging.info('%s %s | __get_pyresample_def',__name__,__file__)
if (srclon>180).any():
srclon = utils.wrap_longitudes(srclon)
if srcmodel == 'Swath' or srcmodel == 'Image' or \
srcmodel == 'Trajectory':
source_def = geometry.SwathDefinition(lons=srclon,
......@@ -309,6 +312,7 @@ class Resampler(object):
elif srcmodel == 'Grid':
if len(srclon.shape) == 1:
srclon, srclat = numpy.meshgrid(srclon, srclat)
source_def = geometry.GridDefinition(lons=srclon,
lats=srclat
)
......@@ -327,7 +331,7 @@ class Resampler(object):
y, x = srclat.shape
resolution = abs(srclat[y / 2, x / 2] - srclat[y / 2 + 1, x / 2])
radius = resolution * 100000. / 2. * 1.6
logging.debug("Radius for resampling : %s", radius)
logging.info("Radius for resampling : %s", radius)
return source_def, target_def, radius
@classmethod
......
=======================================
Welcome to cerbere-utils documentation!
Welcome to cerinterp documentation!
=======================================
*cerbere-utils* is a collection of modules to perform classic operations on
*cerinterp* is a collection of modules to perform classic operations on
EO data such as:
* resampling a feature on top of another
* adding information such as bathymetry, distance to coast or tide
......@@ -18,15 +18,6 @@ package) and features (datamodel package).
Reference documentation
=======================
.. toctree::
:maxdepth: 2
api/cerbereutils
Utilities
=========
.. toctree::
:maxdepth: 2
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment