Skip to content

Commit 8105733

Browse files
Create a method for aligning images
Docs cleanup
1 parent 1019f72 commit 8105733

File tree

3 files changed

+28
-7
lines changed

3 files changed

+28
-7
lines changed

docs/usage/displaying-images.rst

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,11 @@ Turning On WCS Locking
103103
----------------------
104104

105105
When multiple images covering the same sky location are displayed, you can
106-
align and lock by sky coordinates. A dedicated method is not available, but
107-
the following action can be dispatched to lock and align by world coordinates:
106+
align and lock by sky coordinates. To lock and align by world coordinates:
108107

109108
.. code-block:: py
110109
111-
fc.dispatch('ImagePlotCntlr.wcsMatch',
112-
payload=dict(matchType='Standard',
113-
lockMatch=True))
110+
fc.align_images(lock_match=True)
114111
115112
Retrieving Images Using IRSA-Specific Searches
116113
----------------------------------------------

firefly_client/fc_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def ensure3(val, name):
7676
'ShowPlot': 'charts.data/chartAdd',
7777
'ZoomImage': 'ImagePlotCntlr.ZoomImage',
7878
'PanImage': 'ImagePlotCntlr.recenter',
79+
'AlignImages': 'ImagePlotCntlr.wcsMatch',
7980
'StretchImage': 'ImagePlotCntlr.StretchChange',
8081
'ColorImage': 'ImagePlotCntlr.ColorChange',
8182
'CreateRegionLayer': 'DrawLayerCntlr.RegionPlot.createLayer',

firefly_client/firefly_client.py

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,6 +1458,29 @@ def set_pan(self, plot_id, x=None, y=None, coord='image'):
14581458
payload.update({'centerPt': f'{x};{y};{coord}'})
14591459

14601460
return self.dispatch(ACTION_DICT['PanImage'], payload)
1461+
1462+
def align_images(self, match_type='Standard', lock_match=False):
1463+
"""
1464+
Align the images being displayed.
1465+
1466+
Parameters
1467+
----------
1468+
match_type : {'Standard', 'Target', 'Pixel', 'PixelCenter'}, optional
1469+
Match type to use to align the images: align by WCS ('Standard'),
1470+
by target ('Target'), by pixel prigins ('Pixel'), and by pixel at
1471+
image centers ('PixelCenter').
1472+
lock_match : bool, optional
1473+
Whether to lock the alignment. Panning/zooming in one image will
1474+
preserve the alignment in other images. Default is False.
1475+
1476+
Returns
1477+
-------
1478+
out : `dict`
1479+
Status of the request, like {'success': True}.
1480+
1481+
"""
1482+
payload = dict(matchType=match_type, lockMatch=lock_match)
1483+
return self.dispatch(ACTION_DICT['AlignImages'], payload)
14611484

14621485
def set_stretch(self, plot_id, stype=None, algorithm=None, band=None, **additional_params):
14631486
"""
@@ -1926,7 +1949,7 @@ def apply_table_filters(self, tbl_id, filters):
19261949
19271950
Parameters
19281951
----------
1929-
plot_id : `str`
1952+
tbl_id : `str`
19301953
ID of the table where you want to apply filters
19311954
filters : `str`
19321955
SQL WHERE clause-like string specifying filters. Column names must be quoted.
@@ -1947,7 +1970,7 @@ def sort_table_column(self, tbl_id, column_name, sort_direction=''):
19471970
19481971
Parameters
19491972
----------
1950-
plot_id : `str`
1973+
tbl_id : `str`
19511974
ID of the table where you want to apply sort
19521975
column_name : `str`
19531976
Name of the table column to sort

0 commit comments

Comments
 (0)