NAME

eSTAR::RTML::Build - module which creates valid RTML messages

SYNOPSIS

  $message = new eSTAR::RTML::Build( Host        => $ia_host,
                                     Port        => $ia_port,
                                     ID          => $id,
                                     User        => $user_name,
                                     Name        => $real_name,
                                     Institution => $institution,
                                     Email       => $email_address );

DESCRIPTION

The module builds RTML messages which will be sent over GlobusIO from the intelligent agent to the dscovery node. Two types of messages can be constructed, these being score and observation request documents.

REVISION

$Id: Build.pm,v 1.11 2003/07/15 08:16:51 aa Exp $

METHODS

Constructor

new

Create a new instance from a hash of options

$message = new eSTAR::RTML::Build( Host        => $ia_host,
                                   Port        => $ia_port,
                                   ID          => $id,
                                   User        => $user_name,
                                   Name        => $real_name,
                                   Institution => $institution,
                                   Email       => $email_address);

returns a reference to an object.

RTML Methods

score_observation

Build a score document

$status = $message->score_observation( Target        => $target_name,
                                       RA            => $ra,
                                       Dec           => $dec,
                                       Equinox       => $equinox,
                                       Exposure      => $seconds,
                                       Snr           => $snr,
                                       Flux          => $mag );

Use "Exposure", or "Snr" and "Flux", but not both.

score_response

Build a score response document

$status = $message->score_response( Target        => $target_name,
                                       RA            => $ra,
                                       Dec           => $dec,
                                       Equinox       => $equinox,
                                       Exposure      => $seconds,
                                       Snr           => $snr,
                                       Flux          => $mag,
                                       Score         => $score,
                                       Time          => $completion_time );

Use "Exposure", or "Snr" and "Flux", but not both.

request_observation

Build a request document

$status = $message->request_observation( Target   => $target_name,
                                         RA       => $ra,
                                         Dec      => $dec,
                                         Equinox  => $equinox,
                                         Score    => $score,
                                         Time     => $completion_time,
                                         Exposure => $exposure,
                                         Snr      => $snr,
                                         Flux     => $mag );

Use "Exposure", or "Snr" and "Flux", but not both. );

dump_rtml

Dumps the contents of the RTML buffer in memory to a scalar

$string = $message->dump_rtml();

Accessor Methods

port

Sets (or returns) the port which the Discovey Node should send RTML messages to (ie the port on which the IA is listening).

$message->port( '8080' );
$port = $message->port();

defautls to 8000.

host

Sets (or returns) the machine on which the IA is running

$message->host( $hostname );
$host = $message->host();

defaults to the current machine's IP address

id

Sets (or returns) the unique ID for the Intelligent Agent request

$message->id( 'IATEST0001:CT1:0013' );
$id = $message->id();

note that there is NO DEFAULT, a unique ID for the score/observing request must be supplied, see the eSTAR Communications and the ERS command set documents for further details.

user

Sets (or returns) the user name of the observer

$message->user( 'aa' );
$user = $message->user();
name

Sets (or returns) the name of the observer

$message->name( 'Alasdair Allan' );
$name = $message->name();
institution

Sets (or returns) the Institution of the observer

$message->institution( 'University of Exeter' );
$dept_name = $message->institution();
email

Sets (or returns) the email address of the observer

$message->email( 'aa@astro.ex.ac.uk' );
$email_address = $message->email();
target

Sets (or returns) the target name

$message->email( 'EX Hya' );
$target_name = $message->target();
ra

Sets (or returns) the target RA

$message->ra( '12 35 65.0' );
$ra = $message->ra();

must be in the form HH MM SS.S.

dec

Sets (or returns) the target DEC

$message->dec( '+60 35 32' );
$dec = $message->dec();

must be in the form SDD MM SS.S.

equinox

Sets (or returns) the equinox of the target co-ordinates

$message->equinox( 'B1950' );
$equnox = $message->equinox();

default is J2000, currently the telescope expects J2000.0 coordinates, no translation is currently carried out by the library before formatting the RTML message. It is therefore suggested that the user therefoer provides their coordinates in J2000.0 as this is merely a placeholder routine.

score

Sets (or returns) the target score

$message->score( $score );
$score = $message->score();

the score will be between 0.0 and 1.0

time

Sets (or returns) the target completion time

$message->time( $time );
$time = $message->time();

the completion time should be of the format YYYY-MM-DDTHH:MM:SS

exposure

Sets (or returns) the exposure time for the image

$message->exposure( $time );
$time = $message->time();

the time should be in seconds, alternatively you can supply a flux() and snr() rather than a time to expose on target.

snr

Sets (or returns) the signal to noise for the image

$message->snr( $sn );
$sn = $message->snr();

the signatl to noise ratio should be a floating point number, alternatively you can supply a exposure() in seconds.

flux

Sets (or returns) the flux of teh object needed for signal to noise calculations for the image

$message->flux( $mag );
$mag = $message->flux();

the flux should be a continuum V band magnitude value.

General Methods

configure

Configures the object, takes an options hash as an argument

$message->configure( %options );

does nothing if the hash is not supplied.

freeze

Method to return a blessed reference to the object so that we can store ths object on disk using Data::Dumper module.

COPYRIGHT

Copyright (C) 2002 University of Exeter. All Rights Reserved.

This program was written as part of the eSTAR project and is free software; you can redistribute it and/or modify it under the terms of the GNU Public License.

AUTHORS

Alasdair Allan <aa@astro.ex.ac.uk>,