Skip to content

Commit

Permalink
deploy: d5bea86
Browse files Browse the repository at this point in the history
  • Loading branch information
ttdu committed May 1, 2024
1 parent e8da507 commit 2af45ee
Show file tree
Hide file tree
Showing 4 changed files with 358 additions and 33 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

31 changes: 29 additions & 2 deletions notebooks/multi_mission/display_footprints/displayFootprints.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@
const thebe_selector_output = ".output, .cell_output"
</script>
<script async="async" src="../../../_static/sphinx-thebe.js"></script>
<script type="application/vnd.jupyter.widget-state+json">{"state": {"08ae786c5f2f4c9888d472f0efc8dd96": {"model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "3ce1ef68f5ac4e3d8f4b7c7e8de5c038": {"buffers": [{"data": "", "encoding": "base64", "path": ["_table"]}], "model_module": "anywidget", "model_module_version": "0.9.10", "model_name": "AnyModel", "state": {"_anywidget_id": "ipyaladin.Aladin", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], "_esm": "import o from\"https://esm.sh/[email protected]\";var v=0;function b(e){let c=e.split(\"_\");for(let r=1;r<c.length;r++)c[r]=c[r].charAt(0).toUpperCase()+c[r].slice(1);return c.join(\"\")}async function k({model:e}){await o.init}function C({model:e,el:c}){let r={};e.get(\"init_options\").forEach(t=>{r[b(t)]=e.get(t)});let s=document.createElement(\"div\");s.classList.add(\"aladin-widget\"),s.style.height=`${r.height}px`,s.id=`aladin-lite-div-${v}`;let a=new o.aladin(s,r);v+=1,c.appendChild(s);let g=!1,l=!1;a.on(\"positionChanged\",t=>{l?l=!1:(g=!0,e.set(\"target\",`${t.ra} ${t.dec}`),e.save_changes())}),e.on(\"change:target\",()=>{if(g)g=!1;else{l=!0;let t=e.get(\"target\");a.gotoObject(t)}});let d=!1,_=!1;return a.on(\"zoomChanged\",t=>{d?d=!1:(_=!0,e.set(\"fov\",parseFloat(t.toFixed(5))),e.save_changes())}),e.on(\"change:fov\",()=>{if(_)_=!1;else{d=!0;let t=e.get(\"fov\");a.setFoV(t)}}),e.on(\"change:height\",()=>{let t=e.get(\"height\");s.style.height=`${t}px`}),a.on(\"objectHovered\",t=>{t.data!=null&&e.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),a.on(\"objectClicked\",t=>{let n={ra:t.ra,dec:t.dec};t.data!==void 0&&(n.data=t.data),e.set(\"clicked\",n),e.send({event_type:\"object_clicked\",content:n}),e.save_changes()}),a.on(\"click\",t=>{e.send({event_type:\"click\",content:t})}),a.on(\"select\",t=>{let n=[];t.forEach(f=>{f.forEach(i=>{n.push({ra:i.ra,dec:i.dec,data:i.data,x:i.x,y:i.y})})}),e.send({event_type:\"select\",content:n})}),e.on(\"change:coo_frame\",()=>{a.setFrame(e.get(\"coo_frame\"))}),e.on(\"change:survey\",()=>{a.setImageSurvey(e.get(\"survey\"))}),e.on(\"change:overlay_survey\",()=>{a.setOverlayImageLayer(e.get(\"overlay_survey\"))}),e.on(\"change:overlay_survey_opacity\",()=>{a.getOverlayImageLayer().setAlpha(e.get(\"overlay_survey_opacity\"))}),e.on(\"msg:custom\",t=>{let n={};switch(t.event_name){case\"add_catalog_from_URL\":a.addCatalog(o.catalogFromURL(t.votable_URL,t.options));break;case\"add_MOC_from_URL\":n=t.options,n.lineWidth===void 0&&(n.lineWidth=3),a.addMOC(o.MOCFromURL(t.moc_URL,n));break;case\"add_MOC_from_dict\":n=t.options,n.lineWidth===void 0&&(n.lineWidth=3),a.addMOC(o.MOCFromJSON(t.moc_dict,n));break;case\"add_overlay_from_stcs\":let f=o.graphicOverlay(t.overlay_options);a.addOverlay(f),f.addFootprints(o.footprintsFromSTCS(t.stc_string));break;case\"change_colormap\":a.getBaseImageLayer().setColormap(t.colormap);break;case\"get_JPG_thumbnail\":a.exportAsPNG();break;case\"trigger_rectangular_selection\":a.select();break;case\"add_table\":let i=e.get(\"_table\"),p=new TextDecoder(\"utf-8\"),u=new Blob([p.decode(i)]),h=URL.createObjectURL(u);o.catalogFromURL(h,Object.assign(t.options,{onClick:\"showTable\"}),y=>{a.addCatalog(y)},!1),URL.revokeObjectURL(h);break}}),()=>{e.off(\"change:target\"),e.off(\"change:fov\"),e.off(\"change:height\"),e.off(\"change:coo_frame\"),e.off(\"change:survey\"),e.off(\"change:overlay_survey\"),e.off(\"change:overlay_survey_opacity\"),e.off(\"change:trigger_event\"),e.off(\"change:_table\"),e.off(\"msg:custom\"),a.off(\"positionChanged\"),a.off(\"zoomChanged\"),a.off(\"objectHovered\"),a.off(\"objectClicked\"),a.off(\"click\"),a.off(\"select\")}}var x={initialize:k,render:C};export{x as default};\n", "_model_module": "anywidget", "_model_module_version": "0.9.10", "_model_name": "AnyModel", "_view_count": null, "_view_module": "anywidget", "_view_module_version": "0.9.10", "_view_name": "AnyView", "background_color": "rgb(60, 60, 60)", "clicked_object": {}, "coo_frame": "J2000", "fov": 1.0, "full_screen": false, "grid_color": "rgb(178, 50, 178)", "grid_opacity": 0.5, "grid_options": {}, "height": 600, "init_options": ["background_color", "coo_frame", "fov", "full_screen", "grid_color", "grid_opacity", "grid_options", "height", "overlay_survey", "overlay_survey_opacity", "projection", "reticle_color", "reticle_size", "samp", "show_catalog", "show_context_menu", "show_coo_grid", "show_coo_grid_control", "show_coo_location", "show_fov", "show_frame", "show_fullscreen_control", "show_layers_control", "show_overlay_stack_control", "show_projection_control", "show_reticle", "show_settings_control", "show_share_control", "show_simbad_pointer_control", "show_status_bar", "show_zoom_control", "survey", "target"], "layout": "IPY_MODEL_08ae786c5f2f4c9888d472f0efc8dd96", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", "reticle_color": "rgb(178, 50, 178)", "reticle_size": 20, "samp": false, "show_catalog": true, "show_context_menu": true, "show_coo_grid": false, "show_coo_grid_control": true, "show_coo_location": true, "show_fov": true, "show_frame": true, "show_fullscreen_control": true, "show_layers_control": true, "show_overlay_stack_control": true, "show_projection_control": true, "show_reticle": true, "show_settings_control": true, "show_share_control": false, "show_simbad_pointer_control": true, "show_status_bar": true, "show_zoom_control": false, "survey": "P/DSS2/color", "tabbable": null, "target": "210.802 54.3488", "tooltip": null}}}, "version_major": 2, "version_minor": 0}</script>
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
<script crossorigin="anonymous" data-jupyter-widgets-cdn="https://cdn.jsdelivr.net/npm/" src="https://cdn.jsdelivr.net/npm/@jupyter-widgets/[email protected]/dist/embed-amd.js"></script>
<script>DOCUMENTATION_OPTIONS.pagename = 'notebooks/multi_mission/display_footprints/displayFootprints';</script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
Expand Down Expand Up @@ -674,7 +677,8 @@ <h2>Learning Goals<a class="headerlink" href="#learning-goals" title="Permalink
</section>
<section id="introduction">
<h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this heading">#</a></h2>
<p>This Notebook is a replacement for a web-based footprint viewer. Eventually, footprint viewing functionality will be built into the <a class="reference external" href="https://www.stsci.edu/scientific-community/software/astronomers-proposal-tool-apt">Astronomer’s Proposal Tool (APT)</a>; scientists intending to propose for observations should use APT. In the meantime, this Notebook is a useful “quick look” tool.</p>
<p>This Notebook is a replacement for a web-based footprint viewer, and is designed as a “quick look” tool. Scientists intending to propose for Observations should use the <a class="reference external" href="https://www.stsci.edu/scientific-community/software/astronomers-proposal-tool-apt">Astronomer’s Proposal Tool (APT)</a>.</p>
<p>Note that since PySIAF covers only HST, JWST, and Roman, footprint for other telescopes cannot be generated using this Notebook.</p>
</section>
<section id="imports">
<h2>Imports<a class="headerlink" href="#imports" title="Permalink to this heading">#</a></h2>
Expand Down Expand Up @@ -775,6 +779,9 @@ <h3>Optional: Plot Footprint in Telescope Frame<a class="headerlink" href="#opti
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<img alt="../../../_images/08a4c3b60e3992ccf515773023af3405fc71e030ff5666bc947c6aa833f1c38c.png" src="../../../_images/08a4c3b60e3992ccf515773023af3405fc71e030ff5666bc947c6aa833f1c38c.png" />
</div>
</div>
</section>
</section>
Expand All @@ -789,6 +796,12 @@ <h2>Specifying a Target<a class="headerlink" href="#specifying-a-target" title="
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;SkyCoord (ICRS): (ra, dec) in deg
(210.802429, 54.34875)&gt;
</pre></div>
</div>
</div>
</div>
<p>Using MAST to resolve our target returns a <a class="reference external" href="https://docs.astropy.org/en/stable/coordinates/">skycoord</a> object. We need two different formats to satisfy <code class="docutils literal notranslate"><span class="pre">pysiaf</span></code> and <code class="docutils literal notranslate"><span class="pre">Aladin</span></code>. <code class="docutils literal notranslate"><span class="pre">pysiaf</span></code> requires separate ra/dec objects, while <code class="docutils literal notranslate"><span class="pre">Aladin</span></code> is looking for a string containing both.</p>
<p>Fortunately, <code class="docutils literal notranslate"><span class="pre">skycoord</span></code> objects are flexible enough to handle both of these requirements with straightforward calls:</p>
Expand All @@ -805,6 +818,13 @@ <h2>Specifying a Target<a class="headerlink" href="#specifying-a-target" title="
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>RA: 210.802429 deg
DEC: 54.34875 deg
String: 210.802 54.3488
</pre></div>
</div>
</div>
</div>
<p>There’s a little bit of rounding as a result of our <code class="docutils literal notranslate"><span class="pre">to_string()</span></code> call. As we’ll see later on, we only need this string to point the Aladin viewer at the right section of the sky; a little bit of rounding won’t affect our view much.</p>
</section>
Expand Down Expand Up @@ -859,6 +879,11 @@ <h2>Calculate Sky Regions<a class="headerlink" href="#calculate-sky-regions" tit
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>POLYGON ICRS 210.83611985 54.33128130 210.65317562 54.39264077 210.54552436 54.28382095 210.72855928 54.22325349 POLYGON ICRS 211.05072223 54.25819775 210.87237008 54.31853478 210.76486297 54.21068717 210.94350685 54.15129373 POLYGON ICRS 211.24158252 54.19262585 211.06815350 54.25175159 210.96096136 54.14495304 211.13485997 54.08690550 POLYGON ICRS 210.68074382 54.22718974 210.49702273 54.28787302 210.38969434 54.17966469 210.57318542 54.11982216 POLYGON ICRS 210.89577811 54.15413874 210.71626733 54.21367993 210.60869595 54.10650848 210.78819725 54.04796207 POLYGON ICRS 211.08624525 54.08900017 210.91132941 54.14723080 210.80375288 54.04116784 210.97886100 53.98405158 POLYGON ICRS 210.46906894 54.14198627 210.28418989 54.20221869 210.17805932 54.09489689 210.36234379 54.03549847 POLYGON ICRS 210.68550000 54.06878215 210.50418382 54.12784112 210.39736159 54.02156548 210.57830544 53.96349864 POLYGON ICRS 210.87378208 54.00349455 210.69645028 54.06121944 210.58925428 53.95605712 210.76641343 53.89944091 POLYGON ICRS 210.95200626 54.44860507 210.76945339 54.51071823 210.66210332 54.40168389 210.84502418 54.34026467 POLYGON ICRS 211.16671093 54.37520418 210.98894642 54.43648604 210.88206544 54.32830482 211.06037612 54.26788155 POLYGON ICRS 211.35752835 54.30921677 211.18485369 54.36944444 211.07857915 54.26220998 211.25195790 54.20298264 POLYGON ICRS 211.02810428 54.57910112 210.84544465 54.64192692 210.73882446 54.53312016 210.92209700 54.47085028 POLYGON ICRS 211.24381372 54.50547064 211.06596809 54.56772380 210.96010797 54.45960998 211.13872922 54.39809161 POLYGON ICRS 211.43456012 54.43947021 211.26178129 54.50089602 211.15679431 54.39359231 211.33045072 54.33304257 POLYGON ICRS 211.04706464 54.72845668 210.86349280 54.79182324 210.75779274 54.68376145 210.94217310 54.62075705 POLYGON ICRS 211.26485655 54.65451492 211.08583395 54.71765941 210.98115060 54.61007755 211.16111466 54.54747365 POLYGON ICRS 211.45576383 54.58999831 211.28155207 54.65262883 211.17794496 54.54565907 211.35319342 54.48371078
</pre></div>
</div>
</div>
</div>
</section>
<section id="initialize-aladin">
Expand All @@ -872,6 +897,8 @@ <h2>Initialize Aladin<a class="headerlink" href="#initialize-aladin" title="Perm
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<script type="application/vnd.jupyter.widget-view+json">{"model_id": "3ce1ef68f5ac4e3d8f4b7c7e8de5c038", "version_major": 2, "version_minor": 1}</script></div>
</div>
<p>This looks great, but where’s our footprint? Well, we can only add an overlay once <code class="docutils literal notranslate"><span class="pre">Aladin</span></code> is already up and running. Let’s add it now:</p>
<div class="cell docutils container">
Expand All @@ -889,7 +916,7 @@ <h2>About this Notebook<a class="headerlink" href="#about-this-notebook" title="
<p>If you have comments or questions on this notebook, please contact us through the Archive Help Desk e-mail at archive&#64;stsci.edu.</p>
<p><strong>Authors:</strong> Brian McLean, Thomas Dutkiewicz <br>
<strong>Keywords:</strong> Footprints <br>
<strong>Last Updated:</strong> Mar 2024 <br></p>
<strong>Last Updated:</strong> May 2024 <br></p>
<hr class="docutils" />
<p><span class="xref myst">Top of Page</span>
<a class="reference internal" href="https://raw.githubusercontent.com/spacetelescope/notebooks/master/assets/stsci_pri_combo_mark_horizonal_white_bkgd.png"><img alt="Space Telescope Logo" src="https://raw.githubusercontent.com/spacetelescope/notebooks/master/assets/stsci_pri_combo_mark_horizonal_white_bkgd.png" style="width: 200px;" /></a></p>
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit 2af45ee

Please sign in to comment.