CNES / aviso-fes

FES is the last version of the FES (Finite Element Solution) tide model.
https://cnes.github.io/aviso-fes
BSD 3-Clause "New" or "Revised" License
59 stars 24 forks source link

Use double precision for grid axis step #18

Closed robin-cls closed 1 year ago

robin-cls commented 1 year ago

This version of tide prediction for FES can handle cartesian grid. The longitude and latitude axes are regular and so we use this property to :

  1. Detect if a axis is circular for the longitudes : lon_step * number_lons = 360.0 (with a 1e-9 tolerance)
  2. For a given lon or lat, get the index on the axis : nearest_int( (lon - lon_min) / lon_step )

Using a grid with a non rational step has led us to problems in the circularity detection and in getting the nearest points. Our grid has the following step : step_as_double = 0.03333333333333333 step_as_float = 0.033333335

We propose to use a double precision step for both latitudes and longitudes axes in order to detect the longitude circularity and have a better precision for getting indexes on the axes