The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Dive - Simulate a dive and corresponding tissues

SYNOPSIS

    use Deco::Dive;
my $dive = new Deco::Dive( );
$dive->load_data_from_file( file => $file);
$dive->model( config => '/path/to/my/model.cnf' );
$dive->simulate( );

DESCRIPTION

The Dive model can be used to simulate a dive. You add data points, set some properties and call the simulate method to calculate the entire dive.

After simulating, you can retrieve info in several ways from the dive.

METHODS

new()

The constructor of the class.

$dive->load_data_from_file( file => $file , timefield => 0, depthfield => 1, timefactor => 1, separator => ';');

Load data from a csv file. You HAVE to specify the filename. Additional options are timefield, the 0 based field number where the timestamps are stored. Depthfield, field number where the depth (in meters is stored), separator, the fieldseparator and timefactor, the factor to multiply the time field with to transform them to seconds.

$dive->model( model => 'padi', config => $file );

Set the model to use. If you specify one of the known models and the config dir has been set right, then the method will load the corresponding config file and set up the tissues for this model.

Alternatively you can specify your own config file to use.

$dive->simulate( model => 'haldane' );

This method does the simulation for all tissues for the chosen model. It will run along all the time and depth points of the dive and calculate gas loading for all the tissues of the model.

$dive->nodeco_time(); This function will loop over all the tissues of the model, calling the LDeco::Tissue::nodeco_time() function on them. The lowest value will be stored, together with the associated tissue nr.
$dive->gas( 'O2' => 45, 'n2' => 0.55);

Set the gases used during this dive. Currently supported are 02, N2 and He. Enter the fraction of the gas either as real fraction, or as a percentage.

$dive->point($time, $depth);

Adds a new point to the dive. Use it if you don't want to load data from a file but iterate over your own values. Time should be in seconds, depth in meters.

$dive->tissue( $tissue_nr );

Returns the tissue as defined in the config by numer $tissue_nr. The function will croak when nothing is found.

EXPORT

None by default.

SEE ALSO

Deco, Deco::Tissue, Deco::Dive::Plot. SCUBA::Table::NoDeco might be of interest to you as well. In the docs directory you will find an extensive treatment of decompression theory in the file Deco.pdf. A lot of it has been copied from the www.deepocean.net website.

AUTHOR

Jaap Voets, <narked@xperience-automatisering.nl>

COPYRIGHT AND LICENSE

Copyright (C) 2006 by Jaap Voets