The web service interface also allows FROG to be used as an algorithim engine, the example Perl script below dispatches a time series to FROG which then calculates and returns a Fourier Transform for the series between the limits provided.
#!/usr/bin/perl
use SOAP::Lite;
use Getopt::Long;
unless ( scalar @ARGV >= 1 ) {
die "USAGE: $0 [-host host] [-port port] -file filename\n";
}
my $status = GetOptions( "host=s" => \$host,
"port=s" => \$port,
"file=s" => \$file,
"min=s" => \$min_freq,
"max=s" => \$max_freq,
"interval=s" => \$interval );
# default hostname
unless ( defined $host ) {
# localhost.localdoamin
$host = "127.0.0.1";
}
# default port
unless( defined $port ) {
# default port for the user agent
$port = 8084;
}
my $data;
if( defined $file ) {
unless ( open ( FILE, "<$file") ) {
die "ERROR: Cannot open $file\n";
}
undef $/;
$data = <FILE>;
close FILE;
} else {
die "ERROR: No data file specified.\n";
}
my $service = SOAP::Lite->service(
"http://$host:$port/services/FrogSOAPServices?wsdl" );
print $service->getFourierTransform(
$data, $min_freq, $max_freq, $interval ) . "\n";
FROG - A Time Series Analysis Package