smerckel / gliderflight

A glider flight model for Slocum ocean gliders
MIT License
14 stars 4 forks source link

documentation: using_gliderflight.rst #1

Open hawesie opened 1 year ago

hawesie commented 1 year ago

In https://github.com/smerckel/gliderflight/blob/master/doc/source/using_gliderflight.rst you have these lines:

tmp = dbd.get_sync("sci_ctd41cp_timestamp", "sci_water_temp sci_water_cond sci_water_pressure m_pitch m_ballast_pumped".split())
_, tctd, T, C, P, pitch, buoyancy_change = tmp.compress(tmp[1]>0, axis=1)

However dbd.get_sync returns a list, not an np.array so the call to compress fails. I guess you need to either insert an np.array constructor or alter the return value from get_sync.

hawesie commented 1 year ago

The following requires lon and lat which are not defined in the example.

SA = gsw.SA_from_SP(SP, P*10, lon, lat)
hawesie commented 1 year ago

I'm just working through that example, so will continue to post issues as I find them. Thanks for all the amazing software!

hawesie commented 1 year ago

In the following line, density and m_pitch are not defined

data = dict(time = tctd, pressure = P, pitch = m_pitch, buoyancy_change=buoyancy_change, density=density)

I guess they should be replaced by pitch and rho.

data = dict(time = tctd, pressure = P, pitch = pitch, buoyancy_change=buoyancy_change, density=rho)
hawesie commented 1 year ago

Note that the dbd.get_sync issue also effects glidertrim.

And if you're looking at glidertrim you should remove the epoch2num import since it's not used and causes a crash since it has been removed from matplotlib.

smerckel commented 1 year ago

@hawesie, thank you for your suggestions with regard to the documentation. I have updated the documentation accordingly.

I did not intend to write a complete and working script; I provided examples in the code to get one started. It was more intended to illustrate the process. In any case, I mention now that one needs to provide latitude and longitude as well. I think usually one single (averaged) location should be sufficient as I don't expect the spatial variability of the salinity functions to be so great, although I have never checked that.

Your suggestion to remove epoch2num has been followed, as well an other not-used matplotlib import has been removed.

This issue also exposed my indecisiveness on how to return the values of dbdreader's get* methods, and as a result, I brought some uniformity in there as well.

The changes are now applied to the master branch, but have not been uploaded to pypi. I will do that soon, when no further changes are requested.

Thanks again for your effort!

hawesie commented 1 year ago

The only other thing I spotted was that you have a typo in README.rst where DynamicGLiderModel should be DynamicGliderModel.

smerckel commented 1 year ago

Thank you for notifying me!