TEOS-10/GSW-Python

Difference results from geo_strf_dyn_height compared to Matlab version.

Closed this issue · 5 comments

I'm converting code from Matlab to Python, and calling gsw.geo_strf_dyn_height with the same conservative temperatures, absolute salinities, pressures and reference pressure as Matlab's gsw_geo_strf_dyn_height, however the two functions give different results. They are only comparable to 1 decimal place. I'm using the default interpolation method (pchip), linear interpolation gives results even more widely differing.
Is this expected behaviour?

The matlab version is a moving target so I don't expect exact agreement when interpolation comes into play, but the differences should be quite small unless the vertical sampling is extremely coarse. Can you send me a zipfile or tarball with the data and scripts you are using and the results you are getting, preferably stripped down to just enough to show the different results? efiring at hawaii dot edu.

Will do - is netcdf4 format OK? Vertical resolution is 20 dbar.
Thanks

Yes, netcdf4 is good.

Also, if you are working with a section, it's OK to send the whole section. What matters in the end is the horizontal gradient, not the dynamic height at a point.

Happy to close this issue following email discussion with @efiring. The differences between the Matlab and Python implementations are there (most likely due to different interpolation methods being used), but are small enough not to significantly affect the resulting transports calculated from them.