Skip to content

Dm 11476 Make demo sample to create charts with plot.ly #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Aug 11, 2017

Conversation

cwang2016
Copy link
Contributor

@cwang2016 cwang2016 commented Aug 9, 2017

The development includes:

  • add function show_plot to show chart with plot.ly
  • add function show_fits_3color to show 3 color fits by giving target and band information.
  • update function show_table to find catalog table by either giving file name on the server or the target search information.
  • change remote action request by using 'POST' request.
  • add demo sample 'slate-demo-explicit2.ipynb' which renders table, image and various charts with plot.ly

Test:
update firefly first
Open 'slate-demo-explicit2.ipynb' from jupyter notebook and run the code cells.

Cindy Wang added 2 commits August 8, 2017 18:50
…odify show_table to get table by giving target search info, and add demo sample likr ffapi-slate-test2.html for plot.ly direct plot.
@cwang2016 cwang2016 requested review from tgoldina, stargaser and robyww and removed request for tgoldina August 9, 2017 19:43
"cell_type": "markdown",
"metadata": {},
"source": [
"## Dispaly tables, images, and charts in Window/Grid like layout\n",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dispaly -> Display

Copy link
Contributor

@tgoldina tgoldina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works similar to JS version, just like it should.

" 'zaxis': {\n",
" 'title': 'w1mpro'\n",
" }\n",
" }\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The layout object for 3d should be wrapped into scene - so that the labels are applied to the 3d axes:

    layout3d = {
        'scene': {
            'xaxis': {
                'color': 'red',
                'title': 'ra',
                'showline': True
            },
            'yaxis': {
                'color': 'blue',
                'title': 'dec',
                'showline': True
            },
            'zaxis': {
                'color': 'green',
                'title': 'w1mpro',
                'showline': True
            }
        }
    }

However, there are still things to fix in firefly, so that scatter3d is not considered to be a scatter plot, and the default layout is not applied to it. I am planning to do it in a separate ticket.

@tgoldina
Copy link
Contributor

3d plot looks great now! Setting visible to false for external axes as a workaround for Firefly issues works great.

Copy link
Contributor

@robyww robyww left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. 3d updated are very nice. Make sure you put them back into ffapi-slate-test2.html in the firefly repository.

@cwang2016
Copy link
Contributor Author

Update the chart content for 'slate-demo-explicit2.ipynb' on WISE as follows,
2D scatter: w1-w2 and w2-w3 for x and y
heatmap: 3 sets, w1 vs. w2, w1 vs. w3, and w1 vs. w34.
histogram: 2 sets, w1, w2.
3D scatter: w1, w2, w3 for x, y, z.

Cindy Wang added 2 commits August 10, 2017 09:58
…-demo-expliit2, and update the image in sync with Firefly grid-view samples.
Copy link
Collaborator

@stargaser stargaser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The notebooks are much improved, very nice! M31 three-color looks great with WISE at 1 degree.

In addition to line comments on the "explicit2" notebook, here are some more comments I couldn't make on "explict" because the modifications were made in an earlier PR:

line 84 -- typo in Dispaly

In the code cells: these start with summary comments that explain what is happening in that cell. The notebook would be easier to read if these summary comments were moved to Markdown cells before the corresponding code cells.

The last code cell shows "random" placement. This confused me the first few times. I think it is better to replace "random" with "unspecified" and say that Firefly places the cell. Some of the confusion is caused by the the coverage image being width=3. Then Firefly puts this last image in the next column with blank space from the WISE Cutout image. If I make coverage have width=2, then Firefly decides to put the last image in a new row. Anyway, it is confusing to make the coverage width=3 when that leaves a lot of empty space in that cell.

"execution_count": null,
"metadata": {
"collapsed": false
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be helpful to insert a Markdown cell above this one, explaining what reinit_viewer() does. It seems to be different than reloading the browser window (clearing everything).

},
"outputs": [],
"source": [
"target = '10.68479;41.26906;EQ_J2000'\n",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to add a hint about what the objects are, and to add a Galactic star-forming region, like this:

target = '10.68479;41.26906;EQ_J2000' # Galaxy M31
# other notable targets to try
#target = '148.88822;69.06529;EQ_J2000' # Galaxy M81
#target = '202.48417;47.23056;EQ_J2000' # Galaxy M51
#target = '136.9316774;+1.1195886;galactic' # W5 star-forming region

"cell_type": "markdown",
"metadata": {},
"source": [
"Entering a target to search the catalog and image"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add here: the coordinates are in decimal hours and decimal degrees for EQ_J2000. The Galactic coordinates are in degrees.

]
},
{
"cell_type": "code",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a Markdown cell before this one including:

  • All plots are added in one notebook cell to better simulate an application
  • Before re-executing this cell (perhaps with a different target selected), reload the Firefly browser window to clear out the existing plots.

" {'dataType': 'fireflyHeatmap'},\n",
" {'dataType': 'fireflyHeatmap'},\n",
" {'dataType': 'fireflyHeatmap'}]\n",
" layout_hm = {'title': 'Photometry heatmap', \n",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A better title is "Magnitude-magnitude densities'

@stargaser
Copy link
Collaborator

I forgot one more point. It would be really nice in the 3-color plot to change the transparency of the marks so they don't obliterate the image -- like a transparency of 30%. I think I've done this with the JS API before.

…show_plot based on Firefly update for plotly chart.
@cwang2016
Copy link
Contributor Author

Regarding changing transparency for the maker, currently no firefly_client API supports that capability. we may create that later as needed.

@stargaser
Copy link
Collaborator

I have re-reviewed. Looks good to me!

@cwang2016 cwang2016 merged commit 9911536 into master Aug 11, 2017
@cwang2016 cwang2016 deleted the DM-11476-pythonplotly branch August 11, 2017 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants