diff --git a/CHANGELOG.md b/CHANGELOG.md index d6c5396634eb95f78beeed31b8729da4b7909f30..32190a6a1839a2ed002ae9c470b5d4d6bd79cc4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ * Bug on `cell_methods` serial write ([#53](https://earth.bsc.es/gitlab/es/NES/-/issues/53)) * Bug on avoid_first_hours that where not filtered after read the dimensions ([#59](https://earth.bsc.es/gitlab/es/NES/-/issues/59)) * Bug while reading masked data. + * grid_mapping NetCDF variable as integer instead of character. ### 1.1.0 * Release date: 2023/03/02 diff --git a/nes/nc_projections/latlon_nes.py b/nes/nc_projections/latlon_nes.py index b044d984c227d7493607e9524735bf0b245f4db0..91b7dcedaf195a771056348deabc9231c73ecd09 100644 --- a/nes/nc_projections/latlon_nes.py +++ b/nes/nc_projections/latlon_nes.py @@ -245,8 +245,7 @@ class LatLonNes(Nes): netcdf4-python Dataset. """ - mapping = netcdf.createVariable('crs', 'c') - # mapping = netcdf.createVariable('crs', 'i') + mapping = netcdf.createVariable('crs', 'i') mapping.grid_mapping_name = "latitude_longitude" mapping.semi_major_axis = 6371000.0 mapping.inverse_flattening = 0 diff --git a/nes/nc_projections/lcc_nes.py b/nes/nc_projections/lcc_nes.py index b5a679e8da977eb675bc79c586faa29dcc4112f7..34cb9cbd6ed0760b40172be75c8e5c178243dc9b 100644 --- a/nes/nc_projections/lcc_nes.py +++ b/nes/nc_projections/lcc_nes.py @@ -415,7 +415,7 @@ class LCCNes(Nes): netCDF4-python variable object. """ - var.grid_mapping = 'Lambert_conformal' + var.grid_mapping = 'Lambert_Conformal' var.coordinates = "lat lon" return None @@ -431,7 +431,7 @@ class LCCNes(Nes): """ if self.projection_data is not None: - mapping = netcdf.createVariable('Lambert_conformal', 'c') + mapping = netcdf.createVariable('Lambert_Conformal', 'i') mapping.grid_mapping_name = self.projection_data['grid_mapping_name'] mapping.standard_parallel = self.projection_data['standard_parallel'] mapping.longitude_of_central_meridian = self.projection_data['longitude_of_central_meridian'] diff --git a/nes/nc_projections/mercator_nes.py b/nes/nc_projections/mercator_nes.py index b752e8d575454b54e43d10caced0949c0219a344..249c0bcda17b55982d6497b78c6ba445c3f2f766 100644 --- a/nes/nc_projections/mercator_nes.py +++ b/nes/nc_projections/mercator_nes.py @@ -408,7 +408,7 @@ class MercatorNes(Nes): """ if self.projection_data is not None: - mapping = netcdf.createVariable('mercator', 'c') + mapping = netcdf.createVariable('mercator', 'i') mapping.grid_mapping_name = self.projection_data['grid_mapping_name'] mapping.standard_parallel = self.projection_data['standard_parallel'] mapping.longitude_of_projection_origin = self.projection_data['longitude_of_projection_origin'] diff --git a/nes/nc_projections/rotated_nes.py b/nes/nc_projections/rotated_nes.py index 66dc2b7b5dbf681cf5a318f107ec44abf510c7df..ec626116bbc69d8ffd38864ee490091032e28822 100644 --- a/nes/nc_projections/rotated_nes.py +++ b/nes/nc_projections/rotated_nes.py @@ -459,7 +459,7 @@ class RotatedNes(Nes): """ if self.projection_data is not None: - mapping = netcdf.createVariable('rotated_pole', 'c') + mapping = netcdf.createVariable('rotated_pole', 'i') mapping.grid_mapping_name = self.projection_data['grid_mapping_name'] mapping.grid_north_pole_latitude = self.projection_data['grid_north_pole_latitude'] mapping.grid_north_pole_longitude = self.projection_data['grid_north_pole_longitude']