Commit 873ce7b2e95734ee6b657cf0e8bcf870ef996081

Authored by Elena.Budnik
1 parent 4a24f977

CDAWEB exclude some missions

Showing 1 changed file with 20 additions and 12 deletions   Show diff stats
src/REMOTEDATA/CDAWEB.php
... ... @@ -22,7 +22,7 @@ class CDAWEB extends RemoteDataCenterClass
22 22  
23 23 // not used : $validInstrumentTypes = ["Ephemeris"];
24 24  
25   - private $excludeIns = ["GIFWALK", "Unknown"], $excludeGroup = ["THEMIS", "ARTEMIS", "NOAA"];
  25 + private $excludeIns = ["GIFWALK", "Unknown"], $excludeGroup = ["THEMIS", "ARTEMIS", "NOAA", "GPS", "TSS-1R"];
26 26  
27 27 // not in "https://heliophysicsdata.sci.gsfc.nasa.gov/queries/CDAWeb_SPASE.xql" List;
28 28 // FOR INFO : Excluded automatically
... ... @@ -225,10 +225,10 @@ class CDAWEB extends RemoteDataCenterClass
225 225 $dsNode = $this->domAmda->createElement('dataset');
226 226  
227 227 curl_setopt($this->ch, CURLOPT_HTTPHEADER, array("Accept: application/json"));
228   - curl_setopt($this->ch, CURLOPT_URL, $this->dataViewURL."/datasets/?idPattern=".$dsId);
  228 + curl_setopt($this->ch, CURLOPT_URL, $this->dataViewURL."/datasets?idPattern=".$dsId);
229 229  
230 230 $obj = json_decode(curl_exec($this->ch));
231   - $dataSet = $obj->DatasetDescription;
  231 + $dataSet = $obj->DatasetDescription;
232 232  
233 233 $dsNode->setAttribute("xml:id",$this->baseID.":".$dsId);
234 234 $dsNode->setAttribute("name", $dsId);
... ... @@ -250,10 +250,14 @@ class CDAWEB extends RemoteDataCenterClass
250 250 }
251 251  
252 252 if ($sampling < -1) {
253   - echo " !!! $dsId $sampling".PHP_EOL;
  253 + echo " !!! $dsId sampling = $sampling".PHP_EOL;
254 254 error_log("! No sampling : ".$dsId." : ".$sampling.PHP_EOL,3,err);
255 255 }
256   - else
  256 + else if ($sampling == 0) {
  257 + echo " !!! $dsId sampling = $sampling".PHP_EOL;
  258 + error_log("! No Sampling : ".$dsId." : ".$sampling.PHP_EOL,3,err);
  259 + }
  260 + else
257 261 $this->updateDDServerXml("MinSampling",$sampling);
258 262  
259 263 $dsNode->setAttribute('spaseUrl',$this->CDAWEB[$dsId]);
... ... @@ -345,7 +349,7 @@ class CDAWEB extends RemoteDataCenterClass
345 349 protected function getAllSpaseDatasets()
346 350 {
347 351 require_once "simple_html_dom.php";
348   -
  352 +
349 353 if (file_exists($this->location."/NumericalData.html"))
350 354 rename($this->location."/NumericalData.html",$this->location."/NumericalData.html.bak");
351 355  
... ... @@ -355,12 +359,16 @@ class CDAWEB extends RemoteDataCenterClass
355 359  
356 360 $html = file_get_html($this->location.'/NumericalData.html');
357 361 $ids = $html->find('td[class="Spase.URL.ProductID"]');
358   -
  362 +
359 363 foreach ($ids as $id)
360   - {
  364 + {
  365 +
  366 + if ($id->next_sibling()) {
361 367 $ref = $id->next_sibling()->find('a');
362 368 $key = $id->find('a');
363   - $this->CDAWEB[$key[0]->innertext] = $ref[0]->innertext;
  369 + $this->CDAWEB[$key[0]->innertext] = $ref[0]->innertext;
  370 + }
  371 +
364 372 }
365 373 error_log("SPASE-defined CDAWEB datasets from ".CDAWebConfigClass::$spaseRegistry." : ".count($this->CDAWEB).PHP_EOL,3,log);
366 374 echo "SPASE-defined CDAWEB datasets : ".count($this->CDAWEB).PHP_EOL;
... ... @@ -430,10 +438,11 @@ class CDAWEB extends RemoteDataCenterClass
430 438 $this->setDataViewURL();
431 439  
432 440 curl_setopt($this->ch, CURLOPT_URL,$this->dataViewURL."/datasets/$ds/orig_data/$start,$stop/");
  441 +
433 442 $res = new DomDocument("1.0");
434   -
  443 +
435 444 $res->loadXML(curl_exec($this->ch));
436   -
  445 +
437 446 if ($res->getElementsByTagName("html")->length > 0)
438 447 {
439 448 error_log("ERROR no response for : ".$ds." : ".$start." - ".$stop.PHP_EOL,3,err);
... ... @@ -506,7 +515,6 @@ class CDAWEB extends RemoteDataCenterClass
506 515  
507 516 $masterCdf = $this->getMasterCdf($ds);
508 517 $localCdf = strtolower($ds).".cdf";
509   -
510 518 if (!copy($masterCdf, $localCdf)) return false;
511 519  
512 520 $infoFile = $this->convert2nc($localCdf);
... ...