$x,"y"=>$y); } // GET KEYWORDS $lon = split(",",$_GET['lon']); $lat = split(",",$_GET['lat']); $oplot = $_GET['oplot']; $oplot2 = $_GET['oplot2']; $oplot3 = $_GET['oplot3']; // READ OBJECTS 1 if (empty($oplot) == 0) { if ($oplot=='sdss_sat') $filename = "data/sdss_satellites.dat"; if ($oplot=='gc') $filename = "data/gcs.dat"; if ($oplot=='mw_dwarfs') $filename = "data/mw_dwarfs.dat"; if ($oplot=='fermi') $filename = "data/fermi.dat"; $fd = fopen ($filename, "r"); $table = fread($fd,filesize ($filename)); fclose ($fd); $lines = explode("\n", $table); // split into lines $nobj = count($lines); $ras = array(); $ids = array(); $namess = array(); foreach ( $lines as $line ) { $line = explode(",", $line); // split line into collumns $olons[] = $line[0]; $olats[] = $line[1]; $onames[] = $line[2]; } } // READ OBJECTS 2 if (empty($oplot2) == 0) { if ($oplot2=='sdss_sat') $filename = "data/sdss_satellites.dat"; if ($oplot2=='gc') $filename = "data/gcs.dat"; if ($oplot2=='mw_dwarfs') $filename = "data/mw_dwarfs.dat"; $fd = fopen ($filename, "r"); $table = fread($fd,filesize ($filename)); fclose ($fd); $lines = explode("\n", $table); // split into lines $nobj = count($lines); $ras = array(); $ids = array(); $namess = array(); foreach ( $lines as $line ) { $line = explode(",", $line); // split line into collumns $olons2[] = $line[0]; $olats2[] = $line[1]; $onames2[] = $line[2]; } } // READ OBJECTS 3 if (empty($oplot3) == 0) { if ($oplot3=='sdss_sat') $filename = "data/sdss_satellites.dat"; if ($oplot3=='gc') $filename = "data/gcs.dat"; if ($oplot3=='mw_dwarfs') $filename = "data/mw_dwarfs.dat"; $fd = fopen ($filename, "r"); $table = fread($fd,filesize ($filename)); fclose ($fd); $lines = explode("\n", $table); // split into lines $nobj = count($lines); $ras = array(); $ids = array(); $namess = array(); foreach ( $lines as $line ) { $line = explode(",", $line); // split line into collumns $olons3[] = $line[0]; $olats3[] = $line[1]; $onames3[] = $line[2]; } } if(empty($olons)) $olons[] = -999; if(empty($olats)) $olats[] = -999; if(empty($olons2)) $olons2[] = -999; if(empty($olats2)) $olats2[] = -999; if(empty($olons3)) $olons3[] = -999; if(empty($olats3)) $olats3[] = -999; //if(empty($lon) == 0) $lons[] = $lon; //if(empty($lat) == 0) $lats[] = $lat; $lons = $lon; $lats = $lat; // READ IMAGE $im = imagecreatefrompng("sdss/stellar_halo/fos_dr7map.png"); // IMAGE SCALES $scale_x = imagesx($im); $scale_y = imagesy($im); // COLORS $red = imagecolorallocate ($im, 255,0,0); $green = imagecolorallocate ($im, 0,255,0); $blue = imagecolorallocate ($im, 0,0,255); $grey = imagecolorallocate ($im, 150,150,150); $white = imagecolorallocate ($im, 255,255,255); // USER OBJECTS $i=0; foreach ( $lons as $lon ) { $pt = getlocationcoords($lon, $lats[$i], $scale_x, $scale_y); imageellipse($im, $pt["x"], $pt["y"], 7, 7, $red); $i=$i+1; } // OTHER OBJECTS 1 $i=0; foreach ( $olons as $olon ) { $pt = getlocationcoords($olon, $olats[$i], $scale_x, $scale_y); imageellipse($im, $pt["x"], $pt["y"], 7, 7, $white); $i=$i+1; } // OTHER OBJECTS 2 $i=0; foreach ( $olons2 as $olon2 ) { $pt = getlocationcoords($olon2, $olats2[$i], $scale_x, $scale_y); imageellipse($im, $pt["x"], $pt["y"], 7, 7, $green); $i=$i+1; } // OTHER OBJECTS 3 $i=0; foreach ( $olons3 as $olon3 ) { $pt = getlocationcoords($olon3, $olats3[$i], $scale_x, $scale_y); imageellipse($im, $pt["x"], $pt["y"], 7, 7, $blue); $i=$i+1; } // RETURN IMAGE header ("Content-type: image/png"); imagepng($im); imagedestroy($im); ?>