{"id":16,"date":"2013-05-03T21:00:21","date_gmt":"2013-05-03T21:00:21","guid":{"rendered":"http:\/\/portillo.ca\/nebula\/?page_id=16"},"modified":"2014-10-21T22:14:02","modified_gmt":"2014-10-21T22:14:02","slug":"nebula-predictor","status":"publish","type":"page","link":"http:\/\/portillo.ca\/nebula\/nebula-predictor\/","title":{"rendered":"Nebula Predictor"},"content":{"rendered":"<link rel=\"stylesheet\" type=\"text\/css\" href=\"http:\/\/portillo.ca\/nebula\/css\/ui-darkness\/jquery-ui-1.10.2.custom.css\">\r\n<script src=\"http:\/\/d3js.org\/d3.v3.min.js\" charset=\"utf-8\"><\/script>\r\n<script src=\"http:\/\/portillo.ca\/nebula\/js\/jquery-1.9.1.js\" charset=\"utf-8\"><\/script>\r\n<script src=\"http:\/\/portillo.ca\/nebula\/js\/nebgrid.js\" charset=\"utf-8\"><\/script>\r\n<script src=\"http:\/\/portillo.ca\/nebula\/js\/jquery-ui-1.10.2.custom.js\" charset=\"utf-8\"><\/script>\r\n<script>\r\nvar width = 157;\r\nvar height = 525;\r\nvar pixheight = 5;\r\nvar svg = 0;\r\nvar numionizing = [0.479, 1.87, 6.02, 17.1, 44.2]; \/\/ in E49\r\n\r\nfunction updateneb(i1, i2, i3){\r\nvar index = i1*20 + i2*4 + i3*1;\r\n\r\nvar rect = svg.selectAll(\"rect\")\r\n        .data(nebgrid[index])\r\n        .attr(\"x\", 0)\r\n        .attr(\"y\", function(d, i) { return i * pixheight; })\r\n        .attr(\"height\", pixheight)\r\n        .attr(\"width\", width)\r\n        .on(\"mouseover\", function(d, i) { d3.select(this).attr(\"stroke\", \"rgb(255,255,255)\"); rgbbars(d); })\r\n        .on(\"mouseout\", function(d, i) { d3.select(this).attr(\"stroke\", \"none\");} )\r\n        .transition()\r\n        .attr(\"fill\", function(d, i) { return nebcolor(d); });\r\n}\r\n\r\nfunction calcdist(stari, ioni){\r\n    return Math.round(Math.sqrt(numionizing[stari] \/ (4 * Math.PI * Math.pow(10, -0.5 + (ioni \/ 4.0)))) * 10.57 * 10)\/10.;\r\n}\r\n\r\n$(function() {\r\n\r\n$(\"#lineview\").buttonset().change(function(){updateneb($(\"#tempslide\").slider(\"value\"), $(\"#intslide\").slider(\"value\"), $(\"#metslide\").slider(\"value\"));});\r\n\r\n$(\"#tempslide\").slider({\r\n\tvalue: 0,\r\n\tmin: 0,\r\n\tmax: 4,\r\n\tstep: 1,\r\n\tslide: function(event, ui){\r\n\t\t$(\"#starT\").text(30000 + ui.value * 5000);\r\n\t\t$(\"#starD\").text(calcdist(ui.value, $(\"#intslide\").slider(\"value\")));\r\n\t\tupdateneb(ui.value, $(\"#intslide\").slider(\"value\"), $(\"#metslide\").slider(\"value\"));\r\n\t}\r\n});\r\n$(\"#starT\").text(30000 + $(\"#tempslide\").slider(\"value\")*5000);\r\n\r\n$(\"#intslide\").slider({\r\n        value: 0,\r\n        min: 0,\r\n        max: 4,\r\n        step: 1,\r\n        slide: function(event, ui){\r\n                $(\"#phiH\").text(10.5 + ui.value * 0.25);\r\n\t\t$(\"#starD\").text(calcdist($(\"#tempslide\").slider(\"value\"), ui.value));\r\n\t\tupdateneb($(\"#tempslide\").slider(\"value\"), ui.value, $(\"#metslide\").slider(\"value\"));\r\n        }\r\n});\r\n$(\"#phiH\").text(10.5 + $(\"#intslide\").slider(\"value\")*0.25);\r\n$(\"#starD\").text(calcdist($(\"#tempslide\").slider(\"value\"), $(\"#intslide\").slider(\"value\")));\r\n\r\n$(\"#metslide\").slider({\r\n        value: 0,\r\n        min: 0,\r\n        max: 3,\r\n        step: 1,\r\n        slide: function(event, ui){\r\n                $(\"#metals\").text(0.25 + ui.value * 0.25);\r\n\t\tupdateneb($(\"#tempslide\").slider(\"value\"), $(\"#intslide\").slider(\"value\"), ui.value);\r\n        }\r\n});\r\n$(\"#metals\").text(0.25 + $(\"#metslide\").slider(\"value\")*0.25);\r\n\r\nsvg = d3.select(\"#nebula\").append(\"svg\")\r\n        .attr(\"width\", width)\r\n        .attr(\"height\", height);\r\nvar rect = svg.selectAll(\"rect\")\r\n        .data(nebgrid[0])\r\n        .enter().append(\"rect\")\r\n        .attr(\"x\", 0)\r\n        .attr(\"y\", function(d, i) { return i * pixheight; })\r\n        .attr(\"height\", pixheight)\r\n        .attr(\"width\", width)\r\n        .attr(\"fill\", function(d, i) { return nebcolor(d); });\r\n\r\nupdateneb($(\"#tempslide\").slider(\"value\"), $(\"#intslide\").slider(\"value\"), $(\"#metslide\").slider(\"value\"));\r\n\r\n});\r\n\r\nfunction rgbbars(d){\r\n        d3.select(\"#rectG\").attr(\"width\", lin250(d[0]));\r\n        d3.select(\"#rectB\").attr(\"width\", lin250(d[1]));\r\n        d3.select(\"#rectR\").attr(\"width\", lin250(d[2]));\r\n        d3.select(\"#rhoH\").text(Math.round(d[3]));\r\n        var a = new Array();\r\n        a.length = Math.round(d[3] \/ 10.);\r\n        var circs = d3.select(\"#densityplot\").selectAll(\"circle\").data(a);\r\n        circs.enter().append(\"circle\").attr(\"cx\", function() {return Math.random()*250;}).attr(\"cy\", function() {return Math.random()*250;}).attr(\"r\", 2).attr(\"fill\", \"rgb(0,0,0)\").transition().attr(\"fill\", \"rgb(255,255,255)\");\r\n        circs.exit().remove();\r\n}\r\nfunction lin250(l){\r\n        l = l + 17.1782;\r\n        p = Math.pow(10, l);\r\n        return Math.round(p * 200);\r\n}\r\n\r\nfunction nebcolor(d){\r\n        var lv = $('input[name=lineview]:checked', '#lineview').val()*1;\r\n        if (lv < 4){\r\n                g = log256(d[0]);\r\n                b = log256(d[1]);\r\n                r = log256(d[2]);\r\n        }\r\n        if (lv == 1){\r\n                g = 0; b = 0;\r\n        }\r\n        if (lv == 2){\r\n                r = 0; b = 0;\r\n        }\r\n        if (lv == 3){\r\n                r = 0; g = 0;\r\n        }\r\n        if (lv == 4){\r\n                x = dens256(d[3]);\r\n                r = x;\r\n                g = x;\r\n                b = x;\r\n        }\r\n        return \"rgb(\" + r + \",\" + g + \",\" + b + \")\";\r\n}\r\nfunction log256(l){\r\n        l = l + 17.1782;\r\n        p = Math.pow(10, l);\r\n        return Math.round(Math.sqrt(p * 255 * 255));\r\n}\r\nfunction dens256(l){\r\n        p = (l \/ 4733);\r\n        return Math.round(p * 255);\r\n}\r\n<\/script>\r\n\r\n<p>The edges of the pillars in \"The Pillars of Creation\" are part of the ionization front of the Eagle Nebula. This tool predicts the appearance of an ionization front under different conditions, and compares it to part of the edge of one pillar from \"The Pillars of Creation\". The region predicted is 0.33 light-years in height.\r\n\r\n<div id=\"lineview\">\r\n<input type=\"radio\" name=\"lineview\" id=\"lv0\" value=\"0\" checked><label for=\"lv0\">all lines<\/label>\r\n<input type=\"radio\" name=\"lineview\" id=\"lv1\" value=\"1\"><label for=\"lv1\"><span style=\"color:#FF0000\">SII 6716\/6731 &Aring;<\/span><\/label>\r\n<input type=\"radio\" name=\"lineview\" id=\"lv2\" value=\"2\"><label for=\"lv2\"><span style=\"color:#00FF00\">H&alpha; 6563 &Aring;<\/span><\/label>\r\n<input type=\"radio\" name=\"lineview\" id=\"lv3\" value=\"3\"><label for=\"lv3\"><span style=\"color:#0000FF\">OIII 5007 &Aring;<\/span><\/label>\r\n<input type=\"radio\" name=\"lineview\" id=\"lv4\" value=\"4\"><label for=\"lv4\">density<\/label>\r\n<\/div>\r\n\r\n<div style=\"float: left\">\r\nTowards star. <br \/>\r\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/portillo.ca\/nebula\/wp-content\/uploads\/2013\/05\/eagle.jpg\" alt=\"Pillar Photoionization Boundary\" width=\"157\" height=\"525\" style=\"float: left\" \/>\r\n<div id=\"nebula\" style=\"float: left\">\r\n<\/div>\r\n<br \/>Towards outside of nebula.\r\n<\/div>\r\n\r\n<div style=\"float: left; width: 250px; margin: 10px\">\r\nStar Temperature: <span id=\"starT\"><\/span> K\r\n<div id=\"tempslide\" style=\"width: 200px\"><\/div>\r\nIonization Parameter: 10<sup><span id=\"phiH\"><\/span><\/sup> cm<sup>-2<\/sup> s<sup>-1<\/sup><br \/>\r\n(Distance to star: <span id=\"starD\"><\/span> light-years)\r\n<div id=\"intslide\" style=\"width: 200px\"><\/div>\r\nMetallicity: <span id=\"metals\"><\/span> Z<sub>Sol<\/sub>\r\n<div id=\"metslide\" style=\"width: 200px\"><\/div>\r\nEmissivities at selected point:\r\n<svg width=\"250px\" height=\"75px\">\r\n<text x=\"0\" y=\"25\" fill=\"rgb(255,0,0)\">SII<\/text>\r\n<rect id=\"rectR\" fill=\"rgb(255,0,0)\" x=\"50\" y=\"0\" height=\"25\" width=\"0\" \/>\r\n<text x=\"0\" y=\"50\" fill=\"rgb(0,255,0)\">H&alpha;<\/text>\r\n<rect id=\"rectG\" fill=\"rgb(0,255,0)\" x=\"50\" y=\"25\" height=\"25\" width=\"0\" \/>\r\n<text x=\"0\" y=\"75\" fill=\"rgb(0,0,255)\">OIII<\/text>\r\n<rect id=\"rectB\" fill=\"rgb(0,0,255)\" x=\"50\" y=\"50\" height=\"25\" width=\"0\" \/>\r\n<\/svg>\r\nDensity at selected point: <span id=\"rhoH\">0<\/span> cm<sup>-3<\/sup>\r\n<svg id=\"densityplot\" width=\"250px\" height=\"250px\">\r\n<\/svg>\r\n<\/div>","protected":false},"excerpt":{"rendered":"The edges of the pillars in \"The Pillars of Creation\" are part of the ionization front of the Eagle Nebula. This tool predicts the appearance of an ionization front under different conditions, and compares it to part of the edge &hellip; <a href=\"http:\/\/portillo.ca\/nebula\/nebula-predictor\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":3,"comment_status":"closed","ping_status":"closed","template":"","meta":{"jetpack_post_was_ever_published":false,"footnotes":""},"class_list":["post-16","page","type-page","status-publish","hentry"],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/P3uAvH-g","_links":{"self":[{"href":"http:\/\/portillo.ca\/nebula\/wp-json\/wp\/v2\/pages\/16","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/portillo.ca\/nebula\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/portillo.ca\/nebula\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/portillo.ca\/nebula\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/portillo.ca\/nebula\/wp-json\/wp\/v2\/comments?post=16"}],"version-history":[{"count":85,"href":"http:\/\/portillo.ca\/nebula\/wp-json\/wp\/v2\/pages\/16\/revisions"}],"predecessor-version":[{"id":253,"href":"http:\/\/portillo.ca\/nebula\/wp-json\/wp\/v2\/pages\/16\/revisions\/253"}],"wp:attachment":[{"href":"http:\/\/portillo.ca\/nebula\/wp-json\/wp\/v2\/media?parent=16"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}