Open thopri opened 5 months ago
Thanks for this suggestion, this part of the code is still quite hard-coded indeed. Which tide model are you currently using?
I am currently using GTSM but a downloaded version, I had issues with the opendap version that I can't quite recall. We also have our own global tide model that I will want to be able to use (will need to make it compatible). I also use FES2014 a lot, and would probably want to use this (I know this an option in DFM_tools already).
Ok, I think in that case for now it would be most convenient for you to use the functions that are used by dfmt.interpolate_tide_to_bc()
:
https://github.com/Deltares/dfm_tools/blob/03cabed8174f33a857823510aacb536531a7c8df/dfm_tools/interpolate_grid2bnd.py#L116-L120
If you read in your own tidal dataset and interpolate it with dfmt.interp_regularnc_to_plipointsDataset()
like is done here:
https://github.com/Deltares/dfm_tools/blob/03cabed8174f33a857823510aacb536531a7c8df/dfm_tools/interpolate_grid2bnd.py#L237C19-L238
This gives what you need by using the underlying modules from the dfm_tools code, so it would at least prevent you from having to edit the source code of dfm_tools.
Hi,
Can I request a way to set a custom tide forcing location? At the moment I need to edit the source code of interpolate_grid2gnd.py as the local forcing location of GTSMv4.1 is hard coded so I can use my own hard coded location! :)
I will probably get round to creating a PR eventually, but having the option to dynamically set a location for the tide forcing would be useful maybe an optional argument in the tide interpolation function below?
dfmt.interpolate_tide_to_bc(tidemodel=tidemodel, file_pli=poly_file, component_list=None)