function write_region_body($date, $region)
{
    include "globals.php";
    $links = array();
    for ($i = 0; $i < count($region_types); $i++) {
        $type = $region_types[$i];
        $instrument = substr($type, 0, 4);
        $filter = substr($type, 5, 5);
        $file = find_latest_file($date, $instrument, $filter, 'png', 'ar', $region);
        $links[] = link_image("{$arm_data_path}data/{$date}/pngs/{$instrument}/{$file}", 335, false);
    }
    print "<table>\n";
    $ncols = 2;
    for ($i = 0; $i < count($region_types); $i++) {
        if ($i == 0) {
            print "\t<tr>\n";
        } elseif ($i % $ncols == 0) {
            print "\t<tr>\n\t<tr>\n";
        }
        print "\t\t<td align=center valign=center>\n";
        print "\t\t\t<a href=JavaScript:RegionZoom(\"./region_pop.php?date={$date}&type=" . $region_types[$i] . "&region={$region}\")>\n";
        print "\t\t\t\t" . $links[$i] . "\n";
        print "\t\t\t</a>\n";
        print "\t\t</td>\n";
        if ($i == count($region_types) - 1) {
            print "\t</tr>\n";
        }
    }
    print "</table>\n";
}
Example #2
0
function write_jscript($date, $this_page)
{
    include "globals.php";
    //	get the yyyymm and year currently being displayed.  this is needed for the bbso activity report
    $yyyymm = date("Ym", strtotime($date));
    $yyyy = date("Y", strtotime($date));
    //	print the java script
    print "\t\tfunction TermWindow()\n";
    print "\t\t{\n";
    print "\t\t\topen(\"http://www.bbso.njit.edu/Research/ActivityReport/brep{$yyyymm}.html\",\"new_window\",\"toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=y,scrollbars=yes,width=500,height=600\");\n";
    print "\t\t}\n";
    print "\t\tfunction OpenGoes( url )\n";
    print "\t\t{\n";
    print "\t\t\topen( url,\"\",\"toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=yes,width=710,height=605\");\n";
    print "\t\t}\n";
    print "\t\tfunction OpenSoho( url )\n";
    print "\t\t{\n";
    print "\t\t\topen( url,\"\",\"toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=no,width=710,height=670\");\n";
    print "\t\t}\n";
    print "\t\tfunction OpenAce( url )\n";
    print "\t\t{\n";
    print "\t\t\topen( url,\"\",\"toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=no,width=710,height=670\");\n";
    print "\t\t}\n";
    print "\t\tfunction OpenMotD( url )\n";
    print "\t\t{\n";
    print "\t\t\topen( url,\"\",\"toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=yes,width=710,height=605\");\n";
    print "\t\t}\n";
    /*print("		function OpenEvents(url)\n");
    		print("		{\n");
    		print("			open(url,\"new_window\",\"toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=y,scrollbars=yes\");\n");
    		print("		}\n");*/
    print "\t\tfunction OpenEvents()\n";
    print "\t\t{\n";
    print "           open(\"{$arm_data_path}/data/{$date}/meta/noaa_events_raw_{$date}.txt\",\"new_window\",\"toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=y,scrollbars=yes\");\n";
    //print("			open(\"http://www.sec.noaa.gov/ftpdir/indices/${yyyy}_events/${date}events.txt\",\"new_window\",\"toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=y,scrollbars=yes\");\n");
    print "\t\t}\n";
    print "\t\tfunction OpenLastEvents(url)\n";
    print "\t\t{\n";
    print "\t\t\topen(url,\"new_window\",\"toolbar=no,location=yes,directories=no,status=no,menubar=no,resizable=yes,scrollbars=yes,width=810,height=750,left=5,top=20\");\n";
    print "\t\t}\n";
    //	if it is the index page, write the scrolly thing.  this will read from a file at some point
    if ($this_page == "index.php") {
        print "\t\tfunction scroll(n)\n";
        print "\t\t{\n";
        print "\t\t\tvar spaces = \"                                                                                   \";\n";
        print "\t\t\tvar text = '... Max Millennium MOTD issued on 12-Jul-2004 14:01:11.000 UT ... MM#009 Default HESSI Target ...Dear RHESSI collaborators, The new region on the SE limb continues to produce numerous low- to  intermediate- level events, including an M1.7 on 12-July-2004 07:30 UT.  Further C-class events expected, with a good chance for another M-class  flare. The position of this region on 12-July-2004 14:00 UT is: S07E85, ( -934\", -120\") See <A HREF=http://beauty.nascom.nasa.gov/arm/latest/slideshow_fd.html http://beauty.nascom.nasa.gov/arm/latest/slideshow_fd.html  for images and http://solar.physics.montana.edu/max_millennium/ops/observing.shtml http://solar.physics.montana.edu/max_millennium/ops/observing.shtml  for a description of the current Max Millennium Observing Plan. ...';\n";
        print "\t\t\tvar scrolling_text = spaces + text;\n";
        print "\t\t\tscrolling_text = scrolling_text.substring(n,scrolling_text.length);\n";
        print "\t\t\twindow.defaultStatus = scrolling_text;\n";
        print "\t\t\tif(scrolling_text.length > 0) n ++;\n";
        print "\t\t\telse n = 0\n";
        print "\t\t\ts = n;\n";
        print "\t\t\tn = setTimeout(\"scroll(s)\", 70);\n";
        print "\t\t}\n";
    }
    //	if called from a full disk or regional display, write the code for the regional pop-ups
    if ($this_page == "full_disk.php" || $this_page == "region.php") {
        print "\t\tfunction RegionZoom( url )\n";
        print "\t\t{\n";
        print "\t\t\topen( url,\"new_window\",\"toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=y,scrollbars=yes,width=660,height=755\");\n";
        print "\t\t}\t\n";
    }
    if ($this_page == "slideshow.php") {
        $dir = "{$arm_data_path}data/{$date}/pngs";
        print "\t\tvar speed = 10000\n";
        print "\t\tvar Pic = new Array()\n";
        $i = 0;
        foreach ($fd_types as $type) {
            $instrument = substr($type, 0, 4);
            $filter = substr($type, 5, 5);
            $file = find_latest_file($date, $instrument, $filter, 'png', 'fd');
            if (file_exists("{$arm_data_path}data/{$date}/pngs/{$instrument}/{$file}")) {
                print "\t\tPic[{$i}] = '{$arm_data_path}data/{$date}/pngs/{$instrument}/{$file}'\n";
                $i++;
            }
        }
        print "\t\tvar t\n";
        print "\t\tvar j = 0\n";
        print "\t\tvar p = Pic.length\n";
        print "\t\tvar preLoad = new Array()\n";
        print "\t\tfor (i = 0; i < p; i++)\n";
        print "\t\t{\n";
        print "\t\t\tpreLoad[i] = new Image()\n";
        print "\t\t\tpreLoad[i].src = Pic[i]\n";
        print "\t\t}\n";
        print "\t\t\n";
        print "\t\tfunction runSlideShow()\n";
        print "\t\t{\n";
        print "\t\t\tdocument.images.SlideShow.src = preLoad[j].src\n";
        print "\t\t\tj = j + 1\n";
        print "\t\t\tif (j > (p-1)) j=0\n";
        print "\t\t\tt = setTimeout('runSlideShow()', speed)\n";
        print "\t\t}\n";
    }
}
function write_index_body2($date, $indexnum)
{
    include "globals.php";
    $index_types = $index2_types;
    $index_types_strs = $index2_types_strs;
    $links = array();
    for ($i = 0; $i < count($index_types); $i++) {
        $links[] = link_image("{$arm_data_path}data/{$date}/pngs/thmb/{$index_types[$i]}_thumb.png", 220, false);
        list($instrument, $filter) = split('[_]', $index_types[$i], 2);
        $file = find_latest_file($date, $instrument, $filter, 'png', 'fd');
        if ($file == "No File Found") {
            $times[] = "No Time Data Available";
        } else {
            list($inst, $filt, $fd, $fdate, $time, $ext) = split('[_.]', $file, 6);
            $str = $index_types_strs[$index_types[$i]];
            $dt = $fdate . " " . substr($time, 0, 2) . ":" . substr($time, 2, 2);
            //$str = $str . " " . date("d-M-Y H:i", strtotime($dt)) . " UT";
            $str = $str . " " . $fdate . " " . date("H:i", strtotime($dt));
            $times[] = $str;
        }
    }
    print "<table>\n";
    for ($i = 0; $i < count($index_types); $i++) {
        if ($i == 0) {
            print "\t<tr>\n";
        } elseif ($i % 3 == 0) {
            print "\t<tr>\n\t<tr>\n";
        }
        print "\t\t<td align=center valign=center>\n";
        print "\t\t\t<small><i>" . $times[$i] . "</i></small>\n";
        if ($index_types[$i] == 'bake_00195') {
            print "         <a href=\"http://sohowww.nascom.nasa.gov/hotshots/2004_01_04/\">\n";
        } else {
            print "\t\t\t<a href=\"full_disk.php?date={$date}&type=" . $index_types[$i] . "&indexnum={$indexnum}\">\n";
        }
        print "\t\t\t\t" . $links[$i] . "\n";
        print "\t\t\t</a>\n";
        print "\t\t</td>\n";
        if ($i == count($index_types) - 1) {
            print "\t</tr>\n";
        }
    }
    print "\t<tr>\n";
    print "\t\t<td align=left valign=top colspan=3>\n";
    ?>
		<hr>
		<div class="arm_ticker">
			<a href="#" id="arm_ticker_link" style="text-decoration:none;color:black;" onmouseover="this.style.color='blue'" onmouseout="this.style.color='black'"></a>
		</div>
		
		<script language="JavaScript" type="text/javascript">
			<!--
				function ticker()
				{
					item_num = 0;
					curr_disp_item_length = 0;
					
					if (document.getElementById) 
					{	
						ticker_anchor = document.getElementById("ticker_anchor");
						ticker_helper();   	
					}
					else 
					{
						document.write("<style>.ticker{display:none;}.ticko{border:0px; padding:0px;}</style>");
						return true;
					}
				}
				
				function ticker_helper()
				{
					var wait_time;
					var disp_str="";
					
					if (curr_disp_item_length == 0)
					{
						//items[item_num]=items[item_num] + "...";
						//curr_disp_item_length++;
						item_num = item_num % n_items;
						arm_ticker_link.href = item_links[item_num];
					}
					
					//if ((curr_disp_item_length % 3) == 0) cursor="<span style=\"background-color:gray\">&nbsp;&nbsp;</span>";
					//else cursor="";
					//arm_ticker_link.innerHTML = disp_str + cursor;
					
					
					disp_str = "<i><b>Summary:</b></i> " + items[item_num].substring(0, curr_disp_item_length);
					
					if(curr_disp_item_length <= items[item_num].length)
					{
						curr_disp_item_length++;
						wait_time = item_time;
											
						if (((total_time/item_time)%5) == 0) cursor="";//"<span style=\"background-color:gray\">&nbsp;&nbsp;</span>";
						else cursor="";
					}
					else
					{
						
						wait_time=pause_time
						//wait_time = item_time;
						//if (total_pause_time > pause_time)
						//{
							item_num++;
							curr_disp_item_length = 0;
							total_time=0;
							total_pause_time=0;
							cursor="";
						//}
						//else
						//{
						//	total_pause_time += wait_time;
						//}						
					}
					
					total_time += wait_time;

					
					arm_ticker_link.innerHTML = disp_str + cursor;
					setTimeout("ticker_helper()", wait_time);			
				}

			
				var item_time = 75;
				var pause_time = 3000;
				var total_time = 0;
				var total_pause_time = 0;
			
				var items = new Array();
				var item_links = new Array();
				
				
				<?php 
    $items = array();
    $items[] = scrape_ticker_activity_level($date);
    $items[] = scrape_ticker_most_active_region($date);
    //$items[] = scrape_ticker_most_recent_flare($date);
    $items[] = scrape_ticker_most_likely_to_flare($date);
    if ($eit_bakeout) {
        $item = array();
        $item["text"] = "SOHO EIT is in Bakeout";
        $item["link"] = "http://sohowww.nascom.nasa.gov/hotshots/2004_01_04/";
        $items[] = $item;
    }
    $total = count($items);
    $missing = 0;
    for ($i = 0; $i < count($items); $i++) {
        if ($items[$i]["text"] == "none") {
            $total--;
            $missing++;
            continue;
        }
        ?>
				
				items[<?php 
        echo $i - $missing;
        ?>
] = "<?php 
        print $items[$i]["text"];
        ?>
";
				item_links[<?php 
        echo $i - $missing;
        ?>
] = "<?php 
        echo $items[$i]["link"];
        ?>
";
			
			    <?php 
    }
    ?>
			
				var n_items = <?php 
    echo $total;
    ?>
;
				
				ticker();
			--> 
		</script>
		
		
		
		
	<hr>	
					<font size=+2><i>W</i></font>elcome  to  
					<a class=mail2 href=index.php>SolarMonitor</a>, hosted at the <a class=mail2 href=http://grian.phy.tcd.ie/index.php>Solar Physics Group, Trinity College Dublin</a> and at NASA Goddard Space Flight Center's
	       <a class=mail2 href=http://umbra.nascom.nasa.gov>Solar Data Analysis Center (SDAC)</a>. These pages 
					contain near-realtime and archived information on active regions and solar activity.<!--, using data from
					the from the <a class=mail2 href="http://www.bbso.njit.edu/Research/Halpha/">Global H-alpha
					Network</a>, the ESA/NASA's <a class=mail2 href=http://sohowww.nascom.nasa.gov> Solar and Heliospheric Observatory (SOHO)</a>, <a class=mail2 href=http://www.gong.noao.edu>GONG+</a>, and the <a class=mail2 href=http://www.sec.noaa.gov/>National Oceanic and Atmospheric Administration (NOAA)</a>.-->
For information on our new SolarMonitor IDL Data Object (SOLMON), check out the <a class=mail2 href="objects/solmon/index.html" target="_blank">SOLMON Tutorial</a>. Check out <a class=mail2 href=news.php>News</a> for other updates. 
<!-- <br><br>After a recent server switch-over <a class=mail2 href=index.php>SolarMonitor</a> does not currently host a complete back-dated archive. However, data and images older than 8-Oct-2008 are available from <a class=mail2 href=http://beauty.nascom.nasa.gov/arm/data>here</a> during this period of repopulation. -->		

		<?php 
    print "\t\t</td>\n";
    print "\t</tr>\n";
    print "</table>\t\n";
}
    $startdate = date("Ymd", strtotime("-27 day", strtotime($date)));
}
if (isset($_GET['enddate']) && $_GET['enddate'] != '') {
    $enddate = $_GET['enddate'];
} else {
    $enddate = $date;
}
$instrument = substr($type, 0, 4);
$filter = substr($type, 5, 5);
$curdate = $startdate;
$imgs = array();
$times = array();
//$prefix = "/Library/WebServer/Documents/solarmonitor/";
$prefix = "http://solarmonitor.org/";
do {
    $file = find_latest_file($curdate, $instrument, $filter, 'png', 'fd');
    if ($file == "No File Found" && $type != "default") {
        $imgs[] = $prefix . "common_files/placeholder_220";
        $times[] = "No Time Data Available";
    } elseif ($file != "No File Found" && $type != "default") {
        list($inst, $filt, $fd, $fdate, $time, $ext) = split('[_.]', $file, 6);
        $str = $index_types_strs[$type];
        $dt = $fdate . " " . substr($time, 0, 2) . ":" . substr($time, 2, 2);
        //$str = $str . " " . date("d-M-Y H:i", strtotime($dt)) . " UT";
        $str = $str . " " . $fdate . " " . date("H:i", strtotime($dt));
        $imgs[] = $prefix . "data/{$curdate}/pngs/thmb/{$type}_thumb.png";
        $times[] = $str;
    }
    $curdate = date("Ymd", strtotime("+1 day", strtotime($curdate)));
} while ($curdate != $enddate);
echo "{ \"images\": [";
Example #5
0
            $title = $temp_title;
            break;
        }
    }
} else {
    $title = "No Title Found";
}
//if ($indexnum == "1")
$sub_title = $region_strs1[$type];
//else
//	$sub_title = $region2_strs1[$type];
$year = substr($date, 0, 4);
$month = substr($date, 4, 2);
$instrument = substr($type, 0, 4);
$filter = substr($type, 5, 5);
$file = find_latest_file($date, $instrument, $filter, 'png', 'ar', $region);
$url = "{$arm_data_path}data/{$date}/pngs/{$instrument}/{$file}";
$curr_date = gmdate("Ymd");
if ($date > $curr_date) {
    $url = "./common_files/placeholder_604.png";
}
?>
<html>
	<head>
		<meta http-equiv="Pragma" content="no-cache">
		<meta http-equiv="refresh" content="900">
		<title><?php 
print $title;
?>
</title>
		<link rel=stylesheet href="./common_files/arm-style.css" type="text/css">
function write_index_body($date)
{
    include "globals.php";
    $links = array();
    for ($i = 0; $i < count($index_types); $i++) {
        $links[] = link_image("{$arm_data_path}data/{$date}/pngs/thmb/{$index_types[$i]}_thumb.png", 220, false);
        list($instrument, $filter) = split('[_]', $index_types[$i], 2);
        $file = find_latest_file($date, $instrument, $filter, 'png', 'fd');
        if ($file == "No File Found") {
            $times[] = "No Time Data Available";
        } else {
            list($inst, $filt, $fd, $fdate, $time, $ext) = split('[_.]', $file, 6);
            $str = $index_types_strs[$index_types[$i]];
            $dt = $fdate . " " . substr($time, 0, 2) . ":" . substr($time, 2, 2);
            $str = $str . " " . date("d-M-Y H:i", strtotime($dt)) . " UT";
            $times[] = $str;
        }
    }
    print "<table>\n";
    for ($i = 0; $i < count($index_types); $i++) {
        if ($i == 0) {
            print "\t<tr>\n";
        } elseif ($i % 3 == 0) {
            print "\t<tr>\n\t<tr>\n";
        }
        print "\t\t<td align=center valign=center>\n";
        print "\t\t\t<small><i>" . $times[$i] . "</i></small>\n";
        print "\t\t\t<a href=\"full_disk.php?date={$date}&type=" . $index_types[$i] . "\">\n";
        print "\t\t\t\t" . $links[$i] . "\n";
        print "\t\t\t</a>\n";
        print "\t\t</td>\n";
        if ($i == count($index_types) - 1) {
            print "\t</tr>\n";
        }
    }
    print "\t<tr>\n";
    print "\t\t<td align=left valign=top colspan=3>\n";
    ?>
					<font size=+2><i>W</i></font>elcome  to the 
					Active Region Monitor (ARM) at NASA Goddard Space Flight Center's
					<a class=mail href=http://umbra.nascom.nasa.gov>Solar Data Analysis Center (SDAC)</a>, 
					and now at the <a class=mail href=http://www.kao.re.kr/html/english/index.html>Korean Astronomy Observatory's</a> <a class=mail href=http://sun.kao.re.kr/arm/>mirror site</a>.
					These pages contain the most recent solar images from the
					<a class=mail href="http://www.bbso.njit.edu/Research/Halpha/">Global H-alpha
					Network</a>, together with continuum images and magnetograms from the
					<a class=mail href="http://soi.stanford.edu/">Michelson Doppler Imager (MDI)</a>
					and EUV images from the
					<a class=mail href="http://umbra.nascom.nasa.gov/eit/">Extreme-ultraviolet Imaging Telescope (EIT)</a> onboard the ESA/NASA
					<a class=mail href="http://sohowww.nascom.nasa.gov">Solar and Heliospheric Observatory (SOHO)</a>.
					Solar event movies and flare identifications are linked from the Lockheed Martin
					<a class=mail href=http://www.lmsal.com/solarsoft/last_events>Last Events</a> page.
					Full-disk <a class=mail href=http://www.gong.noao.edu>GONG+</a> magnetograms and magnetic gradient maps 
					are supplied courtesy of the US National Solar Observatory, while soft X-ray images are provided by the NOAA <a class=mail href=http://www.sec.noaa.gov/sxi/>Solar X-ray Imager (SXI)</a>.
					<p>ARM 2.0 is now live.  The new version is designed to maintain the same layout across 
					any page on ARM.  ARM 2.0 is the first program to run on the ARM Virtual Obsveratory data set.  Data
					currently exists in full from August 10, 2004 onward.  We are working on populating the rest of the 
					data set back to the beginning of the SOHO mission.  Please be patient while this is being completed.
					The old site is still accessable <a class=mail href=" <?php 
    print "http://www.solarmonitor.org?{$date}/";
    ?>
 here</a> but 
					this could be removed at any time, so please update your bookmarks to the this page.
					<p>A developmental version of the automated <a class=mail href="<?php 
    print "forecast.php?date={$date}";
    ?>
">
					Flare Prediction System (FPS)</a> is also
					available on these pages. The FPS algorithm calculates the probability of each region producing
					C-, M-, and X-class events based on almost eight years of data from the 
					<a class=mail href="http://www.sec.noaa.gov/">NOAA Space Environment Center</a>. 
					Check out our <a class=mail href="./news.php">news</a> pages for up-to-date
					changes to ARM.
					<p>ARM is an integral component of the <a class=mail href=http://solar.physics.montana.edu/max_millennium/index.shtml>Max Millennium Program of Solar Flare Research</a>.
		<?php 
    print "\t\t</td>\n";
    print "\t</tr>\n";
    print "</table>\t\n";
}