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

NAME

SCUBA::Table::NoDeco - Calculate no-decompression dive times.

SYNOPSIS

  use SCUBA::Table::NoDeco;

  my $table = SCUBA::Table::NoDeco->new();

  $table->dive(metres => 15, minutes => 30);

  print $table->group,"\n";     # Prints "E"

  $table->surface(minutes => 60);

  print $table->group,"\n";     # Prints "D"

  print $table->max_time(metres => 30),"\n";    # Prints 6

WARNING AND DISCLAIMER

Do NOT use this module as your sole source of no-decompression dive times. This module is intended for use only as a guide to assist in planning your dives. ALWAYS calculate and verify your dive times by hand once you have planned your dives. If you have a dive computer, follow its instructions for use.

SCUBA diving involves serious risks of injury or death, and should only be performed by individuals in good health and with the appropriate skills and training. Even when tables are used with proper safety procedures, decompression sickness may still occur.

The author provides ABSOLUTELY NO WARRANTY on this module, without even the implied warranty of merchantability or fitness for a particular purpose. Use entirely at your own risk.

DESCRIPTION

This module provides the ability to perform useful calculations using dive-tables, including calculating dive groups and maximum no-decompression times for repetitive dives. A selection of tables are available. The module assumes that the diver is using air as their breathing gas.

METHODS

The following methods are provided.

new

    my $stn = SCUBA::Table::NoDeco->new(table => "SSI");

This class method returns a SCUBA::Table::NoDeco object. It takes an optional table argument, specifying which dive table should be used.

If no dive table is supplied then the module will use the default SSI table. This default may change in future releases, so you should not rely upon this default.

SSI tables are the only ones supported in the present release.

list_tables

  my @tables = SCUBA::Table::NoDeco->list_tables();

This method returns a list of tables that can be selected when creating a new SCUBA::Table::NoDeco object.

max_table_depth

  my $max_depth_ft = $stn->max_table_depth(units => "feet");
  my $max_depth_mt = $stn->max_table_depth(units => "metres");

This method provides the maximum depth for repetitive dives provided by the tables currently in use. Some tables may provide a greater depth for non-reptetitve dives. This function does not supply the maximum safe depth (however see "max_depth"). The units argument is mandatory.

clear

   $stn->clear();

This method resets the object to its pristine state. The table used for dive calculations is retained.

table

  print "You are using the ",$stn->table," tables\n";

This method simply returns the name of the dive table being used by the SCUBA::Table::NoDeco object.

dive

  my $group = $stn->dive(feet   => 60, minutes => 30);
  my $group = $stn->dive(metres => 18, minutes => 30);

This method determines and sets the diver's group for the dive information provided. If the dive 'falls off' the tables, then an exception is returned. This method takes into account the diver's current group, surface interval, and residual nitrogen time.

If the diver does not have a surface interval of at least 10 minutes, this will consider the dive to be a continuation of the previous dive. The dive times will be added, and the maximum depth of both dives will be used to calculate the diver's group.

group

  print "You are a ",$stn->group," diver\n";

The group method returns the current letter designation representing the amount of residual nitrogen present in the diver. The letter designation is always upper-case. A diver with no residual nitrogen has no group, represented by the empty string.

surface

   $stn->surface(minutes => 60);        # Spend an hour on surface.
   print "Total surface time ",$stn->surface," minutes\n";

This method returns the total time of the current surface interval. If the optional minutes argument is provided, this is added to the diver's current surface interval before returning the total minutes elapsed.

max_time

  print "Your maximum time at 18 metres is ",$stn->max_time(metres => 18),"\n";
  print "Your maximum time at 60 feet is   ",$stn->max_time(feet   => 60),"\n";

This calculates the maximum no-decompression time for a dive to the specified depth. The diver's current group is taken into account.

If the diver cannot reach the depth supplied without breaking no-decompression limits then the value '0' is returned.

max_depth

  print "The maximum depth you may dive is ",$stn->max_depth(units => "metres")," metres\n";
  print "Max depth for a 20 minute dive is ",$stn->max_depth(units => "feet", minutes => 20)," feet\n";

This method returns the maximum possible depth given the diver's current group, or the maximum depth available on your table if no group is set.

The method takes an optional argument (minutes), in which case the maximum depth for a dive of that duration will be returned.

This method returns '0' if the diver is not allowed to make *any* dive for the period of time specified.

rnt

   my $rnt  = $stn->rnt(metres => 12);
   my $rnt2 = $stn->rnt(feet   => 40);

This method returns the residual nitrogen time for a diver, in minutes. The depth argument (in either metres or feet) is mandatory.

If the depth supplied means that the diver cannot make a no-decompression dive, then an undefined value is returned.

SEE ALSO

http://pjf.id.au/perl/scuba-table-nodeco/ - SCUBA::Table::NoDeco webpage, including links to support mailing list.

http://pjf.id.au/dive/calc.html - Online dive-planner for programmers too lazy to use the module.

BUGS

Almost certainly. If you find one, please report it to pjf@cpan.org.

The PADI tables are generated from an algorithm which provides almost an exact match to the printed PADI tables, however there are some inconsistancies. Treat the PADI tables with particular care.

TODO

Add the ability to specify a default unit (metres/feet) for methods that currently require them.

AUTHOR

Paul Fenwick, <pjf@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2004 by Paul Fenwick.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.