Skip to content
Open
15 changes: 9 additions & 6 deletions examples/basic-demo-tableload.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"metadata": {},
"outputs": [],
"source": [
"url='https://irsa.ipac.caltech.edu/irsaviewer'\n",
"url = \"https://irsa.ipac.caltech.edu/irsaviewer\"\n",
"# url=http://127.0.0.1:8080/firefly # if you have firefly server running locally\n",
"\n",
"fc = FireflyClient.make_client(url)"
Expand Down Expand Up @@ -89,7 +89,10 @@
"source": [
"import os\n",
"\n",
"testdata_repo_path = '/hydra/cm' # to be reset to where test files are located on your system"
"\n",
"testdata_repo_path = (\n",
" \"/hydra/cm\" # to be reset to where test files are located on your system\n",
")"
]
},
{
Expand All @@ -112,7 +115,7 @@
"metadata": {},
"outputs": [],
"source": [
"localfile = os.path.join(testdata_repo_path, 'MF.20210502.18830.fits')\n",
"localfile = os.path.join(testdata_repo_path, \"MF.20210502.18830.fits\")\n",
"filename = fc.upload_file(localfile)\n",
"\n",
"fc.show_table(filename)"
Expand Down Expand Up @@ -154,10 +157,10 @@
"metadata": {},
"outputs": [],
"source": [
"localfile = os.path.join(testdata_repo_path, 'Mr31objsearch.xml')\n",
"localfile = os.path.join(testdata_repo_path, \"Mr31objsearch.xml\")\n",
"filename = fc.upload_file(localfile)\n",
"\n",
"fc.show_table(filename, tbl_id='votable-0')"
"fc.show_table(filename, tbl_id=\"votable-0\")"
]
},
{
Expand All @@ -173,7 +176,7 @@
"metadata": {},
"outputs": [],
"source": [
"fc.show_table(filename, tbl_id='votable-1', table_index=1)"
"fc.show_table(filename, tbl_id=\"votable-1\", table_index=1)"
]
},
{
Expand Down
93 changes: 48 additions & 45 deletions examples/demo-3color.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
"outputs": [],
"source": [
"from firefly_client import FireflyClient\n",
"\n",
"\n",
"using_lab = False\n",
"#url='https://irsa.ipac.caltech.edu/irsaviewer'\n",
"url = 'http://127.0.0.1:8080/firefly'\n",
"#FireflyClient._debug= True"
"# url='https://irsa.ipac.caltech.edu/irsaviewer'\n",
"url = \"http://127.0.0.1:8080/firefly\"\n",
"# FireflyClient._debug= True"
]
},
{
Expand All @@ -30,44 +32,45 @@
"source": [
"# Add a three color fits\n",
"# in cell 0, 0, 1, 1\n",
"target = '210.80227;54.34895;EQ_J2000' #Galaxy M101\n",
"viewer_id = '3C'\n",
"r = fc.add_cell(0, 0, 1, 1, 'images', viewer_id)\n",
"rv = '92,-2,92,8,NaN,2,44,25,600,120'\n",
"if r['success']:\n",
" threeC= [\n",
" {\n",
" 'Type' : 'SERVICE',\n",
" 'Service' : 'WISE',\n",
" 'Title' : '3 color',\n",
" 'SurveyKey' : '3a',\n",
" 'SurveyKeyBand': '3',\n",
" 'WorldPt' : target,\n",
" 'RangeValues': rv,\n",
" 'SizeInDeg' : '.14'\n",
" },\n",
" {\n",
" 'Type' : 'SERVICE',\n",
" 'Service' : 'WISE',\n",
" 'Title' : '3 color',\n",
" 'SurveyKey' : '3a',\n",
" 'SurveyKeyBand': '2',\n",
" 'WorldPt' : target,\n",
" 'RangeValues': rv,\n",
" 'SizeInDeg' : '.14'\n",
" },\n",
" {\n",
" 'Type' : 'SERVICE',\n",
" 'Service' : 'WISE',\n",
" 'Title' : '3 color',\n",
" 'SurveyKey' : '3a',\n",
" 'SurveyKeyBand': '1',\n",
" 'WorldPt' : target,\n",
" 'RangeValues': rv,\n",
" 'SizeInDeg' : '.14'\n",
" }]\n",
" \n",
" fc.show_fits_3color(threeC, plot_id='wise_m101', viewer_id=viewer_id)"
"target = \"210.80227;54.34895;EQ_J2000\" # Galaxy M101\n",
"viewer_id = \"3C\"\n",
"r = fc.add_cell(0, 0, 1, 1, \"images\", viewer_id)\n",
"rv = \"92,-2,92,8,NaN,2,44,25,600,120\"\n",
"if r[\"success\"]:\n",
" threeC = [\n",
" {\n",
" \"Type\": \"SERVICE\",\n",
" \"Service\": \"WISE\",\n",
" \"Title\": \"3 color\",\n",
" \"SurveyKey\": \"3a\",\n",
" \"SurveyKeyBand\": \"3\",\n",
" \"WorldPt\": target,\n",
" \"RangeValues\": rv,\n",
" \"SizeInDeg\": \".14\",\n",
" },\n",
" {\n",
" \"Type\": \"SERVICE\",\n",
" \"Service\": \"WISE\",\n",
" \"Title\": \"3 color\",\n",
" \"SurveyKey\": \"3a\",\n",
" \"SurveyKeyBand\": \"2\",\n",
" \"WorldPt\": target,\n",
" \"RangeValues\": rv,\n",
" \"SizeInDeg\": \".14\",\n",
" },\n",
" {\n",
" \"Type\": \"SERVICE\",\n",
" \"Service\": \"WISE\",\n",
" \"Title\": \"3 color\",\n",
" \"SurveyKey\": \"3a\",\n",
" \"SurveyKeyBand\": \"1\",\n",
" \"WorldPt\": target,\n",
" \"RangeValues\": rv,\n",
" \"SizeInDeg\": \".14\",\n",
" },\n",
" ]\n",
"\n",
" fc.show_fits_3color(threeC, plot_id=\"wise_m101\", viewer_id=viewer_id)"
]
},
{
Expand All @@ -91,7 +94,7 @@
],
"source": [
"# Set stretch using hue-preserving algorithm with scaling coefficients .15 for RED, 1.0 for GREEN, and .4 for BLUE.\n",
"fc.set_stretch_hprgb(plot_id='wise_m101', asinh_q_value=4.2, scaling_k=[.15,1,.4])"
"fc.set_stretch_hprgb(plot_id=\"wise_m101\", asinh_q_value=4.2, scaling_k=[0.15, 1, 0.4])"
]
},
{
Expand All @@ -113,7 +116,7 @@
],
"source": [
"# Set per-band stretch\n",
"fc.set_stretch(plot_id='wise_m101', stype='ztype', algorithm='asinh', band='ALL')"
"fc.set_stretch(plot_id=\"wise_m101\", stype=\"ztype\", algorithm=\"asinh\", band=\"ALL\")"
]
},
{
Expand All @@ -134,7 +137,7 @@
],
"source": [
"# Set contrast and bias for each band\n",
"fc.set_rgb_colors(plot_id='wise_m101', bias=[0.4, 0.6, 0.5], contrast=[1.5, 1, 2]) "
"fc.set_rgb_colors(plot_id=\"wise_m101\", bias=[0.4, 0.6, 0.5], contrast=[1.5, 1, 2])"
]
},
{
Expand All @@ -155,7 +158,7 @@
],
"source": [
"# Set to use red and blue band only, with default bias and contrast\n",
"fc.set_rgb_colors(plot_id='wise_m101', use_green=False) "
"fc.set_rgb_colors(plot_id=\"wise_m101\", use_green=False)"
]
},
{
Expand Down
57 changes: 32 additions & 25 deletions examples/demo-HiPS.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@
"outputs": [],
"source": [
"from firefly_client import FireflyClient\n",
"\n",
"\n",
"using_lab = False\n",
"url = 'http://127.0.0.1:8080/firefly'\n",
"#FireflyClient._debug= True"
"url = \"http://127.0.0.1:8080/firefly\"\n",
"# FireflyClient._debug= True"
]
},
{
Expand All @@ -48,7 +50,7 @@
"metadata": {},
"outputs": [],
"source": [
"fc = FireflyClient.make_lab_client() if using_lab else FireflyClient.make_client(url)\n"
"fc = FireflyClient.make_lab_client() if using_lab else FireflyClient.make_client(url)"
]
},
{
Expand All @@ -57,20 +59,20 @@
"metadata": {},
"outputs": [],
"source": [
"target='148.892;69.0654;EQ_J2000'\n",
"fov_deg=0.5\n",
"size=0.2\n",
"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",
" \"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",
" \"title\": \"A HiPS - 0.2\",\n",
" \"hipsRootUrl\": \"http://alasky.u-strasbg.fr/AllWISE/RGB-W4-W2-W1\",\n",
"}"
]
},
Expand All @@ -94,12 +96,17 @@
"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)"
"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(\n",
" viewer_id=viewer_id,\n",
" plot_id=\"aHipsID1-1\",\n",
" hips_root_url=hips_url,\n",
" Title=\"HiPS-DSS\",\n",
" WorldPt=target,\n",
" )"
]
},
{
Expand All @@ -115,7 +122,7 @@
"metadata": {},
"outputs": [],
"source": [
"fc.set_color('aHipsID1-1', colormap_id=6, bias=0.6, contrast=1.5)"
"fc.set_color(\"aHipsID1-1\", colormap_id=6, bias=0.6, contrast=1.5)"
]
},
{
Expand All @@ -131,10 +138,10 @@
"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)"
"hips_url = \"http://alasky.u-strasbg.fr/DSS/DSS2Merged\"\n",
"status = fc.show_hips(\n",
" plot_id=\"aHipsID1-2\", hips_root_url=hips_url, Title=\"HiPS-DSS2\", WorldPt=target\n",
")"
]
},
{
Expand All @@ -143,8 +150,8 @@
"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)"
"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)"
]
}
],
Expand Down
Loading