TestGetOrbites_20.php 1.1 KB
<?php

require_once "Base/TestDownloadBase.php";

class TestGetOrbites_20 extends TestDownloadBase
{
	public function getAPI() {
		return "getOrbites";
	}

	protected function needRESTAuth() {
		return TRUE;
	}

	public function getParams() {
		return array(
			"startTime" => "2008-01-01T00:00:00",
			"stopTime"  => "2008-01-01T01:00:00",
			"spacecraft" => "cluster1",
			"coordinateSystem" => "GSE",
			"units" => "km",
		);
	}

	public function getDescription() {
		return "Get Cluster 1 orbit in GSE. No sampling.";
	}

	protected function checkResultInfo($info) {
		if ($info['structure'] != 'one-file-per-parameter-per-interval') {
			return array(
				'success' => FALSE,
				'message' => 'Bad file structure ('.$info['structure'].')',
			);
		}
		if (isset($info['sampling'])) {
			return array(
				'success' => FALSE,
				'message' => 'A sampling time has been applied in result file',
			);
		}
		if (!in_array('c1_xyz_gse_km', $info['parameters'])) {
			return array(
				'success' => FALSE,
				'message' => 'Missing c1_xyz_gse_km in result file',
			);
		}
		return array(
			'success' => TRUE,
		);
	}
}

?>