NAME
Data::Ovulation - Female ovulation prediction based on basal body temperature values
VERSION
This document describes Data::Ovulation version 0.01
SYNOPSIS
use Data::Ovulation;
my $ovul = Data::Ovulation->new;
$ovul->add_temperature( { day => 1, temp => '36.5' } );
$ovul->add_temperature( { day => 2, temp => '36.1' } );
my $ovul = Data::Ovulation->new;
$ovul->temperatures( [ qw/
36.5 36.1 36.1 36.2 36.2 36.2 36.3 36.2 36.2 36.1 36.3 36.4
36.2 36.4 36.4 36.4 36.4 36.5 36.7 36.7 36.6 36.6 36.7 36.8
/ ] );
my $result = $ovul->calculate;
my $could_be_pregnant = $result->impregnation;
my @ovulation_days = @{ $result->ovulation_days };
my @fertile_days = @{ $result->fertile_days };
See Data::Ovulation::Result for all result object methods.
DESCRIPTION
This module tries to predict (based on scientific facts) if and when an ovulation has occurred within the female menstrual cycle based on basal body temperature values. Taking the temperature values after the ovulation into account it is possible to predict if an impregnation has occured. This data is often used as the basis for basal temperature curves.
SUBROUTINES/METHODS
new()
Creates a new Data::Ovulation object. You may pass in an arrayref of temperatures during object construction:
my $ovul = Data::Ovulation->new( {
temperatures => [ qw/ 36.2 36.1 ... / ]
} );
temperatures()
Set all temperatures at once. Expects an arrayref of temperatures for every day of the menstrual cycle in consecutive order starting with day 1. If called without parameters returns an arrayref of set temperatures.
$ovul->temperatures( [ qw/ 36.5 36.1 / ] );
my @temperatures = @{ $ovul->temperatures };
temperature()
Sets/Gets the temperature for a day. Day numbering starts at 1 - not 0! Day 1 is supposed to be the first day of a new menstrual cycle. Returns the set value on success.
$ovul->add_temperature( { day => 12, temp => '36.2' } );
calculate()
Calculates the ovulation day and various other aspects of the female menstrual cycle based on basal body temperature values set in the object and returns a Data::Ovulation::Result object with the results. Returns 0 if the calculation failed. There must be at least 10 temperature values in the object for the calculation to be somewhat reasonable. A warning will be issued if there are less than 10 values and the method will immediately return with a value of 0.
$ovul->calculate();
no_of_values()
Returns the number of temperature values set.
my $no_of_values = $ovul->no_of_values();
clear()
Remove set temperatures.
$ovul->clear();
EXPORTS
The following constants are exported by default:
DELTA_FERTILE_DAYS # Number of days the fertility lasts.
# The fertile period is supposed to start around
# 5 days before the temperature rises.
DELTA_OVULATION_DAYS # The ovulation is supposed to happen on one of
# 3 days prior to the temperature rise.
DELTA_NEXT_CYCLE # Number of days until the next menstrual cycle
# starts counted from the day the temperature rises.
KNOWN BUGS
None yet.
SUPPORT
<cpan at funkreich dot de>
.
AUTHOR
Tobias Kremer, <cpan at funkreich dot de>
SEE ALSO
- Data::Ovulation::Result - Result class methods
- http://en.wikipedia.org/wiki/Basal_temperature - Wikipedia entry on Basal body temperature
- http://www.urbia.de/services/zykluskalender/ - An example of this module in use (german only)
COPYRIGHT & LICENSE
Copyright 2007 Tobias Kremer, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.