bvanosnabrugge / summaWorkflow_public

GNU General Public License v3.0
0 stars 4 forks source link

3a_forcing/3_create_shapefile "create_ERA5_shapefile" #4

Open bartvanosnabrugge opened 2 years ago

bartvanosnabrugge commented 2 years ago
ShervanGharari commented 2 years ago

This can be done using easymore package in various forms:

1) if the user call the easymore nc_remapper the source shapefile is created in the temporary files.

2) calling the easymore functions based on the first example of the easymore: https://github.com/ShervanGharari/EASYMORE/blob/main/examples/Chapter1_E1.ipynb

instead of calling the esmr.nc_remapper() user can instead do the following:

esmr.NetCDF_SHP_lat_lon()
if hasattr(esmr, 'lat_expanded') and hasattr(esmr, 'lon_expanded'):
    esmr.lat_lon_SHP(esmr.lat_expanded, esmr.lon_expanded,\
        esmr.temp_dir+esmr.case_name+'_source_shapefile1.shp')
else:
    esmr.lat_lon_SHP(esmr.lat, self.lon,\
        esmr.temp_dir+esmr.case_name+'_source_shapefile1.shp')

note that the test.shp does not have a projection and that should be added

Note, the nc shapefile depending on the whether or not the nc file is regular or rotated the first and last row and first and last column might be missing in the shapefile. Therefore it is suggested to have a buffer for the domain of modelling.