Commit 2021ae17 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Moved all pyresample imports to the top of the module to avoid Exception:...

Moved all pyresample imports to the top of the module to avoid Exception: dlopen: cannot load any more object with static TLS.
parent 5cbd75f8
Pipeline #3711 failed with stages
in 1 minute and 24 seconds
# -*- coding: utf-8 -*-
from pyresample.geometry import AreaDefinition, SwathDefinition
from pyresample.utils import get_area_def
from pyresample.bilinear import resample_bilinear
from pyresample.kd_tree import resample_nearest, resample_gauss, resample_custom
import numpy as np
import warnings
......@@ -551,7 +555,7 @@ class SensorMapGeometryTransformer(object):
os.environ['OMP_NUM_THREADS'] = '%d' % opts['nprocs']
del self.opts['nprocs']
from pyresample.geometry import SwathDefinition
# from pyresample.geometry import SwathDefinition
self.lats = lats
self.lons = lons
self.swath_definition = SwathDefinition(lons=lons, lats=lats)
......@@ -669,7 +673,7 @@ class SensorMapGeometryTransformer(object):
out_extent = xmin, ymin, xmax, ymax
# get area_definition
from pyresample.utils import get_area_def
# from pyresample.utils import get_area_def
area_definition = get_area_def(area_id='',
area_name='',
proj_id='',
......@@ -690,8 +694,8 @@ class SensorMapGeometryTransformer(object):
:param target_geo_def: target geo definition
:return:
"""
from pyresample.bilinear import resample_bilinear
from pyresample.kd_tree import resample_nearest, resample_gauss, resample_custom
# from pyresample.bilinear import resample_bilinear
# from pyresample.kd_tree import resample_nearest, resample_gauss, resample_custom
if self.resamp_alg == 'nearest':
opts = {k: v for k, v in self.opts.items() if k not in ['sigmas']}
......@@ -781,7 +785,7 @@ class SensorMapGeometryTransformer(object):
proj4_args = proj4_to_dict(get_proj4info(proj=src_prj))
# get area_definition
from pyresample.geometry import AreaDefinition
# from pyresample.geometry import AreaDefinition
self.area_definition = AreaDefinition('', '', '', proj4_args, data.shape[1], data.shape[0],
src_extent)
......
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