Data::Ovulation - Female ovulation prediction based on basal body temperature values
This document describes Data::Ovulation version 0.01
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.
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.
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();
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.
None yet.
<cpan at funkreich dot de>.
<cpan at funkreich dot de>
Tobias Kremer, <cpan at funkreich dot de>
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.
To install Data::Ovulation, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Ovulation
CPAN shell
perl -MCPAN -e shell install Data::Ovulation
For more information on module installation, please visit the detailed CPAN module installation guide.