You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorials/firefly/NEOWISE_light_curve_demo.md
+13-17Lines changed: 13 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ jupytext:
4
4
extension: .md
5
5
format_name: myst
6
6
format_version: 0.13
7
-
jupytext_version: 1.16.2
7
+
jupytext_version: 1.16.3
8
8
kernelspec:
9
9
display_name: Python 3 (ipykernel)
10
10
language: python
@@ -19,7 +19,6 @@ By the end of this tutorial, you will:
19
19
20
20
- Construct a TAP query to download the necessary data and visualize it via the web browser with an instantiated Firefly environment.
21
21
- Plot light curves from NEOWISE data using the Firefly Python API.
22
-
- Format cells containing tables, charts and images viewed in the client.
23
22
- Overlay a catalog of data onto a HiPS image.
24
23
25
24
+++
@@ -53,26 +52,23 @@ import astropy.utils.data
53
52
import urllib.parse
54
53
```
55
54
56
-
## Step 1
55
+
## Instantiate the Firefly client
57
56
58
-
Instantiate the client and view it in a different tab in the web browser.
57
+
There are two ways to initialize a Firefly client from Python, depending on whether you're running the notebook in JupyterLab or not. Assuming you have `jupyter-firefly-extensions` set up in your environment as explained [here](https://github.com/Caltech-IPAC/jupyter_firefly_extensions/blob/master/README.md), you can use `make_lab_client()` in JupyterLab, which will open the Firefly viewer in a new tab within the Lab. Otherwise, you can use `make_client()`in a Jupyter Notebook (or even a Python shell), which will open the Firefly viewer in a new web browser tab.
59
58
60
-
In this example, we use the IRSA Viewer - a public firefly server. The firefly server can also be run locally, e.g. via a Firefly Docker image obtained from https://hub.docker.com/r/ipac/firefly/tags/.
59
+
You also need a Firefly server to communicate with your Firefly Python client. In this notebook, we use a public Firefly server: the IRSA Viewer (https://irsa.ipac.caltech.edu/irsaviewer). However, you can also run a local Firefly server via a [Firefly Docker image](https://hub.docker.com/r/ipac/firefly) and access it at `http://localhost:8080/firefly`. The URL of the Firefly server is read by both `make_client()` and `make_lab_client()` through the environment variable `FIREFLY_URL`. However, `make_client()` also allows you to pass the URL directly as the `url` parameter.
61
60
62
61
```{code-cell} ipython3
63
-
url = 'https://irsa.ipac.caltech.edu/irsaviewer'
64
-
# url='http://127.0.0.1:8080/firefly' # if you have firefly server running locally (preferably through docker)
62
+
# Uncomment when using within Jupyter Lab with jupyter_firefly_extensions installed
63
+
# fc = FireflyClient.make_lab_client()
65
64
66
-
fc = FireflyClient.make_client(url)
67
-
```
68
-
69
-
You can re-initizialize the viewer to return to a clean state with [`reinit_viewer`](https://caltech-ipac.github.io/firefly_client/api/firefly_client.FireflyClient.html#firefly_client.FireflyClient.reinit_viewer).
65
+
# Uncomment for contexts other than above
66
+
fc = FireflyClient.make_client(url="https://irsa.ipac.caltech.edu/irsaviewer")
70
67
71
-
```{code-cell} ipython3
72
-
# fc.reinit_viewer(); # The semi-colon suppresses the output of the method when ran
68
+
fc.reinit_viewer() # to clean the state, if this cell ran earlier
73
69
```
74
70
75
-
## Step 2
71
+
## Construct a TAP Query and display the retrieved table in Firefly
76
72
77
73
TAP search the 'Known Solar System Object Possible Association List' catalog from the NEOWISE-R database. The specific target we are looking for is minor planet `558 Carmen`. We can query this target using a TAP search through IRSA; the `table_url` is broken down as follows:
78
74
@@ -110,15 +106,15 @@ Note that along with the table, firefly also displays the coverage and chart ass
110
106
111
107
+++
112
108
113
-
## Step 3
109
+
## Plot Light Curves in Firefly
114
110
115
111
After retrieving the data and displaying it in the client, we can now create a light curve by plotting the Modified Julian Date ('mjd') in the abscissa and the magnitude from band W1 ('w1mpro') in the ordinate. We also flip the ordinate to accurately display magnitude.
Finally, we can overlay the catalog of data in the table onto a HiPS image of our choice, using the method [`show_hips`](https://caltech-ipac.github.io/firefly_client/api/firefly_client.FireflyClient.html#firefly_client.FireflyClient.show_hips). However, this method requires target coordinates for the object you want to analyze.
124
120
@@ -153,6 +149,6 @@ Firefly allows you to visualize data for specific targets. In conjuction with As
153
149
154
150
**Author:** Eric Bratton II (IRSA Scientist) in conjunction with the IRSA Science Team
155
151
156
-
**Updated:** 2024-10-17
152
+
**Updated:** 2024-12-19
157
153
158
154
**Contact:**[the IRSA Helpdesk](https://irsa.ipac.caltech.edu/docs/help_desk.html) with questions or reporting problems.
0 commit comments