plotTempProfile.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. //require_once('/var/www/stsstatus/phplot.php');
  3. // positions of sensors
  4. // z-positions of top/bottom sensors
  5. $position = file('data/SensorPositionsTopBottom.txt');
  6. $tempError = 0.009; // 1.5 for uncalibrated, 0.00827 for calibrated sensors
  7. $data = array();
  8. for ($ii=0; $ii<sizeof($position); $ii++) {
  9. $tempTop = $adeiValue[21][$ii]; $tempBottom = $adeiValue[22][$ii];
  10. //if ($ii==1) $tempTop=""; // 200-RTP-3-5106 looks ok now (May 2, 2018)
  11. //if ($ii==1 || $ii==2 || $ii==3) $tempBottom="";
  12. if ($ii==3) $tempBottom="";
  13. $data[] = array( '', $position[$ii]/1000, $tempTop, $tempError, $tempError, $tempBottom, $tempError, $tempError );
  14. //echo $position[$ii]/1000 ." ". $tempTop ." ". $tempBottom . "<br>";
  15. }
  16. $plot = new PHPlot(605, 250);
  17. $plot->SetImageBorderType('plain');
  18. $plot->SetFont('title', 5); $plot->SetFont('x_title', 4); $plot->SetFont('y_title', 4);
  19. $plot->SetFont('x_label', 2); $plot->SetFont('y_label', 2);
  20. $plot->SetDataType('data-data-error');
  21. $plot->SetDataValues($data);
  22. # Main plot title:
  23. $plot->SetTitle('source temperature profile');
  24. $plot->SetPlotType('linepoints');
  25. $plot->SetLineStyles(array('solid', 'dashed') );
  26. $plot->SetLineWidths( 2.5 );
  27. $colors = array('red', 'blue');
  28. $plot->SetDataColors( $colors );
  29. $plot->SetErrorBarColors( $colors );
  30. $plot->SetPointShapes( array('delta', 'dot') );
  31. $plot->SetXLabel( 'longitudinal position (m)' );
  32. $plot->SetYLabel( 'temperature (K)' );
  33. $plot->SetLegend( array('top', 'bottom') );
  34. $plot->SetLegendUseShapes(true);
  35. $plot->SetLegendPosition(1, 0, 'plot', 1, 0, 12, -23);
  36. $plot->TuneYAutoRange(0.7);
  37. # Make sure Y axis starts at 0:
  38. //$plot->SetPlotAreaWorld(NULL, 0, NULL, NULL);
  39. $plot->SetPrintImage(false);
  40. $plot->DrawGraph();
  41. ?>