'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; // // // echo ''; echo 'ATNF Pulsar Data Archive Home'; } function OutputLoginForm() { global $_SERVER; echo ''; echo '
'; echo '

The ATNF Pulsar Data Archive

'; echo '

The ATNF Pulsar Data Archive provides access to pulsar observations'; echo 'made with the Parkes radio Telescope. Data older than '; echo ' months is'; echo 'publicly available, and can be accessed by simply providing your email'; echo 'address. More recent data is proprietry, and can only be accessed by'; echo 'those who were involved in the proposal. We plan to do this via the'; echo 'OPAL system, but this is'; echo 'currently not enabled. In the interim, those who have previously'; echo 'obtained a login for the Data Archive can use that option below'; echo '(making sure to check the "Data Archive login" button!).

'; echo '

A Users Guide to the archive is available.

'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
Non-proprietry access
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Data Archive login
'; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
'; echo '
'; } function OutputQueryFormHeader( $min_date_text, $max_date_text ) { global $PHP_SELF; echo ''; echo '
'; echo '

ATNF Pulsar Data Archive

'; echo '

This archive provides access to pulsar observations taken at the Parkes radio telescope between the dates of '; echo '' . $min_date_text . ' and ' . $max_date_text . '.

'; echo '

See the Users Guide link for more details.

'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo 'Logout'; echo ''; echo ''; echo 'Instructions'; echo ''; echo ' '; echo ''; echo 'Users Guide'; echo '
'; echo ''; } OutputHeader(); // The fields to display in the results if( isset( $_SESSION['fields'] ) ) $selected_fields = $_SESSION['fields']; else $selected_fields = Array( "filename", "src_name", "project_id", "raj", "decj", "data_type", "obsfreq", "bw", "scanlen", "date", "ut", "nsub", "nchan" ); // set some form defaults isset($_SESSION['pulsar_name']) ? $pulsar_name = $_SESSION['pulsar_name'] : $pulsar_name = ''; isset($_SESSION['project_id']) ? $project_id = $_SESSION['project_id'] : $project_id = ''; isset($_SESSION['obs_mode']) ? $obs_mode = $_SESSION['obs_mode'] : $obs_mode = ''; isset($_SESSION['data_type']) ? $data_type = $_SESSION['data_type'] : $data_type = ''; isset($_SESSION['orderBy']) ? $orderBy = $_SESSION['orderBy'] : $orderBy = ''; isset($_SESSION['orderDir']) ?$orderDir = $_SESSION['orderDir'] : $orderDir = 'asc'; isset($_SESSION['survey']) ? $survey = $_SESSION['survey'] : $survey = ''; isset($_SESSION['rahour']) ? $rahour = $_SESSION['rahour'] : $rahour = ''; isset($_SESSION['ramin']) ? $ramin = $_SESSION['ramin'] : $ramin = ''; isset($_SESSION['rasec']) ? $rasec = $_SESSION['rasec'] : $rasec = ''; isset($_SESSION['decdeg']) ? $decdeg = $_SESSION['decdeg'] : $decdeg = ''; isset($_SESSION['decmin']) ? $decmin = $_SESSION['decmin'] : $decmin = ''; isset($_SESSION['decsec']) ? $decsec = $_SESSION['decsec'] : $decsec = ''; isset($_SESSION['radius']) ? $radius = $_SESSION['radius'] : $radius = 60; isset($_SESSION['bandname']) ? $bandname = $_SESSION['bandname'] : $bandname = Array(); isset($_SESSION['from_day']) ? $from_day = $_SESSION['from_day'] : $from_day = ''; isset($_SESSION['from_month']) ?$from_month = $_SESSION['from_month'] : $from_month = ''; isset($_SESSION['from_year']) ? $from_year = $_SESSION['from_year'] : $from_year = ''; isset($_SESSION['to_day']) ? $to_day = $_SESSION['to_day'] : $to_day = ''; isset($_SESSION['to_month']) ? $to_month = $_SESSION['to_month'] : $to_month = ''; isset($_SESSION['to_year']) ? $to_year = $_SESSION['to_year'] : $to_year = ''; isset($_SESSION['cals_within_mins']) ? $cals_within_mins = $_SESSION['cals_within_mins'] : $cals_within_mins = 30; isset($_SESSION['cals']) ? $cals = $_SESSION['cals'] : $cals = 'cals'; try { $now_day = date("j"); $now_month = date("n"); $now_year = date("Y"); $all_params_id = "all_params"; $all_others_id = "all_others"; //$link = db_connect(); $db = new PulsarArchiveDB(); $db->connect( DB_SERVER . ':' . DB_PORT, DB_USERNAME, DB_PASS, DB_NAME ); //$link = db_connect_admin(); //loadNewTables(); ////////////////////////////// // Initialise error messages // $date_error = ""; /////////////////////////////////// // Find out the first and last dates //$query = "select min(mjd), max(mjd) from ".OBSERVATIONS_TABLE; $min_mjd = ''; $max_mjd = ''; $db->GetMinMaxMJD( $min_mjd, $max_mjd ); // Convert from MJD to JD $min_jd = $min_mjd + 2400000.5; $max_jd = $max_mjd + 2400000.5; // convert the mjd to a date $min_jd = floor($min_jd); $max_jd = ceil($max_jd); $min_unix = jdtounix($min_jd); $max_unix = jdtounix($max_jd); $min_date_text = date("j F Y", $min_unix); $max_date_text = date("j F Y", $max_unix); $minDay = date("j",$min_unix); $minMonth = date("n",$min_unix); $minYear = date("Y",$min_unix); $maxDay = date("j",$max_unix); $maxMonth = date("n",$max_unix); $maxYear = date("Y",$max_unix); // proprietry date limit $today_mjd = cal_to_jd ( CAL_GREGORIAN, date("n"), date("j"), date("Y") ) - 2400000.5; $prop_mjd = $today_mjd - PROPRIETRY_PERIOD_DAY; $prop_unix = jdtounix($prop_mjd+2400000.5); $prop_date_text = date("j F Y", $prop_unix); // Clear any old form inputs in session cache init(); ////////////////////////////////////////////// // Get the field names to fill form checkboxes $fields = $db->GetObservationFields(); $field_names = Array("filename" => "Filename", "src_name" => "Source Name", "project_id" => "Project ID", "raj" => "RA (J2000, hh:mm:ss)", "decj" => "Dec (J2000, dd:mm:ss)", "data_type" => "Data Type", "obsfreq" => "Frequency", "bw" => "Bandwidth", "scanlen" => "Scan Length", "date" => "UT Date", "ut" => "UT Time", "MJD" => "MJD", "rajd" => "RA (J2000, degs)", "decjd" => "Dec (J2000, degs)", "gl" => "Gal. Long. (degs)", "gb" => "Gal. Lat. (degs)", "BMAJ" => "Beamsize: BMAJ", "BMIN" => "Beamsize: BMIN", "BPA" => "Beam: BPA", "dm" => "D.M.", "period" => "Period", "nchan" => "# channels", "npol" => "# polarisations", "nbin" => "# bins", "nsub" => "# subintegrations", "tsamp" => "Sample time", "nbits" => "# bits per sample", "nbeam" => "# beams", "cnfg" => "Configuration", "inst" => "Instrument", "rcvr" => "Receiver", "hdrver" => "PSRFITS version", "survey" => "Survey name", "telescope" => "Telescope", "site" => "Site ID", "obsrvr" => "Observer ID" ); ///////////////////////////////////////////////// // Load search form parameters if they have been stored. // /////////////////////////////////////////////// // Get the data types available in the database // $data_types = $db->GetDataTypes(); /////////////////////////////////////////////// // If the user clicked on the logout button if (isset($HTTP_GET_VARS['command'])) { $command = $HTTP_GET_VARS['command']; if ($command == 'logout') { //unset($_SESSION['auth_code']); //unset($_SESSION['username']); $_SESSION = array(); } if ($command == 'Login') { echo 'we are logging in'; exit; } } // if we have already authenticated // use our stored authentication details // otherwise // if we have received a login attempt // process it $auth_code = false; if( isset( $_SESSION['auth_code'] ) && $_SESSION['auth_code'] == OK ) { $auth_code = $_SESSION['auth_code']; $username = $_SESSION['username']; } else { if( isset( $HTTP_POST_VARS['action'] ) && $HTTP_POST_VARS['action'] == 'Login' ) { $username = $HTTP_POST_VARS["opalEmail"]; $password = $HTTP_POST_VARS["opalPassword"]; $type = $HTTP_POST_VARS['authenticateType']; if($type == "anon"){ $username = $HTTP_POST_VARS["email"]; $auth_code = OK; logger_login( $username, 'Anonymous', 'success' ); } else { $auth_code = authenticate($username, $password); if( $auth_code == OK ) logger_login( $username, 'Opal', 'success' ); else logger_login( $username, 'Opal', 'failure' ); //$auth_code = newAuthenticate(); } } } // Initial state where no username or password supplied OR bad login state if ($auth_code != OK) { OutputLoginForm(); } else { $_SESSION['username'] = $username; $_SESSION['auth_code'] = $auth_code; $_SESSION['logintype'] = $HTTP_POST_VARS['authenticateType']; isset( $HTTP_GET_VARS['actions'] ) ? $actions = $HTTP_GET_VARS['actions'] : $actions = Array(); if ($actions == "new_query") { init(); } else if ($actions == "error") { // $date_error = "You are only authorised to access data > 18 months old"; } OutputQueryFormHeader( $min_date_text, $max_date_text ); ?>

 

DISPLAY PARAMETERS Select all

".$field_names[$field['Field']]."
\n"; } } ?>
POSITION REQUIREMENTS
Pulsar Name

Note that search-by-name takes precedence over search-by-RA/Dec.


Right Ascension (J2000)
Declination (J2000)


SEARCH WINDOW [arcmin]

PROJECT ID
FILTER OPTIONS
Date Range From: $date_error" ?>   To:

Obs Mode
Data Type
Band Name
ORDER RESULTS BY
  >Ascending
  >Descending

DISPLAY OTHER DATA /> Display Cals taken within /> mins of Observations

getCode(), $e->getMessage(), '' ); echo '

' . '
' . 'A database error was encountered
' . 'the details of the error have been logged, please contact the system administrator for futher assistance
' . '
' . '

'; } ?>