STEREO/SEPT Data Pages
STEREO/SEPT Browse Plots -  IEAP - CAU Kiel (Germany)                                    
    
The parameters are:

"; //echo "

The parameter fail is: ".$fail."

"; if ($fail === "nopars") { //$filename="noplot.png"; //echo"

"; //echo "

Please use the controls to request a STEREO/SEPT plot

"; echo "

\"Plot

"; } else { //EXTRA CODE ADDED TO AVOID A REQUEST BEFORE JAN 17,2007 (EVEN IF THE PLOTS ARE THERE) //$firstdate=gregoriantojd('01','17','2007'); //if ($juliad < $firstdate){ //echo "

\"Plot

"; //}else { if (($plottype === "orbitg") or ($plottype === "orbith")){ //ORBIT PLOTS DO NOT INCLUDE SPACECRAFT AND SENSOR IN THE NAME and there is only one version for all the resolutions, They are stored in the directory etc $filename='./plots/etc/'.$year.'/SEPT'.'_'.$plottype.'_'.$year.'_'.$doy.'_'.$length.'.png'; } else if (($plottype === "e_pad") or ($plottype === "p_pad")){ //Pad plots do not include SENSOR IN THE NAME $filename='./plots/'.$resolution.'/'.$year.'/'.$plottype.'/SEPT'.$spacecraft.'_'.$plottype.'_'.$year.'_'.$doy.'_'.$length.'_'.$resolution.'.png'; }else if (($plottype === "e_spect") or ($plottype === "p_spect")){ //SPECTRA PLOTS WILL BE ONLY AVAILABLE FROM 1min data!! $resolution="1min"; $filename='./plots/'.$resolution.'/'.$year.'/'.$plottype.'/SEPT'.$spacecraft.'_'.$pointing.'_'.$plottype.'_'.$year.'_'.$doy.'_'.$length.'_'.$resolution.'.png'; } else{ $filename='./plots/'.$resolution.'/'.$year.'/'.$plottype.'/SEPT'.$spacecraft.'_'.$pointing.'_'.$plottype.'_'.$year.'_'.$doy.'_'.$length.'_'.$resolution.'.png'; } if (file_exists($filename)) { //echo "

The plot:

"; echo "

\"Plot

"; //echo "

Se acabo, arriba deberķa estar el siguiente plot:".$filename."

"; } else { echo "

\"Plot

"; $filename='*None* '; } //echo "

Filename is: ".$filename."

"; } //} //echo "

Expected format: septA_s_specg_07044_1day.png

"; //echo "

The image $filename will be just here

"; //septA_sun_specg_07044_1day.png //STORE LOGFILE $extra='daystart: '.$daystarto.' length: '.$length.' plot: '.$resolution.' '.$spacecraft.' '.$pointing.' '.$plottype.' '; $dummmmy=logfile('./wdata/log.txt',$extra); ////// ?>
 Nominal data coverage starts on Jan 17, 2007. 
 *Warning: These data are not verified and should not be used for serious data analysis.* P.A.D. plots are preliminary.
R. Gómez-Herrero. For data inquiries contact A. Klassen: klassen[at]physik.uni-kiel.de  |  ".$couvi." Visits and ".$cou." Plot requests since June 1, 2018 
"; ?>
CAU          IEAP          ETPH          STEREO Science Center          PLASTIC          IMPACT Data Portal          MAG          SEP Suite          SEPT Home

Generated on: ".date('Y-m-d')."

"; //echo "

<-- Back to the plot form

"; //echo "
"; //echo ""; //echo "
"; //$null=file_put_contents('log.txt',"\r\n".'Result: **ERROR 1**',FILE_APPEND); echo "

Plot created

"; //exit(); return; } //===================================================== function formatdate($dat,&$doy,&$year,$command) //===================================================== //this function returns (byreference) the doy and year //if dd-mm format is detected, then doy is calculated //The argument $doy must contain the original string //introduced by the user in the formular //the argument $year is used only to return the year // //In addition, the corresponding julian date is returned { //php 4 compatible $firstpos=strpos($dat,'-'); $lastpos=strrpos($dat,'-'); if (($firstpos === false) or ($lastpos === false)) { //case (a): wrong format $doy=-1; $year=-1; } elseif ($lastpos === $firstpos){ //case (b) format is doy-YYYY $year=substr($dat,$firstpos+1); $doy=substr($dat,0,$firstpos); } else { //case (c) format is mm-dd-yyyy $month=substr($dat,0,$firstpos); $day=substr($dat,$firstpos+1,$lastpos-$firstpos-1); $year=substr($dat,$lastpos+1); $doy=daytodoy($day,$month,$year); } if ($command === "next") { $doy=$doy+1; } else if ($command === "previous") { $doy=$doy-1; } else if ($command === "nextbigstep") { $doy=$doy+10; } else if ($command === "previousbigstep") { $doy=$doy-10; } //Finally we correct from inconsistencies like doy 367 or -1 or 366 on non-leap year //We achieve this adding doy to 1/1/year in julian dates and converting to gregorian and back again //echo "month,day,year,doy----first,last=".$month." ".$day." ".$year."---".$doy." ".$firstpos." ".$lastpos; $juli=gregoriantojd("01","01",$year)+$doy-1; $a=jdtogregorian($juli); //list($mo,$da,$ye) = split('/',$a,3);OBSOLETE PHP5 list($mo,$da,$ye) = explode('/',$a,3); $doy=gregoriantojd($mo,$da,$ye)-gregoriantojd('01','01',$ye)+1; $year=$ye; return $juli; } //===================================================== function daytodoy($day,$month,$year) //===================================================== //conversion from day/month/year to day of the year //if something fails, the returned value is <0 and can be recognised later { $julian = gregoriantojd($month,$day,$year); $base = gregoriantojd('01','01',$year); $dayofyear=$julian-$base+1; return $dayofyear; } //===================================================== function totaldays($ye1,$do1,$ye2,$do2) //===================================================== //total number of days from start&end years and days of the year { $julian1 = gregoriantojd('01','01',$ye1)+$do1; $julian2 = gregoriantojd('01','01',$ye2)+$do2; $tota=$julian2-$julian1; // echo 'dayofyear'.$dayofyear; return $tota; } //===================================================== function webcounter($file,$whattodo) //===================================================== //Just a unefficient counter of visits //value is stored in a file called counter.txt //if the file does not exist, it will be created //the file simply stores: creation date#counter number //if there are exactly simultaneous file access, probably the counter //will be reset or one of them will not be counted!!(?)) //the param whattodo can be set to 1 if we want only to read the current value of the counter without changing anything { $counterstro=file_get_contents($file,FALSE); if (strlen($counterstro)<10){ $counter='1'; $counterdate=date('Y-m-d'); } else { $posi=strpos($counterstro,"#"); $counter=substr($counterstro,$posi+1); $counterdate=substr($counterstro,0,$posi); } if (($posi<=0) or ($posi>10)){ //Counter file corrupted???==>proceed in the same way than no file. This should never happen.... $counter='1'; $counterdate=date('Y-m-d'); } if ($whattodo === 1) { return $counter; } else { $counter=$counter+1; $counterstr=$counterdate."#".$counter; // This needs php5, replaced by open,write,close $null=file_put_contents('./wdata/counter.txt',$counterstr); $fd = fopen($file,"w+"); fwrite($fd,$counterstr); fclose($fd); return $counter; } } //===================================================== function logfile($file,$extra) //===================================================== //This fuction appends information to a logfile //If the file does not exit, it is created { $datt=date("m.d.y,H:i:s"); $logstr=$datt.' | '.'QUERY: '.$extra.' ||| Lang_'.$_SERVER["HTTP_ACCEPT_LANGUAGE"].' |Rem_Add_'.$_SERVER["REMOTE_ADDR"].' | Rem_host_'.$_SERVER["REMOTE_HOST"].' | Fwd_for_'.$_SERVER["HTTP_X_FORWARDED_FOR"].' | IP_'.$_SERVER["HTTP_CLIENT_IP"].' | Ref_'.$_SERVER["HTTP_REFERER"].' | host_'.$_SERVER["HTTP_HOST"].' | Agent_'.$_SERVER["HTTP_USER_AGENT"]."\r\n"; $fd = fopen($file,"a+"); fwrite($fd,$logstr); fclose($fd); return "OK"; } //===================================================== function createdroplist($listname,$values,$labels,$selectedvalue,$default,$title,$tama) //===================================================== //creates an html form droplist //optionally, if an element with the value $selectedvalue is found, //it will be preselected { $lastelement=count($values)-1; if ((isset($selectedvalue) === false) or (strlen($selectedvalue) === 0)) { $selectedvalue=$default; } if (isset($tama) === false) { $sizz="1"; } else { //$sizz=count($values); $sizz=$tama; } //Extra string passed (e.g. to auto-submit when the droplist changes) //in this case we activate the 1) form is sent when the droplist changes. //2) the name of the control (droplist) sending the form is stored in a hidden field to restore the focus whe the new instance is loaded $extra="onchange=\"document.septplots.wheretofocus.value ='".$listname."'; document.septplots.submit();\""; echo ""; return; } //===================================================== function createradiobuttons($listname,$values,$labels,$selectedvalue,$default,$title,$useless) //===================================================== //like createdroplist, but creates a set of radio buttons in the same line, { $lastelement=count($values)-1; if ((isset($selectedvalue) === false) or (strlen($selectedvalue) === 0)) { $selectedvalue=$default; } //Extra string passed (e.g. to auto-submit when the droplist changes) //in this case we activate the 1) form is sent when the droplist changes. //2) the name of the control (droplist) sending the form is stored in a hidden field to restore the focus whe the new instance is loaded //echo " $labels[$i]   "; } else { echo " $labels[$i]   ";} } return; } //END ?>