// set vars $image =""; $instrument=""; $plot=""; $baseURL = "http://atoc.colorado.edu/~friedrik/Experiments/2010_Durango/data/"; $baseFilePath = "/home/atoc/friedrik/public_html/Experiments/2010_Durango/data/"; // grab data from form $month = $_GET["month"]; $day = $_GET["day"]; $instrument = $_GET["instrument"]; // Convert months to numbers if ($month == "July" ){ $monthDigit= "07"; } if ($month == "August" ){ $monthDigit= "08"; } if ($month == "September" ){ $monthDigit= "09"; } // Display the instrument type and the Month and Day. print "
Displaying data for $instrument on $month,$day
“;
// ==========================================
//
// This function test to see if the file exists
// If the file exists then spit out the URL
// If not then spit out an error message
//
// ==========================================
function checkFileExists($data1,$plot1){
$baseFilePath = “/home/atoc/friedrik/public_html/Experiments/2010_Durango/”;
$baseURL = “http://atoc.colorado.edu/~friedrik/Experiments/2010_Durango/”;
// data file
if (file_exists($baseFilePath.$data1)) {
// Data file exists
//echo “The file $baseFilePath$data1 exists
“;
print “
“;
print “Data file URL: Right click and save file“;
print “
“;
} else {
print (“
“.”NO DATA FILE FOUND” );
//echo “The DATA file: $baseFilePath$data1 does not exist
“;
}
// Plot exists
if (file_exists($baseFilePath.$plot1)) {
// Plot exists
//echo “
The file $baseFilePath$plot1 exists
“;
print “
“;
print “Plot file URL: Right click and save file“;
print “
“;
} else {
print (“
“.”NO PLOT FOUND” );
//echo “The PLOT file: $baseFilePath$plot1 does not exist
“;
}
// return ($n * $n);
}
// ==========================================
//
// Disdrometer data
//
// ==========================================
if ($instrument == “Disdrometer-CU#1” ) {
//print “
Instrument= “.$instrument.”
“;
$data = “/Disd/CU1/2010″.$monthDigit.$day.”_PA01.dat”;
$plot = “/Disd/CU1/2010″.$monthDigit.$day.”_Concentrations_PA01.pdf”;
// call file exists function and print out result
checkFileExists($data,$plot);
}
if ($instrument == “Disdrometer-CU#2” ) {
//print “
Instrument= “.$instrument.”
“;
$data = “/Disd/CU2/2010″.$monthDigit.$day.”_PA02.dat”;
$plot = “/Disd/CU2/2010″.$monthDigit.$day.”_Concentrations_PA02.pdf”;
// call file exists function and print out result
checkFileExists($data,$plot);
}
// ==========================================
//
// MRR !!!
//
// ==========================================
if ($instrument == “MRR-CU” ) {
//print “
Instrument= “.$instrument.”
“;
$data = “data/MRR/”.$monthDigit.$day.”.mrr”;
$plot = “plots/MRR/10″.$monthDigit.$day.”_Z_”.$monthDigit.$day.”.gif”;
// call file exists function and print out result
checkFileExists($data,$plot);
}
?>
// set vars
$image ="";
$instrument="";
$plot="";
$baseURL = "http://atoc.colorado.edu/~friedrik/Experiments/2010_Durango/data/";
$baseFilePath = "/home/atoc/friedrik/public_html/Experiments/2010_Durango/data/";
// grab data from form
$month = $_GET["month"];
$day = $_GET["day"];
$instrument = $_GET["instrument"];
// Convert months to numbers
if ($month == "July" ){
$monthDigit= "07";
}
if ($month == "August" ){
$monthDigit= "08";
}
if ($month == "September" ){
$monthDigit= "09";
}
// Display the instrument type and the Month and Day.
print "
Displaying data for $instrument on $month,$day
“;
// ==========================================
//
// This function test to see if the file exists
// If the file exists then spit out the URL
// If not then spit out an error message
//
// ==========================================
function checkFileExists($data1,$plot1){
$baseFilePath = “/home/atoc/friedrik/public_html/Experiments/2010_Durango/”;
$baseURL = “http://atoc.colorado.edu/~friedrik/Experiments/2010_Durango/”;
// data file
if (file_exists($baseFilePath.$data1)) {
// Data file exists
//echo “The file $baseFilePath$data1 exists
“;
print “
“;
print “Data file URL: Right click and save file“;
print “
“;
} else {
print (“
“.”NO DATA FILE FOUND” );
//echo “The DATA file: $baseFilePath$data1 does not exist
“;
}
// Plot exists
if (file_exists($baseFilePath.$plot1)) {
// Plot exists
//echo “
The file $baseFilePath$plot1 exists
“;
print “
“;
print “Plot file URL: Right click and save file“;
print “
“;
} else {
print (“
“.”NO PLOT FOUND” );
//echo “The PLOT file: $baseFilePath$plot1 does not exist
“;
}
// return ($n * $n);
}
// ==========================================
//
// Disdrometer data
//
// ==========================================
if ($instrument == “Disdrometer-CU#1” ) {
//print “
Instrument= “.$instrument.”
“;
$data = “/Disd/CU1/2010″.$monthDigit.$day.”_PA01.dat”;
$plot = “/Disd/CU1/2010″.$monthDigit.$day.”_Concentrations_PA01.pdf”;
// call file exists function and print out result
checkFileExists($data,$plot);
}
if ($instrument == “Disdrometer-CU#2” ) {
//print “
Instrument= “.$instrument.”
“;
$data = “/Disd/CU2/2010″.$monthDigit.$day.”_PA02.dat”;
$plot = “/Disd/CU2/2010″.$monthDigit.$day.”_Concentrations_PA02.pdf”;
// call file exists function and print out result
checkFileExists($data,$plot);
}
// ==========================================
//
// MRR !!!
//
// ==========================================
if ($instrument == “MRR-CU” ) {
//print “
Instrument= “.$instrument.”
“;
$data = “data/MRR/”.$monthDigit.$day.”.mrr”;
$plot = “plots/MRR/10″.$monthDigit.$day.”_Z_”.$monthDigit.$day.”.gif”;
// call file exists function and print out result
checkFileExists($data,$plot);
}
?>