Commit 57f9ca40d1205f5f15e06822b6b9fda73b80bc72

Authored by Benjamin Renard
1 parent 9f59dba7

Add MMS for CDAWeb remote access + filter dataset with a sampling too small

Showing 1 changed file with 11 additions and 5 deletions   Show diff stats
src/REMOTEDATA/CDAWEB.php
... ... @@ -21,7 +21,7 @@ class CDAWEB extends RemoteDataCenterClass
21 21 "Magnetic%20Fields%20(space)", "Particles%20(space)", "Plasma%20and%20Solar%20Wind",
22 22 "Radio%20and%20Plasma%20Waves%20(space)"]; //, "Ephemeris/Attitude/Ancillary" ];
23 23  
24   - private $excludeIns = ["GIFWALK", "Unknown"], $excludeGroup = ["THEMIS", "ARTEMIS", "MMS", "Apollo"]; // "NOAA", "GPS", "TSS-1R", "IBEX"];
  24 + private $excludeIns = ["GIFWALK", "Unknown"], $excludeGroup = ["THEMIS", "ARTEMIS", "Apollo"]; // "NOAA", "GPS", "TSS-1R", "IBEX"];
25 25  
26 26 // not in "https://heliophysicsdata.sci.gsfc.nasa.gov/queries/CDAWeb_SPASE.xql" List;
27 27 // FOR INFO : Excluded automatically
... ... @@ -139,7 +139,8 @@ class CDAWEB extends RemoteDataCenterClass
139 139 echo "All CDAWeb datasets : ".$datasets->length.PHP_EOL;
140 140  
141 141 foreach ($datasets as $ds) {
142   -
  142 +
  143 + $datasetId = $ds->getElementsByTagName("Id")->item(0)->nodeValue;
143 144 $insType = $ds->getElementsByTagName("InstrumentType")->item(0)->nodeValue;
144 145  
145 146 if (in_array ($this->html_encode($insType), $this->validInstrumentTypes )) {
... ... @@ -163,7 +164,7 @@ class CDAWEB extends RemoteDataCenterClass
163 164 if ( $obsGroupId == "UNKNOWN" ) {
164 165 $obsGroupId = $obsId;
165 166 }
166   -
  167 +
167 168 if ( $obsGroupId != "UNKNOWN" ) {
168 169 $this->obsGroupsIds[$obsGroupId][$obsId][$insId][] = $id;
169 170 }
... ... @@ -242,8 +243,13 @@ class CDAWEB extends RemoteDataCenterClass
242 243 }
243 244  
244 245 }
245   - else
  246 + else if (floatval($sampling) < 0.001) {
  247 + echo " Sampling too small : ".$dsId.PHP_EOL;
  248 + return NULL;
  249 + }
  250 + else {
246 251 $this->updateDDServerXml("MinSampling",$sampling);
  252 + }
247 253  
248 254 $dsNode->setAttribute('spaseUrl',$this->CDAWEB[$dsId]);
249 255 // $dsNode->setAttribute('masterCdf',$this->existsMasterCdf($dsId));
... ... @@ -526,8 +532,8 @@ class CDAWEB extends RemoteDataCenterClass
526 532 foreach ($this->obsGroupsIds as $groupId => $obss)
527 533 {
528 534 if (in_array($groupId, $this->excludeGroup)) continue;
529   - echo $groupId.PHP_EOL;
530 535 $obsNodes = array();
  536 + echo $groupId.PHP_EOL;
531 537 foreach ($obss as $obs => $inss)
532 538 {
533 539 // ! observatory OMNI is taken for observatoriesGroup OMNI only !
... ...