Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 84d950df3da2eaf0f4c12b5bad29643f88451cc3 Mon Sep 17 00:00:00 2001
- From: Bang Pham Huu <b.phamhuu@jacobs-university.de>
- Date: Wed, 18 Jan 2017 13:09:33 +0100
- Subject: [PATCH] fixed ticket:176_grib_es2
- ---
- .../recipes/general_coverage/grib_to_coverage_converter.py | 14 +++++++++-----
- 1 file changed, 9 insertions(+), 5 deletions(-)
- diff --git a/applications/wcst_import/recipes/general_coverage/grib_to_coverage_converter.py b/applications/wcst_import/recipes/general_coverage/grib_to_coverage_converter.py
- index 8a84e12..a755529 100644
- --- a/applications/wcst_import/recipes/general_coverage/grib_to_coverage_converter.py
- +++ b/applications/wcst_import/recipes/general_coverage/grib_to_coverage_converter.py
- @@ -172,13 +172,13 @@ class GRIBToCoverageConverter(AbstractToCoverageConverter):
- high = axis.interval.high
- resolution = axis.resolution
- grid_low = 0
- - grid_high = math.fabs(math.floor((high - low) / resolution))
- + grid_high = int(math.fabs(math.ceil(grid_low + (high - low) / resolution)))
- # NOTE: Grid Coverage uses the direct intervals as in Rasdaman, modify the high bound will have error in petascope
- if not self.grid_coverage:
- if grid_high > grid_low:
- grid_high -= 1
- - return low, high, low, int(grid_low), int(grid_high), resolution
- + return low, high, low, grid_low, grid_high, resolution
- def _low_high_origin_date(self, messages, axis_name):
- """
- @@ -202,7 +202,8 @@ class GRIBToCoverageConverter(AbstractToCoverageConverter):
- if date_high > high:
- high = date_high
- resolution = axis.resolution
- - grid_high += 1
- + if high != low:
- + grid_high += 1
- grid_low = 0
- if grid_high > grid_low:
- grid_high -= 1
- @@ -277,9 +278,12 @@ class GRIBToCoverageConverter(AbstractToCoverageConverter):
- geo_axis = RegularAxis(crs_axis.label, crs_axis.uom, low, high, origin, crs_axis)
- grid_axis = GridAxis(user_axis.order, crs_axis.label, resolution, grid_low, grid_high)
- if crs_axis.is_easting():
- - geo_axis.origin = geo_axis.low + resolution / 2
- + geo_axis.origin = geo_axis.low + float(resolution) / 2
- elif crs_axis.is_northing():
- - geo_axis.origin = geo_axis.high + resolution / 2
- + geo_axis.origin = geo_axis.high + float(resolution) / 2
- + elif not (crs_axis.is_uom_second() or crs_axis.is_uom_day()):
- + geo_axis.origin = geo_axis.low + float(resolution) / 2
- +
- axis_subsets.append(AxisSubset(CoverageAxis(geo_axis, grid_axis, user_axis.dataBound), Interval(low, high)))
- return Slice(axis_subsets, FileDataProvider(grib_file, self._messages_to_dict(messages), self.MIMETYPE))
- --
- 1.8.3.1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement