Skip to content

Commit

Permalink
Merge pull request #67 from ratt-ru/dev
Browse files Browse the repository at this point in the history
Ready for patch 0.3.7
  • Loading branch information
Mulan-94 authored May 24, 2020
2 parents 5a667c8 + e30ece8 commit 6d4a121
Show file tree
Hide file tree
Showing 9 changed files with 405 additions and 171 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
0.3.7
-----
**ragavi-gains**

- Fixed legend display bug
- ``--gain-type`` argument is now optional
- Static and interactive files can be generated simultaneously by specifying both ``--plotname`` and ``--htmlname``

ous
**general**

- Fixed bug in phase wrapping

0.3.6
-----
**ragavi-vis**
Expand Down
7 changes: 3 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,13 @@ To use ragavi gain plotter

.. code-block:: bash
$ ragavi-gains -t /path/to/your/table -g table_type (K / B/ F/ G/ D)
$ ragavi-gains -t /path/to/your/table
Multiple tables can be plotted on the same document simply by adding them in a space separated list to the :code:`-t` / :code:`--table` switch.
They must however be accompanied by their respective gain table type in the :code:`-g` switch. e.g
Multiple tables can be plotted on the same document simply by adding them in a space separated list to the :code:`-t` / :code:`--table` switch e.g

.. code-block:: bash
$ ragavi-gains -t delay/table/1/ bandpass/table/2 flux/table/3 -g K B F
$ ragavi-gains -t delay/table/1/ bandpass/table/2 flux/table/3
For the visibility plotter, the name-space :code:`ragavi-vis` is used. Help can be obtained by running

Expand Down
21 changes: 9 additions & 12 deletions docs/source/gains.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ Currently, gain tables supported for visualisation by ``ragavi-gains`` are :
* Gain calibration (G tables)
* D-Jones Leakage tables (D tables)

Mandatory fields are :code:`--table`, :code:`--gain_type`
Mandatory argument is :code:`--table`.

If a field name is not specified to ``ragavi-vis`` all the fields will be plotted by default
If a field name is not specified to ``ragavi-vis`` all the fields will be plotted by default. This is the same for correlations and spectral windows.

It is possible to place multiple gain table plots of different [or same] types into a single HTML document using ``ragavi`` This can be done by specifying the table names and gain types as space separate list as below
It is possible to place multiple gain table plots of different [or same] types into a single HTML document using ``ragavi`` This can be done by specifying the table names as a space separate list as below

.. code-block:: bash
$ragavi-gains --table table/one/name table/two/name table/three/name table/four/name --gain_types B G D F --fields 0
$ragavi-gains --table table/one/name table/two/name table/three/name table/four/name --fields 0
This will yield an output HTML file, with plots in the order

Expand Down Expand Up @@ -47,7 +47,7 @@ To use ``ragavi-gains`` in a notebook environment, run in a notebook cell
from ragavi.ragavi import plot_table
#specifying function arguments
args = dict(mytabs=[], gain_types=[], cmap='viridis', doplot='ri', corr=1, ant='1,2,3,9,10')
args = dict(mytabs=[], cmap='viridis', doplot='ri', corr=1, ant='1,2,3,9,10')
#inline plotting will be done
plot_table(**args)
Expand All @@ -74,17 +74,14 @@ It is possible to generate PNG and SVG with ``ragavi-gains`` via two methods. Th
export PATH=$PATH:/absolute/path/to/gecko
With this setup, one can now supply to ``ragavi-gains`` a ``--plotname`` value, which will result in the generation of PNG/SVG files, depending on the file extension provided. If, for example the plotname provided is ``foo.png``, ``ragavi-gains`` will assume the desired output should be PNG. The same applies for SVG.
With this setup, one can now supply to ``ragavi-gains`` a ``--plotname`` value, which will result in the generation of PNG/SVG files, depending on the file extension provided. If, for example, the plotname provided is ``foo.png``, ``ragavi-gains`` will assume the desired output should be PNG. The same applies for SVG. If both ``--plotname`` and ``--htmlname`` are provided, ``ragavi`` will generate both static (PNG) and interactive (HTML) outputs simulaneously.

It is necessary to point out that by default, ``ragavi`` uses the canvas image backend for interactive plots, due to performance issues associated with SVG image backend as stated in the `docs`_.
It is necessary to point out that by default, ``ragavi`` uses the canvas image backend for interactive plots, due to performance issues associated with SVG image backend as stated in the Bokeh `docs`_.
The default plots generated are always in HTML format.


API
***
.. autoclass:: ragavi.ragavi.DataCoreProcessor
:members: blackbox, act

Useful function
****************
.. autofunction:: ragavi.ragavi.plot_table


Expand Down
18 changes: 9 additions & 9 deletions ragavi/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,6 @@ def gains_argparser():
parser = MyParser(usage="%(prog)s [options] <value>",
description="A Radio Astronomy Gains and Visibility Inspector")
required = parser.add_argument_group("Required arguments")
required.add_argument("-g", "--gaintype", nargs='+', type=str,
metavar=' ', dest="gain_types", required=True,
choices=['B', 'D', 'G', 'K', 'F'],
help="""Type of table(s) to be plotted. Can be
specified as a single character e.g. "B" if a
single table has been provided or space
separated list e.g B D G if multiple tables have
been specified. Valid choices are B D G K & F""",
default=[])
required.add_argument("-t", "--table", dest="mytabs",
nargs='+', type=str, metavar=(' '), required=True,
help="""Table(s) to plot. Multiple tables can be
Expand Down Expand Up @@ -267,6 +258,15 @@ def gains_argparser():
help="""Plot complex values as amplitude & phase
(ap) or real and imaginary (ri). Defaults to ap.""",
default="ap")
pconfig.add_argument("-g", "--gaintype", nargs='*', type=str,
metavar=' ', dest="gain_types",
choices=['B', 'D', 'G', 'K', 'F'],
help="""Type of table(s) to be plotted. Can be
specified as a single character e.g. "B" if a
single table has been provided or space
separated list e.g B D G if multiple tables have
been specified. Valid choices are B D G K & F""",
default=[])
pconfig.add_argument("-kx", "--k-xaxis", dest="kx", type=str, metavar='',
choices=["time", "antenna"],
help="""Choose the x-xaxis for the K table. Valid
Expand Down
5 changes: 3 additions & 2 deletions ragavi/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,11 @@ def create_bk_fig(x=None, xlab=None, x_min=None, x_max=None,
# define the axes ranges
x_range = DataRange1d(name="p_x_range", only_visible=True)

y_range = DataRange1d(name="p_y_range", only_visible=True)

if x_min != None and x_max != None and x_name.lower() in ["channel", "frequency"]:
x_range = Range1d(name="p_x_range", start=x_min, end=x_max)

y_range = DataRange1d(name="p_y_range", only_visible=True)
y_range.only_visible = False

# define items to add on the plot
p_htool = HoverTool(tooltips=[(x_name, "$x"),
Expand Down
Loading

0 comments on commit 6d4a121

Please sign in to comment.