Skip to content

Commit

Permalink
Add wgs84 fibgrid files
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhahn committed Nov 11, 2021
1 parent d66405c commit 83b90de
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 8 deletions.
5 changes: 0 additions & 5 deletions src/fibgrid/construction.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,3 @@ def read_grid(filename, variables=['gpi', 'lon', 'lat']):
data[var] = fp.variables[var][:]

return data


if __name__ == '__main__':
n = 6600000
compute_fib_grid_wgs84(n)
Binary file added src/fibgrid/files/fibgrid_wgs84_n1650000.nc
Binary file not shown.
Binary file added src/fibgrid/files/fibgrid_wgs84_n430000.nc
Binary file not shown.
Binary file added src/fibgrid/files/fibgrid_wgs84_n6600000.nc
Binary file not shown.
6 changes: 3 additions & 3 deletions src/fibgrid/realization.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ def read_grid_file(n, geodatum='WGS84'):
'fibgrid_{}_n{}.nc'.format(geodatum.lower(), n))

metadata_fields = ['land_frac_fw', 'land_frac_hw',
'land_mask_hw', 'land_mask_fw']
'land_mask_hw', 'land_mask_fw',
'land_flag']
metadata_list = []
with netCDF4.Dataset(filename) as fp:
lon = fp.variables['lon'][:]
Expand Down Expand Up @@ -139,7 +140,6 @@ def __init__(self, res, geodatum='WGS84'):
lon, lat, cell, gpi, self.metadata = read_grid_file(
n, geodatum=geodatum)

subset = np.nonzero((self.metadata['land_mask_hw'] > 50) &
(self.metadata['land_mask_fw'] > 50))[0]
subset = np.nonzero(self.metadata['land_flag'])

super().__init__(lon, lat, cell, gpi, subset=subset, geodatum=geodatum)

0 comments on commit 83b90de

Please sign in to comment.