Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.96 KB | None | 0 0
  1. From 84d950df3da2eaf0f4c12b5bad29643f88451cc3 Mon Sep 17 00:00:00 2001
  2. From: Bang Pham Huu <b.phamhuu@jacobs-university.de>
  3. Date: Wed, 18 Jan 2017 13:09:33 +0100
  4. Subject: [PATCH] fixed ticket:176_grib_es2
  5.  
  6. ---
  7. .../recipes/general_coverage/grib_to_coverage_converter.py | 14 +++++++++-----
  8. 1 file changed, 9 insertions(+), 5 deletions(-)
  9.  
  10. 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
  11. index 8a84e12..a755529 100644
  12. --- a/applications/wcst_import/recipes/general_coverage/grib_to_coverage_converter.py
  13. +++ b/applications/wcst_import/recipes/general_coverage/grib_to_coverage_converter.py
  14. @@ -172,13 +172,13 @@ class GRIBToCoverageConverter(AbstractToCoverageConverter):
  15. high = axis.interval.high
  16. resolution = axis.resolution
  17. grid_low = 0
  18. - grid_high = math.fabs(math.floor((high - low) / resolution))
  19. + grid_high = int(math.fabs(math.ceil(grid_low + (high - low) / resolution)))
  20.  
  21. # NOTE: Grid Coverage uses the direct intervals as in Rasdaman, modify the high bound will have error in petascope
  22. if not self.grid_coverage:
  23. if grid_high > grid_low:
  24. grid_high -= 1
  25. - return low, high, low, int(grid_low), int(grid_high), resolution
  26. + return low, high, low, grid_low, grid_high, resolution
  27.  
  28. def _low_high_origin_date(self, messages, axis_name):
  29. """
  30. @@ -202,7 +202,8 @@ class GRIBToCoverageConverter(AbstractToCoverageConverter):
  31. if date_high > high:
  32. high = date_high
  33. resolution = axis.resolution
  34. - grid_high += 1
  35. + if high != low:
  36. + grid_high += 1
  37. grid_low = 0
  38. if grid_high > grid_low:
  39. grid_high -= 1
  40. @@ -277,9 +278,12 @@ class GRIBToCoverageConverter(AbstractToCoverageConverter):
  41. geo_axis = RegularAxis(crs_axis.label, crs_axis.uom, low, high, origin, crs_axis)
  42. grid_axis = GridAxis(user_axis.order, crs_axis.label, resolution, grid_low, grid_high)
  43. if crs_axis.is_easting():
  44. - geo_axis.origin = geo_axis.low + resolution / 2
  45. + geo_axis.origin = geo_axis.low + float(resolution) / 2
  46. elif crs_axis.is_northing():
  47. - geo_axis.origin = geo_axis.high + resolution / 2
  48. + geo_axis.origin = geo_axis.high + float(resolution) / 2
  49. + elif not (crs_axis.is_uom_second() or crs_axis.is_uom_day()):
  50. + geo_axis.origin = geo_axis.low + float(resolution) / 2
  51. +
  52. axis_subsets.append(AxisSubset(CoverageAxis(geo_axis, grid_axis, user_axis.dataBound), Interval(low, high)))
  53. return Slice(axis_subsets, FileDataProvider(grib_file, self._messages_to_dict(messages), self.MIMETYPE))
  54.  
  55. --
  56. 1.8.3.1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement