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
+31-40Lines changed: 31 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,8 +39,8 @@ For documentation on the firefly client visit https://caltech-ipac.github.io/fir
39
39
## Imports
40
40
41
41
-*firefly_client FireflyClient* - Python API to Firefly for displaying tables, images and charts
42
-
-*firefly_client.plot* for visualizing the light curve in the client
43
42
-*astropy.utils.data* for downloading the catalog data via TAP query
43
+
-*urllib.parse* for converting regular query string to url-safe string
44
44
45
45
```{code-cell} ipython3
46
46
# Uncomment the next line to install dependencies if needed.
@@ -49,13 +49,13 @@ For documentation on the firefly client visit https://caltech-ipac.github.io/fir
49
49
50
50
```{code-cell} ipython3
51
51
from firefly_client import FireflyClient
52
-
import firefly_client.plot as ffplt
53
52
import astropy.utils.data
53
+
import urllib.parse
54
54
```
55
55
56
56
## Step 1
57
57
58
-
Instantiate the client via and view it in a different tab in the web browser.
58
+
Instantiate the client and view it in a different tab in the web browser.
59
59
60
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/.
# url='http://127.0.0.1:8080/firefly' # if you have firefly server running locally (preferably through docker)
65
65
66
66
fc = FireflyClient.make_client(url)
67
-
ffplt.use_client(fc)
68
67
```
69
68
70
-
You can re-initizialize the viewer to return to a clean slate with [`reinit_viewer`](https://caltech-ipac.github.io/firefly_client/api/firefly_client.FireflyClient.html#firefly_client.FireflyClient.reinit_viewer).
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).
71
70
72
71
```{code-cell} ipython3
73
72
# fc.reinit_viewer(); # The semi-colon suppresses the output of the method when ran
74
73
```
75
74
76
75
## Step 2
77
76
78
-
Setup the layout of viewer and 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:
77
+
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:
79
78
80
-
- We want to search the data through IRSA, which supports TAP querying, and we want it streamed directly to us via a synchronous search: <br>"https://<!---->irsa.ipac.caltech.edu/TAP/sync?"<br><br>
81
-
- Next, we want to structure query to only retrieve (558) Carmen data from the NEOWISE-R 'Known Solar System Object Possible Association List' catalog. The table name of the catalog can be found using [IRSAViewer](https://irsa.ipac.caltech.edu/irsaviewer/?__action=layout.showDropDown&view=MultiTableSearchCmd) and clicking the **VO TAP Search** tab and changing the 'Project' to **neowiser**. We query all columns of data and we search the target by its object id, which is its name, and use the 'like' condition to only write (558) with a wildcard: <br>"QUERY=SELECT+*+FROM+neowiser_p1ba_mch+AS+n+WHERE+n.objid+like+'(558)%'"
79
+
- We want to search the data through IRSA, which supports TAP querying, and we want it streamed directly to us via a synchronous search: <br>"https://<!---->irsa.ipac.caltech.edu/TAP/sync"<br><br>
80
+
- Next, we want to structure query to only retrieve (558) Carmen data from the NEOWISE-R 'Known Solar System Object Possible Association List' catalog. The table name of the catalog can be found using [IRSAViewer](https://irsa.ipac.caltech.edu/irsaviewer/?__action=layout.showDropDown&view=MultiTableSearchCmd) and clicking the **VO TAP Search** tab and changing the 'Project' to **neowiser**. We query all columns of data and we search the target by its object id, which is its name, and use the 'like' condition to only write (558) with a wildcard as shown in the cell below.
82
81
83
82
Construction of the query can be found in the [`IRSA TAP documentation page`](https://irsa.ipac.caltech.edu/docs/program_interface/TAP.html).
84
83
85
-
We first add a cell to the layout that will hold the table; this cell is shown at row = 0, col = 0, with width = 4, height = 2. Once the cell is created, we can request the necessary data from the catalog and display the data as a table using the [`show_table`](https://caltech-ipac.github.io/firefly_client/api/firefly_client.FireflyClient.html#firefly_client.FireflyClient.show_table) method.
Now, we can request the necessary data from the catalog and display the data as a table in the Firefly client, using the [`show_table`](https://caltech-ipac.github.io/firefly_client/api/firefly_client.FireflyClient.html#firefly_client.FireflyClient.show_table) method.
86
96
87
97
Alternatively, we can download data from the catalog using [`astropy.utils.data.download_file`](https://docs.astropy.org/en/stable/api/astropy.utils.data.download_file.html) and upload it to the Firefly client shown in the cell below the first method.
Note that along with the table, firefly also displays the coverage and chart associated with the table. It overlays colored squares for each row of the table onto a HiPS image, because the table contains recognizable celestial coordinates. It also creates a scatter plot of ra and dec from the table.
103
110
104
-
# file = fc.upload_file(tablename)
105
-
# fc.show_table(file, tbl_id='tableneo', title='558 Carmen Catalog', page_size=50)
106
-
```
111
+
+++
107
112
108
113
## Step 3
109
114
110
115
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.
111
116
112
117
```{code-cell} ipython3
113
-
r = fc.add_cell(2, 0, 2, 2, 'plot-image', 'light-curve')
114
-
if r['success']:
115
-
status = fc.show_xyplot(tbl_id='tableneo', xCol='mjd', yCol='w1mpro', yOptions='flip')
Finally, we can overlay the catalog of data in the table onto a HiPS image using the [`show_coverage`](https://caltech-ipac.github.io/firefly_client/api/firefly_client.FireflyClient.html#firefly_client.FireflyClient.show_coverage) method.
121
-
122
-
You will notice that there are colored squares that signify where the object was observed based on the RA and Dec given in the catalog.
123
-
124
-
```{code-cell} ipython3
125
-
r = fc.add_cell(2, 2, 2, 2, 'catalog-image', 'target')
126
-
if r['success']:
127
-
fc.show_coverage();
128
-
```
129
-
130
-
Alternatively, we can queue a HiPS image 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.
123
+
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.
@@ -146,7 +137,7 @@ Firefly allows you to visualize data for specific targets. In conjuction with As
146
137
147
138
1. We import all necessary modules to create a Firefly client and to download the catalog of data for our target.
148
139
149
-
2. We start the client in our web browser and prep the layout to appropiately display our tables, plots and images.
140
+
2. We start the client in our web browser to appropiately display our tables, plots and images.
150
141
151
142
3. We use the TAP schema to display the data for our target —[`558 Carmen`](https://irsa.ipac.caltech.edu/irsaviewer/?__action=table.search&request=%7B%22startIdx%22%3A0%2C%22SearchMethod%22%3A%22AllSky%22%2C%22RequestedDataSet%22%3A%22NEOWISE%20Reactivation%20Database%22%2C%22id%22%3A%22GatorQuery%22%2C%22tbl_id%22%3A%22tbl_id-cf48-45%22%2C%22META_INFO%22%3A%7B%22title%22%3A%22WISE-neowiser_p1ba_mch%20(AllSky)%22%2C%22tbl_id%22%3A%22tbl_id-cf48-45%22%2C%22tbl_pref_key%22%3A%22WISE-neowiser_p1ba_mch%22%7D%2C%22catalogProject%22%3A%22WISE%22%2C%22catalog%22%3A%22neowiser_p1ba_mch%22%2C%22constraints%22%3A%22objid%20like%20%27%25(558)%20Carmen%25%27%22%2C%22pageSize%22%3A100%7D&options=%7B%22backgroundable%22%3Atrue%2C%22pageSize%22%3A100%7D)— via a table and visualize such data through charts.
152
143
@@ -161,5 +152,5 @@ Firefly allows you to visualize data for specific targets. In conjuction with As
161
152
+++
162
153
163
154
**Author:** Eric Bratton II (IRSA Scientist) in conjunction with the IRSA Science Team<br>
164
-
**Updated On:** 2024-07-31<br>
155
+
**Updated On:** 2024-10-17<br>
165
156
**Contact:**[email protected] or https://irsa.ipac.caltech.edu/docs/help_desk.html
Copy file name to clipboardExpand all lines: tutorials/firefly/SEDs_in_Firefly.md
+12-13Lines changed: 12 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -553,7 +553,7 @@ phot_tbl
553
553
554
554
This notebook assumes that [jupyter_firefly_extensions](https://github.com/Caltech-IPAC/jupyter_firefly_extensions) has been installed, and that the Firefly server to use has been specified before Jupyterlab was started.
555
555
556
-
If everything has been properly configured, executing the next cell will bring up a Firefly tab in Jupyterlab with the message "Firefly Ready":
556
+
If everything has been properly configured, executing the next cell will bring up a Firefly tab in Jupyterlab with the welcome message.
557
557
558
558
```{code-cell} ipython3
559
559
# Uncomment to use the jupyter_firefly_extensions
@@ -566,7 +566,6 @@ fc = FireflyClient.make_client(url="https://irsa.ipac.caltech.edu/irsaviewer")
566
566
In the event that there are problems with the tab opened above, run the below command to obtain a web link that can be opened in a browser directly:
567
567
568
568
```{code-cell} ipython3
569
-
# Temporary work-around to Firefly error for Slate and/or Internet connection problems
0 commit comments