-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Firefly-1483: Merge PR #58 from FIREFLY-1483-triview
Firefly-1483: improve support for triview
- Loading branch information
Showing
17 changed files
with
1,033 additions
and
652 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,173 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"This notebook demonstrates basic usage of the firefly_client API.\n", | ||
"\n", | ||
"Note that it may be necessary to wait for some cells (like those displaying an image) to complete before executing later cells." | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Setup" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Imports for firefly_client" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from firefly_client import FireflyClient\n", | ||
"using_lab = False\n", | ||
"url = 'http://127.0.0.1:8080/firefly'\n", | ||
"#FireflyClient._debug= True" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Settings for a WISE image for M81 at a selected band in HiPS format:" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"fc = FireflyClient.make_lab_client() if using_lab else FireflyClient.make_client(url)\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"target='148.892;69.0654;EQ_J2000'\n", | ||
"fov_deg=0.5\n", | ||
"size=0.2\n", | ||
"\n", | ||
"image_basic_req = {\n", | ||
" 'Service': 'WISE',\n", | ||
" 'Title': 'Wise',\n", | ||
" 'SurveyKey': '3a',\n", | ||
" 'SurveyKeyBand': '2'\n", | ||
"}\n", | ||
"\n", | ||
"hips_basic_req = {\n", | ||
" 'title': 'A HiPS - 0.2',\n", | ||
" 'hipsRootUrl': 'http://alasky.u-strasbg.fr/AllWISE/RGB-W4-W2-W1'\n", | ||
"}" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Show HiPS " | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"A HiPS is displayed based on HiPS url" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"viewer_id = 'hipsDIV1'\n", | ||
"r = fc.add_cell(0, 0, 4, 2, 'images', viewer_id)\n", | ||
"if r['success']:\n", | ||
" hips_url = 'http://alasky.u-strasbg.fr/DSS/DSSColor';\n", | ||
" status = fc.show_hips(viewer_id=viewer_id, plot_id='aHipsID1-1', hips_root_url = hips_url, \n", | ||
" Title='HiPS-DSS', WorldPt=target)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Change color attributes in this image:" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"fc.set_color('aHipsID1-1', colormap_id=6, bias=0.6, contrast=1.5)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Two more HiPS in the same viewer" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"\n", | ||
"hips_url = 'http://alasky.u-strasbg.fr/DSS/DSS2Merged';\n", | ||
"status = fc.show_hips(plot_id='aHipsID1-2', hips_root_url = hips_url, \n", | ||
" Title='HiPS-DSS2', WorldPt=target)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"hips_url = 'http://alasky.u-strasbg.fr/AllWISE/RGB-W4-W2-W1'\n", | ||
"status = fc.show_hips(plot_id='aHipsID2', hips_root_url=hips_url)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"anaconda-cloud": {}, | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.12" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
Oops, something went wrong.