1+ ###############################
12Visualizing Tables and Catalogs
2- -------------------------------
3+ ###############################
34
45Tables can be uploaded to the Firefly server with :meth: `FireflyClient.upload_file `,
56and displayed in a table viewer component with :meth: `FireflyClient.show_table `.
@@ -11,25 +12,58 @@ if the table contains recognizable celestial coordinates.
1112 tval = fc.upload_file(' m31-2mass-2412-row.tbl' )
1213 fc.show_table(file_on_server = tval, tbl_id = ' m31-table' )
1314
15+ Modifying Table Display Parameters
16+ ----------------------------------
17+
1418If it is desired to overlay the table on an image, or to make plots from it,
1519without showing the table in the viewer, use :meth: `FireflyClient.fetch_table `:
1620
1721.. code-block :: py
1822
1923 fc.fetch_table(file_on_server = tval, tbl_id = ' invisible-table' )
2024
25+ Alternatively, you can turn off the `visible ` parameter in :meth: `FireflyClient.fetch_table `:
26+
27+ .. code-block :: py
28+
29+ fc.show_table(file_on_server = tval, tbl_id = ' invisible-table' , visible = False )
30+
2131 If the table does not contain celestial coordinates recognized by Firefly,
22- the image overlay will not appear. BUt if you specifically do not want
23- the table overlaid on the image, `is_catalog=False ` can be specified:
32+ the image overlay will not appear. But if you specifically do not want
33+ the table overlaid on the image, `is_catalog=False ` can be specified (it is
34+ `True ` by default):
2435
2536.. code-block :: py
2637
2738 fc.show_table(file_on_server = tval, tbl_id = ' 2mass-tbl' , is_catalog = False )
2839
40+
41+ Displaying Table from a URL
42+ ---------------------------
43+
2944If you have the URL of a table, you can pass it directly instead of
3045downloading it and then uploading it to firefly:
3146
3247.. code-block :: py
3348
3449 table_url = " http://irsa.ipac.caltech.edu/TAP/sync?FORMAT=IPAC_TABLE&QUERY=SELECT+*+FROM+fp_psc+WHERE+CONTAINS(POINT('J2000',ra,dec),CIRCLE('J2000',70.0,20.0,0.1))=1"
35- fc.show_table(url = table_url, tbl_id = ' 2mass-point-source-catalog' )
50+ tbl_id_2mass_psc = ' 2mass-point-source-catalog'
51+ fc.show_table(url = table_url, tbl_id = tbl_id_2mass_psc)
52+
53+ Filtering/Sorting a loaded Table
54+ --------------------------------
55+
56+ After displaying a table in firefly, you can also apply filters on it.
57+ You will need to pass the `tbl_id ` of that table and specify `filters ` as an
58+ SQL WHERE clause-like string with column names quoted:
59+
60+ .. code-block :: py
61+
62+ fc.apply_table_filters(tbl_id = tbl_id_2mass_psc, filters = ' "j_m">15 and "j_m"<16 and "j_cmsig"<0.06' )
63+
64+ You can sort the table by a column in ascending (`ASC `) or descending (`DESC `)
65+ order:
66+
67+ .. code-block :: py
68+
69+ fc.sort_table_column(tbl_id = tbl_id_2mass_psc, column_name = ' j_m' , sort_direction = ' ASC' )
0 commit comments