array( 'header' => "Authorization: Basic " . base64_encode("$username:$password"), "Connection: close\r\n" ) )); for ($id = 0; $id < sizeof($adeiChannel); $id++) { $adeiChannels = ""; for ($id2 = 0; $id2 < sizeof($adeiChannel[$id]); $id2++) { $adeiChannels = $adeiChannels . $adeiChannel[$id][$id2] . ","; } $adeiChannels = substr($adeiChannels, 0, strlen($adeiChannels) - 1); $fileip = file_get_contents("https://adei-katrin.kaas.kit.edu/adei/services/getdata.php?db_server=virtual&db_name=srctree&db_group=-3&control_group=-3&virtual=srctree&srctree=" . $adeiChannels . "&window=60&format=csv", false, $context); //$fileip = file_get_contents("http://ipekatrinbackupserv1.ipe.kit.edu/adei/services/getdata.php?db_server=virtual&db_name=srctree&db_group=-3&control_group=-3&virtual=srctree&srctree=" . $adeiChannels . "&window=60&format=csv", false, $context); //echo $fileip . "
"; for ($id2 = sizeof($adeiChannel[$id]) - 1 ; $id2 > -1; $id2--) { $pos = strrpos($fileip, ","); $adeiValue[$id][$id2] = floatval(substr($fileip, $pos + 2)); // values of sensors $fileip = substr($fileip, 0, $pos); //echo $id . "," . $id2 . "," . $adeiValue[$id][$id2] . "
"; } } // positions of sensors // z-positions of top/bottom sensors $position = file('data/SensorPositionsTopBottom.txt'); $data = array(); for ($ii=0; $iiSetImageBorderType('plain'); $plot->SetFont('title', 5); $plot->SetFont('x_title', 4); $plot->SetFont('y_title', 4); $plot->SetFont('x_label', 2); $plot->SetFont('y_label', 2); $plot->SetDataType('data-data-error'); $plot->SetDataValues($data); # Main plot title: $plot->SetTitle('source temperature profile'); $plot->SetPlotType('linepoints'); $plot->SetLineStyles(array('solid', 'dashed') ); $plot->SetLineWidths( 2.5 ); $colors = array('red', 'blue'); $plot->SetDataColors( $colors ); $plot->SetErrorBarColors( $colors ); $plot->SetPointShapes( array('delta', 'dot') ); $plot->SetXLabel( 'longitudinal position (m)' ); $plot->SetYLabel( 'temperature (K)' ); $plot->SetLegend( array('top', 'bottom') ); $plot->SetLegendUseShapes(true); $plot->SetLegendPosition(1, 0, 'plot', 1, 0, 12, -23); # Make sure Y axis starts at 0: //$plot->SetPlotAreaWorld(NULL, 0, NULL, NULL); $plot->DrawGraph(); ?>