cleanups that work with density

Module Contents



adds (or replaces) the API value, from the density measurements

class opendrift.models.openoil.adios.models.oil.cleanup.density.FixAPI(oil)[source]

Bases: opendrift.models.openoil.adios.models.oil.cleanup.cleanup.Cleanup

adds (or replaces) the API value, from the density measurements

NOTE: this could be extended to interpolate, but it that actually needed?

There is code in the computation.physical_properties package to help, if needed.

initialize a Cleanup object with an oil object


oil (adios_db.models.oil.oil.OIl) – the oil object you want to clean up

ID = '001'

checks to see if there is something to fix

returns: flag, msg

if nothing is needed, flag is None if something can be cleaned up, flag is True if something is wrong, but can not be cleaned up, flag is False

fixme: – maybe cleanup and validation should be better integrated?


run this particular cleanup option

  • oil – an Oil object to act on

  • do_it=False – flag to tell the cleanup to do its thing. If False, the method returns a message. If True, the action is taken, and the Oil object is altered.


a message of what could be done, or what was done.


check is the API value is already valid


Returns the density (in kg/m3)

It will interpolate and extrapolate as needed