diff --git a/generic_data/Filters/filters_info.xml b/generic_data/Filters/filters_info.xml index 55e4831..4ed8951 100644 --- a/generic_data/Filters/filters_info.xml +++ b/generic_data/Filters/filters_info.xml @@ -8,7 +8,7 @@ <op id='ne' name='!='/> </ops> </condition> - <!--<condition id='sta' name='Start Time' type='date'> + <condition id='sta' name='Start Time' type='date'> <ops> <op id='le' name='<='/> <op id='ge' name='>='/> @@ -19,20 +19,20 @@ <op id='le' name='<='/> <op id='ge' name='>='/> </ops> - </condition>--> + </condition> <condition id='mis' name='Mission Name' type='string'> <ops> <op id='eq' name='='/> <op id='ne' name='!='/> </ops> </condition> - <!--<condition id='pro' name='Provider' type='string'> + <condition id='pro' name='Provider' type='select' selectList='provider'> <ops> <op id='eq' name='='/> <op id='ne' name='!='/> </ops> </condition> - <condition id='typ' name='Data type' type='select' selectList='dataType'> + <!-- <condition id='typ' name='Data type' type='select' selectList='dataType'> <ops> <op id='eq' name='='/> <op id='ne' name='!='/> diff --git a/generic_data/Filters/filters_selectLists.xml b/generic_data/Filters/filters_selectLists.xml index d3c3326..d33011a 100644 --- a/generic_data/Filters/filters_selectLists.xml +++ b/generic_data/Filters/filters_selectLists.xml @@ -27,6 +27,26 @@ <elt id='Comet' name='Comet'/> </elts> </selectList> + <selectList id='provider'> + <elts> + <elt id='PDS' name='Planetary Data System'/> + <elt id='PSA' name='Planetary Science Archive'/> + <elt id='CDAWeb' name='CDAWeb'/> + <elt id='OMNIWeb' name='OMNIWeb'/> + <elt id='CSA' name='Cluster Science Archive'/> + <elt id='IRAP' name='Institut de Recherche en Astrophysique et Planétologie'/> + <elt id='IRAP_THEMIS' name='THEMIS mirror at IRAP'/> + <elt id='Madrigal' name='Madrigal : EISCAT'/> + <elt id='University of Iowa' name='University of Iowa'/> + <elt id='ONERA' name='Centre francais de recherche aerospatiale'/> + <elt id='LESIA-OBSPM' name='Laboratoire etudes spatiales et instrumentation en astrophysique'/> + <elt id='JHU/APL' name='Johns Hopkins University'/> + <elt id='NOAA' name='National Oceanic and Atmospheric Administration'/> + <elt id='NAIF' name='Navigation and Ancillary Information Facility'/> + <elt id='ISGI/UNISTRA' name='ISGI/UNISTRA'/> + <elt id='WDC Kyoto via ISGI/UNISTRA' name='WDC Kyoto'/> + </elts> + </selectList> <selectList id='dataType'> <elts> <elt id='mag' name='Magnetometer'/> diff --git a/php/classes/FilterResParam.php b/php/classes/FilterResParam.php index 8203247..8a75923 100644 --- a/php/classes/FilterResParam.php +++ b/php/classes/FilterResParam.php @@ -146,56 +146,58 @@ $instruments = $this->xp->query("//mission[@xml:id='".$missionId."']//instrument"); - for ($j = 0; $j < $instruments->length; $j++) - { - $instrumentId = $instruments->item($j)->getAttribute('xml:id'); - - $datasets = $this->xp->query("//mission[@xml:id='".$missionId."']//instrument[@xml:id='".$instrumentId."']//dataset"); - - for ($k = 0; $k < $datasets->length; $k++) - { - $datasetId = $datasets->item($k)->getAttribute('xml:id'); - - switch($kind) - { - case 'sta' : - $dataTime = $datasets->item($k)->getAttribute('dataStart'); - break; - case 'sto' : - $dataTime = $datasets->item($k)->getAttribute('dataStop'); - break; - } - - list($day, $month, $year) = explode('-', $dataTime); - $date = mktime(0, 0, 0, $month, $day, $year); - list($year, $month, $day, $hour, $min, $sec) = split('[-T:]', $value); - $date_value = mktime($hour, $min, $sec, $month, $day, $year); - - $id = $datsetId; - $chain = $datasetId; - $node = $datasets->item($k); + for ($j = 0; $j < $instruments->length; $j++) + { + $instrumentId = $instruments->item($j)->getAttribute('xml:id'); - while ($id !== $missionId) { - $node = $node->parentNode; - $id = $node->getAttribute('xml:id'); - $chain = $id.";".$chain; - } + $datasets = $this->xp->query("//mission[@xml:id='".$missionId."']//instrument[@xml:id='".$instrumentId."']//dataset"); - switch($opId) - { - case 'le' : - if ($date <= $date_value) - array_push($result,$chain); - break; - case 'ge' : - if ($date >= $date_value) - array_push($result,$chain); - break; - } - } - } - } - + for ($k = 0; $k < $datasets->length; $k++) + { + $datasetId = $datasets->item($k)->getAttribute('xml:id'); + + switch($kind) + { + case 'sta' : + $dataTime = $datasets->item($k)->getAttribute('dataStart'); + break; + case 'sto' : + $dataTime = $datasets->item($k)->getAttribute('dataStop'); + break; + } + + // list($day, $month, $year) = explode('-', $dataTime); + // $date = mktime(0, 0, 0, $month, $day, $year); + // list($year, $month, $day, $hour, $min, $sec) = split('[-T:]', $value); + // $date_value = mktime($hour, $min, $sec, $month, $day, $year); + $date = strtotime($dataTime); + $date_value = strtotime($value); + + $id = $datsetId; + $chain = $datasetId; + $node = $datasets->item($k); + + while ($id !== $missionId) { + $node = $node->parentNode; + $id = $node->getAttribute('xml:id'); + $chain = $id.";".$chain; + } + + switch($opId) + { + case 'le' : + if ($date <= $date_value) + array_push($result,$chain); + break; + case 'ge' : + if ($date >= $date_value) + array_push($result,$chain); + break; + } + } + } + } + return $result; } -- libgit2 0.21.2