Code Monkey home page Code Monkey logo

argos's Introduction

Argos

Argos is a GUI for viewing and exploring scientific data, written in Python and Qt. It has a plug-in architecture that allows it to be extended to read new data formats. At the moment plug-ins are included to read HDF-5, NetCDF-4, WAV, Exdir, numpy binary files and various image formats, but a plug-in could be written for any data that can be expressed as a Numpy array.

Installing Argos

Argos works with Python 3.7 and higher.

Argos requires at least PyQt5 and Numpy and CmLib. It is strongly recommended to also install PyQtGraph and PgColorBar, which are required to visualize the data as image plots or line plots. Without them the data can only be examined as tables or text.

The following dependencies are optional. You only need to install them if you want to read the corresponding file formats.

Optional Python package File formats
h5py HDF-5
netCDF4 NetCDF (v3 and v4)
pillow BMP, JPEG, PNG, TIFF, GIF, etc.
scipy Matlab & IDL save-files. WAV
pandas Comma-separated files
exdir Exdir

Installing Argos with Pip

First install PyQt5 with pip, then install Argos.

%> pip install PyQt5
%> pip install argos

After that, install the optional dependencies with pip install <package>.

Installing Argos with Anaconda

Argos is available at the conda-forge channel. To install it type:

%> conda install pyqt
%> conda install -c conda-forge argos

After that, install the optional dependencies with conda install <package> (or pip install <package> for exdir).

Starting Argos

After installation, Argos can be started from the command-line with

    %> argos [FILE [FILE ...]]

where [FILE [FILE ...]] are zero or more files or directories you want to view.

For a complete list of command line options, run argos with `-h'.

    %> argos -h

Trouble shooting

If you start argos and nothing happens, you probably didn't install PyQt or numpy. You can try to start argos as follows to get more information

    %> python -m argos

Resetting Argos

At start-up, Argos reads some persistent settings (window position and size, plot settings, etc) from a configuration file so that you can continue where you left off the previous session.

If, for some reason, you want Argos to reset to its initial state, you can simply delete this config file before starting Argos (please make a backup just in case). Argos will then start with the original configuration.

The configuration file is called settings.json by default. Its location is platform dependent:

	Windows: C:\Users\<user>\AppData\Local\titusjan\argos
	MacOS: ~/Library/Preferences/titusjan/argos
	Linux: ~/.config/titusjan/argos

Note that this directory might be hidden. For convenience you can open this directory in a file browser by selecting Configure | Show Config Files... from the Argos main menu.

Using Argos

The Argos main window consists of a central panel that holds a visualization, and some smaller windows that surround the main panel. The smaller windows can be moved around by dragging them by their title bar. They can be separated from the main window or can be docked at an at another position. Collectively they are called the dock panels. You can show and hide them via the View | Panels main menu (although there is typically no need to do so).

argos_screen_shot

The main panel is called the (data) Inspector. From the View main menu you can select one of the following inspector types: Line Plot, Image Plot, Table, or Text inspector. The current inspector type is shown in the menu button above the inspector panel. Clicking this button (or pressing ctrl-I) is an alternative way of selecting a different inspector.

If you want to have multiple inspectors open at the same time, you can select New Window from the File menu.

Selecting Data

Note: the HDF5 file that is used in the screenshot and in the examples below can be downloaded here (2.4 MB). More (NetCDF4) example data can be found at the UCAR site here.

The Data dock panel displays the list of files and directories that are loaded and are available for inspection. The repository has the form of a tree, or more precisely a list of trees (a forest). You can add files by selecting the Open Files from the File menu, and add directories with the Browse Directory option. Argos uses the file extension to determine which plug-in to use for opening the file. The icon color of the tree items indicates which plug-in was used. With the Open as menu option you can force Argos to open a file with the a certain plug-in. If a plug-in raises an error while opening a file, it will get a red triangle as icon (hover over the item to get a tool-tip with the error message).

Expanding the items in the tree will automatically open the underlying files. Collapsing an item will close the file again. Right-clicking the item will bring forward a context menu that makes it possible to collapse the item without closing the underlying file, to reload the file, or to open the file with a different plug-in.

Note that the data repository is shared between all Argos main windows. That is, opening a file will add a new item to the Data tree of all open windows.

Slicing Data

Selecting an item in the tree will automatically place it in the Collector table at the bottom right of the windows. If the item contains numerical data, drop-down and spinbox widgets will appear in the table. These enable you to specify a slice of the data that the inspector will then visualize.

In the screen shot for example, the ColumnAmountO3 HDF-5 dataset is selected and placed in the collector. This is a two-dimensional data array, it contains a world wide distribution of ozone in the atmosphere. The first dimension corresponds to longitude, the second to latitude. These dimensions have no name since the dataset has no associated dimension scales. Therefore, Argos just calls them dim-0 and dim-1.

The inspector in the screen shot is an Image Plot. This is a two-dimensional inspector so there will appear two drop-down box in the table: the first specifies which dimension will be mapped onto the Y-axis (dim-0 in the example) and the second determines the data dimension that is mapped to the X-axis.

collector_2d

When you select the Line Plot inspector from the View menu or the Inspector button, the selected data will be drawn as a line plot. A line plot can only show one-dimensional data, but because since the example data is two-dimensional only a sub-slice of the dataset can be visualized. The collector will therefore contain a drop-down box for specifying which data dimension will be laid along the X-axis, and a spinbox-slider combination for selecting the index of the other dimension. Below you see the case that the line plot will draw row 360. By the way, this is reflected in the plot title, which will be ColumnAmountO3[360, :]).

collector_1d

By default Argos will put the first array dimension(s) in the spinbox(es), and select the fasted changing array dimension(s) in the drop-down box(es).

Inspecting Data and Configuring the Visualization

The Settings dock panel, located at the top right, contains settings for configuring the current inspector. If you click on a config value, an appropriate widget will appear for editing, together with a reset button that will reset the config value to its default when clicked.

The settings are hierarchical so that related settings are grouped together in a branch. Branches also have a reset button that resets the complete branch. For instance by clicking on the reset button of the y-axis config value branch, all settings pertaining to the Y-axis are reset.

Note that some branches are collapsed by default to hide the infrequently used settings and reduce clutter. For instance the cross-hair item can be expanded for further tweaking of the cross-hair plots.

When you click on the Reset Ranges button at the bottom of the Settings panel, all settings that are related to the data range (such as the range of the axes and the color scale) are reset to their default values. This gives you a convenient way to go back to viewing all the data after zooming in. Pressing Ctrl-0 has the same effect.

If the auto checkbox is checked, the Range settings are automatically reset every time you select a new item in the Data tree or select a new axis in drop-down box in the data Collector panel. Normally this is desired behavior because a new dataset or axis will have a totally different data range. Unchecking the auto scale checkbox allows you to retain the axes range settings, which can be useful in case you are switching to a related dataset with the same data extent.

If you want to reset all inspector settings you can click on the triangle next to the Reset Range button and select Reset All in the context menu that appears. The menu also allow you to change the default action of the button.

A few of the inspector settings are explained below. It is not a complete list, many of the settings will be clear from their name. I also urge you to experiment yourself by just trying new values. You can always go back by using the Reset All option as described above.

Line Plot Inspector

The Line Plot inspector contains a single line plot, which uses PyQtGraph the underlying plot engine.

You can move (pan) the plot by dragging it while holding the left mouse button. Dragging with the right mouse button zooms in or out. If you drag while your mouse cursor is above the X or Y axis, panning and zooming will be only done in that direction. Zooming can also be done by scrolling your mouse-wheel while the cursor is above the plot or axes. In addition, you can employ a rectangle zoom mode by checking the rectangle zoom mode checkbox in the the settings panel. In this mode dragging with the left button will draw a rectangle, which will subsequently be used as the new plot range.

To reset the plot range you can click the middle mouse button anywhere on the plot (or one of the axes). You can also reset it by clicking the small button labeled 'A' in the lower left corner of the figure. Finally, right clicking on the plot will pop up a context menu from which the plot range can also be reset.

If the axis auto-range mode is on, the axis' range is calculated from the data. By default this is delegated to PyQtGraph, but by setting the y-axis/range/autorange/method option, you can let the auto-range method discard a certain percentage of the outliers.

If the axis auto-range mode is off, you can set the axis' range manually in the range/min and range/max options. The range will remain fixed if you select a new slice with the spinbox. Autorange will be turned off as soon as you zoom or pan the data. You can turn it on again in the range/autorange option, or by resetting the axis' plot range as described above.

The plot title can be modified with the title config option via an editable combobox widget. You can enter any title you want but be aware that the title may be incorrect as soon as you pick a new item from the Data tree. Therefore a few properties can be written in between braces. These will then be updated dynamically whenever a new data item is selected. For example, {name} will be substituted with the name of the selected item.

  • {name} : name of the selected item from the Data tree.
  • {path} : full path of the items leading up to the selected item. Might be long!
  • {base-name}: name of the file that contains the item.
  • {dir-name} : directory of the file that contains the item. Might be long!
  • {file-name}: full file name (dir-name + '/' + base-name). Might be long!
  • {slices} : information about the selected array slice in Numpy notation. E.g. [360, :]
  • {unit} : the unit of the item in parenthesis, or the empty string if no unit is available.
  • {raw-unit} : the unit of the item as-is, that is, without parenthesis.

Furthermore, PyQtGraph uses HTML for the plot title so you can make fancy titles such as <small>{name} <span style="color:#FF0066">{slices}</span></small>. This also means that you must escape the <, > and & characters by using &lt;, &gt;, &amp; instead!

The x-axis/label and y-axis/label settings can be edited in the same way as the title.

The editable comboboxes will remember entered values. If you want to remove an item from a combobox, highlight it in and then press delete. You can also press Ctrl-Del while you are editing to remove the current item.

The pen settings branch holds config items that determine how the plot curve is drawn. Make sure you have at least one of the line and symbol checkmarks checked, or the curve will be invisible. Anti-aliasing is turned on by default. This can be slow, especially in combination with a line width other than 1.0, so if you have large plots you might want to turn it off.

Image Plot Inspector

This inspector shows an image plot and optional cross-hair line plots that show cross sections of the data at the cursor (see the screen shot at the top of this document).

Panning, zooming and setting the plot titles work in the same manner as for the Line Plot inspector. Next to that, the image plot has a color scale that determines the minimum and maximum values of the color scale. Its range, too, can be in auto-range mode, or can be set manually.

The range of the color scale can also be manipulated by panning and zooming the color scale as follows:

  • Pan the range: Drag the scale up or down with the left mouse button to move the color range. This changes the intensity of the colorized image.
  • Zoom the range: Drag the scale using the right mouse button, or scroll with the mousewheel when the cursor is above the scale. This makes the extent of the scale larger or smaller and so changes the contrast of the colorized image.
  • Change the range at one side only: Hover the cursor over one of the dashed horizontal lines (located at the edges of the color bar) until it becomes wider and the cursor changes. Then drag the line up or down. The range will change only at that end-point while the other end-point remains the same. Note that the drag lines might be hidden with the show draglines setting but they still will appear if the cursor hovers above them. The show draglines/margins option allows you to increase white space around the color bar so that you have more room for dragging.
  • Reset the range: Click the middle mouse button (or mouse wheel) while the cursor is above the scale to reset the color range.

Next to the color scale you see a side-ways histogram, which gives an indication of how many pixels have a certain value. This may assist you in choosing the best color range. The histogram can be hidden by unchecking the color scale/show histogram setting.

Argos comes with a large collection of color maps. The current color map can be changed with the color scale/color map setting. The drop-down box contains a small selection of user-favorite color maps. The ellipsis button (โ€ฆ) next to will bring forward a dialog window which contains a table with all the available color maps. You can add color maps to the favorites by checking the check box in the left most column of the table (labeled โ˜…). See the CmLib documentation for more details.

By checking the cross hair config option you can bring up two line plots to the side of the figure (see the screen shot at the top). A horizontal and vertical line are drawn at the cursor position and the plots will contain a cross-section of the values along those lines.

Table Inspector

This inspector is useful for examining the exact values of your data. You can change the size of the table cells via the row height and column width settings. By checking the auto row heights and/or the auto column widths check boxes, you can configure the table inspector to calculate the cell sizes dynamically from their contents. Note that this can be slow for large tables. So, as an optimization, if the table has more than 1000 elements only the currently selected cell is used to calculate the height and width, and this is applied to all other cells. If a table has more than 10000 rows or columns, auto resizing is disabled.

If your selected data item is a structured array, i.e. an array having fields, all fields are displayed in a separate column by default. If you uncheck the separate fields checkbox, all fields of are combined in a single cell as follows: (field1, field2, ...).

You can change how the data in the cells is formatted with the config options under the format specifier branch. Which setting is used depends on your data type: the integers format setting is used if the data in the cell is an integer, other numbers is used for floating point, rational, or complex numbers; and any data that is not a string or a number is formatted with the other types format code. For instance, setting the other numbers to .2e will display all floating point data in scientific notation with two digits behind the decimal point.

The format codes must be a format_spec from the new-style Python formatting. You can think of them as new-style formatting codes, but without the braces and the colon. If you want to use a complete format string, i.e. with the braces and the colon, you must put your format string between quotes. For example, using 'hello {:.2e}' will prepend "hello" to the data values. Take a look at this page or the Python documentation Format Specification Mini-Language to see what's possible.

Text Inspector

The Text inspector contains a read-only text editor widget that shows the contents of a single array element. If your data consists of large strings, especially strings of multiple lines, examining it in a text editor works better than using a table and resizing the cell sizes. Also the word wrap settings has more options here. To see this for yourself, download the example file from the screenshot here (2.4 MB), and look at the HDFEOS INFORMATION/StructMetadata.0 dataset in both the table inspector and the text inspector.

Viewing Metadata

At the bottom of the Data panel, in the lower left corner of the screen shot, are two tabs that contain meta data of the item that is currently selected in the tree.

The Attributes tab lists the attributes of items from HDF or NetCDF files. Other file formats may contain similar meta data, which will also be displayed here.

The Properties tab contains a list of properties, such as the shape and element-type of the selected item. In contrast to the Attributes this list is fixed; all data items always have the same list of properties (although their contents may be empty). These properties, by the way, can be added as columns in the Data tree via View | Table Headers | Data in the main menu.

argos's People

Contributors

bilderbuchi avatar graingert avatar luihabl avatar sidneycadot avatar titusjan avatar zhangmx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

argos's Issues

Failed to disconnect signal when editing config item with PySide2

When using the PySide2 binding the following error occurs when you close a spin box editor in the Config Tree (i.e. when you have filled in a value and select a new config item to edit).

Traceback (most recent call last):
File "/Users/kenter/prog/py/argos/argos/config/configtreeview.py", line 102, in closeEditor
configItemDelegate.finalizeEditor(editor)
File "/Users/kenter/prog/py/argos/argos/config/configitemdelegate.py", line 69, in finalizeEditor
editor.finalize()
File "/Users/kenter/prog/py/argos/argos/config/intcti.py", line 126, in finalize
super(IntCtiEditor, self).finalize()
File "/Users/kenter/prog/py/argos/argos/config/abstractcti.py", line 573, in finalize
self.resetButton.clicked.disconnect(self.resetEditorValue)
RuntimeError: Failed to disconnect signal clicked().

When you close a combobox editor the following error occurs.

Traceback (most recent call last):
File "/Users/kenter/prog/py/argos/argos/config/configtreeview.py", line 102, in closeEditor
configItemDelegate.finalizeEditor(editor)
File "/Users/kenter/prog/py/argos/argos/config/configitemdelegate.py", line 69, in finalizeEditor
editor.finalize()
File "/Users/kenter/prog/py/argos/argos/config/choicecti.py", line 226, in finalize
self._comboboxListView.removeEventFilter(self)
RuntimeError: Internal C++ object (PySide2.QtWidgets.QAbstractItemView) already deleted.

Might be related to #12

Plot from different datasets

Hello,

I was just introduced to your product which I find very helpful for viewing the structure of the HDF5. However, I have many experiments and store them in different groups for organization, for instance:

file['exp1/x']
file['exp2/x']
file['exp3/x']

It would be really nice to be able to plot file['exp3/x'] versus file['exp2/x'] for instance.

I recognize that this is a new software but if this gets added I would be a happy camper.

Thanks!
Salvatore Ferrone

"Line Plot" unusable because "QtCore" is not defined

I was getting this warning message when I try to plot a line for a 1-D vector or 2-D matrix:

2021-10-04 10:10:03.459 :                basereg.py:216  : WARNING : Unable to import 'argos.inspector.pgplugins.lineplot1d.PgLinePlot1d': name 'QtCore' is not defined
2021-10-04 10:10:03.459 :             mainwindow.py:615  : WARNING : Unable to create 'lineplot' inspector because Class not successfully imported: name 'QtCore' is not defined
2021-10-04 10:10:03.459 :             mainwindow.py:637  : WARNING : Unable to create 'lineplot' inspector because Class not successfully imported: name 'QtCore' is not defined

Even though the message was warning, line plotting functionality was not working.

This error disappeared and I was able to plot lines after modifying the file "argos/inspector/pgplugins/pghistlutitem.py" by adding the following line at the top:

from pyqtgraph.Qt import QtCore

Could anybody apply this simple bug fix and push the new version to conda-forge?

Thank you very much for this nice tool! I've been looking for a good alternative to hdfview for a very long time.

p.s. By the way, importing QtCore from argos.qt failed with the error message module 'PyQt5.QtCore' has no attribute 'Signal'.

p.p.s The conda environment I tested was created as follows:

$ conda create -p argos_test argos pyqt h5py -c conda-forge

And the following is the output of $ conda list:

# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       1_gnu    conda-forge
alsa-lib                  1.2.3                h516909a_0    conda-forge
argos                     0.3.1              pyhd8ed1ab_0    conda-forge
c-ares                    1.17.2               h7f98852_0    conda-forge
ca-certificates           2021.5.30            ha878542_0    conda-forge
cached-property           1.5.2                hd8ed1ab_1    conda-forge
cached_property           1.5.2              pyha770c72_1    conda-forge
cmlib                     1.1.1              pyhd8ed1ab_0    conda-forge
dbus                      1.13.6               h48d8840_2    conda-forge
expat                     2.4.1                h9c3ff4c_0    conda-forge
fontconfig                2.13.1            hba837de_1005    conda-forge
freetype                  2.10.4               h0708190_1    conda-forge
gettext                   0.19.8.1          h73d1719_1008    conda-forge
glib                      2.68.4               h9c3ff4c_1    conda-forge
glib-tools                2.68.4               h9c3ff4c_1    conda-forge
gst-plugins-base          1.18.5               hf529b03_0    conda-forge
gstreamer                 1.18.5               h76c114f_0    conda-forge
h5py                      3.4.0           nompi_py39h7e08c79_101    conda-forge
hdf5                      1.12.1          nompi_h2750804_100    conda-forge
icu                       68.1                 h58526e2_0    conda-forge
jpeg                      9d                   h36c2ea0_0    conda-forge
krb5                      1.19.2               hcc1bbae_2    conda-forge
ld_impl_linux-64          2.36.1               hea4e1c9_2    conda-forge
libblas                   3.9.0           11_linux64_openblas    conda-forge
libcblas                  3.9.0           11_linux64_openblas    conda-forge
libclang                  11.1.0          default_ha53f305_1    conda-forge
libcurl                   7.79.1               h2574ce0_1    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 h516909a_1    conda-forge
libevent                  2.1.10               hcdb4288_3    conda-forge
libffi                    3.4.2                h9c3ff4c_4    conda-forge
libgcc-ng                 11.2.0               h1d223b6_9    conda-forge
libgfortran-ng            11.2.0               h69a702a_9    conda-forge
libgfortran5              11.2.0               h5c6108e_9    conda-forge
libglib                   2.68.4               h174f98d_1    conda-forge
libgomp                   11.2.0               h1d223b6_9    conda-forge
libiconv                  1.16                 h516909a_0    conda-forge
liblapack                 3.9.0           11_linux64_openblas    conda-forge
libllvm11                 11.1.0               hf817b99_2    conda-forge
libnghttp2                1.43.0               h812cca2_1    conda-forge
libogg                    1.3.4                h7f98852_1    conda-forge
libopenblas               0.3.17          pthreads_h8fe5266_1    conda-forge
libopus                   1.3.1                h7f98852_1    conda-forge
libpng                    1.6.37               h21135ba_2    conda-forge
libpq                     13.3                 hd57d9b9_0    conda-forge
libssh2                   1.10.0               ha56f1ee_2    conda-forge
libstdcxx-ng              11.2.0               he4da1e4_9    conda-forge
libuuid                   2.32.1            h7f98852_1000    conda-forge
libvorbis                 1.3.7                h9c3ff4c_0    conda-forge
libxcb                    1.13              h7f98852_1003    conda-forge
libxkbcommon              1.0.3                he3ba5ed_0    conda-forge
libxml2                   2.9.12               h72842e0_0    conda-forge
libzlib                   1.2.11            h36c2ea0_1013    conda-forge
lz4-c                     1.9.3                h9c3ff4c_1    conda-forge
mysql-common              8.0.25               ha770c72_2    conda-forge
mysql-libs                8.0.25               hfa10184_2    conda-forge
ncurses                   6.2                  h58526e2_4    conda-forge
nspr                      4.30                 h9c3ff4c_0    conda-forge
nss                       3.69                 hb5efdd6_1    conda-forge
numpy                     1.21.2           py39hdbf815f_0    conda-forge
openssl                   1.1.1l               h7f98852_0    conda-forge
pcre                      8.45                 h9c3ff4c_0    conda-forge
pgcolorbar                1.1.1              pyhd8ed1ab_0    conda-forge
pip                       21.2.4             pyhd8ed1ab_0    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
pyqt                      5.12.3           py39hf3d152e_7    conda-forge
pyqt-impl                 5.12.3           py39h0fcd23e_7    conda-forge
pyqt5-sip                 4.19.18          py39he80948d_7    conda-forge
pyqtchart                 5.12             py39h0fcd23e_7    conda-forge
pyqtgraph                 0.12.2             pyhd8ed1ab_0    conda-forge
pyqtwebengine             5.12.1           py39h0fcd23e_7    conda-forge
python                    3.9.7           hb7a2778_3_cpython    conda-forge
python_abi                3.9                      2_cp39    conda-forge
qt                        5.12.9               hda022c4_4    conda-forge
readline                  8.1                  h46c0cb4_0    conda-forge
setuptools                58.0.4           py39hf3d152e_2    conda-forge
sqlite                    3.36.0               h9cd32fc_2    conda-forge
tk                        8.6.11               h27826a3_1    conda-forge
tzdata                    2021b                he74cb21_0    conda-forge
wheel                     0.37.0             pyhd8ed1ab_1    conda-forge
xorg-libxau               1.0.9                h7f98852_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xz                        5.2.5                h516909a_1    conda-forge
zlib                      1.2.11            h36c2ea0_1013    conda-forge
zstd                      1.5.0                ha95c52a_0    conda-forge

Can't read HDF5 created with pandas.

Hi,

Your tool looks amazing! Unfortunately it seems not to like my HDF5 files, created with pandas.

Maybe you could implement that, too.
Best regards!

Reproduction:

Execute this in Python to create the HDF5 file:

import pandas as pd
import numpy as np
with pd.HDFStore('NOT_IMPLEMENTED.h5') as store:
    df = pd.DataFrame(np.random.rand(4, 4),
                           columns=['A', 'B', 'C', 'D'],
                           index=pd.date_range("20180101 00:00", periods=4))
    store.put('Test', df, format='table', data_columns=True)

Then open it in argos (argos NOT_IMPLEMENTED.h5) and open the group "Test" in the treeview.

Error Message

Bug: uncaught OSError
Unable to read attribute (no appropriate function for conversion path)

Traceback (most recent call last):
  File "/anaconda3/lib/python3.7/site-packages/argos/qt/treemodels.py", line 91, in data
    return self.itemData(item, index.column(), role=role)
  File "/anaconda3/lib/python3.7/site-packages/argos/repo/repotreemodel.py", line 113, in itemData
    return super(RepoTreeModel, self).itemData(treeItem, column, role=role)
  File "/anaconda3/lib/python3.7/site-packages/argos/qt/treemodels.py", line 117, in itemData
    return item.decoration
  File "/anaconda3/lib/python3.7/site-packages/argos/repo/baserti.py", line 274, in decoration
    return rtiIconFactory.getIcon(self.iconGlyph, isOpen=not self.canFetchChildren(),
  File "/anaconda3/lib/python3.7/site-packages/argos/repo/rtiplugins/hdf5.py", line 359, in iconGlyph
    if self._h5Dataset.attrs.get('CLASS', None) == b'DIMENSION_SCALE':
  File "/anaconda3/lib/python3.7/_collections_abc.py", line 660, in get
    return self[key]
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "/anaconda3/lib/python3.7/site-packages/h5py/_hl/attrs.py", line 81, in __getitem__
    attr.read(arr, mtype=htype)
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py/h5a.pyx", line 355, in h5py.h5a.AttrID.read
  File "h5py/_proxy.pyx", line 36, in h5py._proxy.attr_rw
OSError: Unable to read attribute (no appropriate function for conversion path)

Image plot crosshair fails on NetCDF scalars set to fill value.

When cross hair plots are enabled in the Image Plot inspector, and the user hovers above plot, and the selected item is a NetCDF scalar set to the fill value, the application exits with the following error:

Traceback (most recent call last):
  File "C:\Users\kenter\Documents\src\argos\argos\inspector\pgplugins\imageplot2d.py", line 587, in mouseMoved
    rowData = replaceMaskedValueWithFloat(rowData, np.isinf(rowData),
  File "C:\Users\kenter\Documents\src\argos\argos\utils\masks.py", line 252, in replaceMaskedValueWithFloat
    return replaceMaskedValue(data, mask, replacementValue, copyOnReplace=copyOnReplace)
  File "C:\Users\kenter\Documents\src\argos\argos\utils\masks.py", line 231, in replaceMaskedValue
    result[mask] = replacementValue
ValueError: assignment destination is read-only

This can be reproduced with the scalars.nc/masked_scalar item that can be generated by create_test_data.py

Bug: levels argument is required for float input types

Version info:

image

I get the following dialog on a particular HDF5 test file generated with h5py (attached).

image

The error in question happens when activating 2D Image Plot view on node mode_low_gain/example_sequence/rts/<RESULTS>/map.

image

The zipped HDF5 file is here:

test.zip

Export dataset

Often I want to quickly export a dataset while browsing a h5 file. I could do this via the table view and select all and copy/paste, but it is a bit cumbersome and for (large) images it is even more difficult.
The way I do it now is open a jupyter notebook and copy the Path from argos and open/save the data with h5py.

It would be great if there was a Export to... option in the right-click menu when clicking a dataset.

levels argument is required for float input types

Short description

fn.makeARGB() requires a levels argument why is not given. No backward compatibility.
In case of floats, if no levels argument is provided, the 'min,max' values should be determined automatically from the image.
In my case and image with integer values transitions to floats and raises the exception upon redrawing it.

Exception: levels argument is required for float input types
Traceback (most recent call last):
File "C:\XXX\lib\site-packages\pyqtgraph\graphicsItems\ImageItem.py", line 834, in paint
self.render()
File "C:\XXX\lib\site-packages\pyqtgraph\graphicsItems\ImageItem.py", line 561, in render
fn.makeARGB(image, lut=lut, levels=levels, output=self._processingBuffer)
File "C:\XXX\lib\site-packages\pyqtgraph\functions.py", line 1401, in makeARGB
raise Exception('levels argument is required for float input types')

Tested environment(s)

PyQtGraph version: 0.12.1 (works)
PyQtGraph version: 0.12.2 (fails)
Qt Python binding: PyQt5

Problems installing on Windows with Conda

I tried installing Argos on Windows using Conda thusly:

conda create -n ARGOS python=3 numpy scipy netcdf4 h5py pandas pillow
activate ARGOS
pip install pyqt5
pip install pyqtgraph
pip install argos

but running

python -m argos.main

returns

from PyQt5 import QtCore, QtGui, QtWidgets, QtSvg
ImportError: DLL load failed: The specified module could not be found.

@ocefpaf tells me this is a known problem with the defaults channel at Continuum.

Failed to disconnect signal when closing main window with PySide2

When using the PySide2 binding the following errror occurs when you close a/the main window.

Traceback (most recent call last):
  File "/Users/kenter/prog/py/argos/argos/widgets/mainwindow.py", line 826, in closeEvent
    self.finalize()
  File "/Users/kenter/prog/py/argos/argos/widgets/mainwindow.py", line 127, in finalize
    self.collector.sigContentsChanged.disconnect(self.collectorContentsChanged)
RuntimeError: Failed to disconnect signal sigContentsChanged(QString).

My suspicion is that it occurs because the disconnect is called in the closeEvent. More investigation is needed.

problems examining my HDF-5 file in argos

I am trying to install argos in order to examine some hdf5 files I am trying to make.
I am using a cloned version of 0.2.1 and have using my linux (openSuse) package manager to get all the dependencies.
I am running Python 3.4.5
The problem seems to be with h5py 2.6.0
I am able to open an hdf5 file and then when I go to examine tree (in the left panel), it crashes with the follow message: (sorry, it is longer but better to be complete)
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (/home/abuild/rpmbuild/BUILD/h5py-2.6.0/h5py/_objects.c:2841)
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/home/abuild/rpmbuild/BUILD/h5py-2.6.0/h5py/_objects.c:2799)
File "/usr/lib64/python3.4/site-packages/h5py/_hl/attrs.py", line 79, in getitem
attr.read(arr, mtype=htype)
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (/home/abuild/rpmbuild/BUILD/h5py-2.6.0/h5py/_objects.c:2841)
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/home/abuild/rpmbuild/BUILD/h5py-2.6.0/h5py/_objects.c:2799)
File "h5py/h5a.pyx", line 355, in h5py.h5a.AttrID.read (/home/abuild/rpmbuild/BUILD/h5py-2.6.0/h5py/h5a.c:5349)
File "h5py/_proxy.pyx", line 36, in h5py._proxy.attr_rw (/home/abuild/rpmbuild/BUILD/h5py-2.6.0/h5py/_proxy.c:1142)
OSError: Unable to read attribute (No appropriate function for conversion path)

Auto-select most appropriate axes for plots

It's quite common in netcdf files to have variables that are one or two dimensions, but are indexed over three or four dimensions. When plotting these variables, it often happens that Argos just selects the first dimension to plot over, which may only have one value, and so no plot is produced. You then need to manually select the mapping to each axis.

e.g. I have a single-site met file, that has rainfall indexed by (x, y, time), but it only has information in the time dimension.

It would be good if Argos aotomatically detected non-informative dimensions, and preferentially selected other dimensions by default for plotting. This would make the workflow slightly faster and less annoying for users, and would be significantly less confusing for new users (it took me a while to work out why it wasn't plotting...).

TypeError when trying to open image plot

I've got a file which displays under the table view fine, however when opening the image plot I get an error:

2022-07-26 13:56:37.178 :               abstract.py:230  : ERROR   : Error while drawing the inspector: Text reading control character must be a single unicode character or None; but got: ', ' ----
2022-07-26 13:56:37.178 :               abstract.py:231  : ERROR   : Text reading control character must be a single unicode character or None; but got: ', '
Traceback (most recent call last):
  File "/home/foo/.local/lib/python3.9/site-packages/argos/inspector/abstract.py", line 201, in updateContents
    self._drawContents(reason=reason, initiator=initiator)
  File "/home/foo/.local/lib/python3.9/site-packages/argos/inspector/pgplugins/imageplot2d.py", line 557, in _drawContents
    self.config.updateTarget()
  File "/home/foo/.local/lib/python3.9/site-packages/argos/config/abstractcti.py", line 288, in updateTarget
    child.updateTarget(level = level + 1)
  File "/home/foo/.local/lib/python3.9/site-packages/argos/config/abstractcti.py", line 288, in updateTarget
    child.updateTarget(level = level + 1)
  File "/home/foo/.local/lib/python3.9/site-packages/argos/config/abstractcti.py", line 286, in updateTarget
    self._updateTargetFromNode()
  File "/home/foo/.local/lib/python3.9/site-packages/argos/inspector/pgplugins/pgctis.py", line 972, in _updateTargetFromNode
    lut = self.data.rgb_uint8_array
  File "/home/foo/.local/lib/python3.9/site-packages/cmlib/cmap.py", line 346, in rgb_uint8_array
    self.load_rgba_uint8_array()
  File "/home/foo/.local/lib/python3.9/site-packages/cmlib/cmap.py", line 366, in load_rgba_uint8_array
    rgb_ints = self._read_rgb_uint8_file(file_name)
  File "/home/foo/.local/lib/python3.9/site-packages/cmlib/cmap.py", line 328, in _read_rgb_uint8_file
    rgb_floats = load_rgb_floats(file_name)
  File "/home/foo/.local/lib/python3.9/site-packages/cmlib/misc.py", line 87, in load_rgb_floats
    array = np.loadtxt(source_file, delimiter=delimiter, dtype=dtype, **kwargs)
  File "/home/foo/.local/lib/python3.9/site-packages/numpy/lib/npyio.py", line 1308, in loadtxt
    arr = _read(fname, dtype=dtype, comment=comment, delimiter=delimiter,
  File "/home/foo/.local/lib/python3.9/site-packages/numpy/lib/npyio.py", line 979, in _read
    arr = _load_from_filelike(
TypeError: Text reading control character must be a single unicode character or None; but got: ', '
2022-07-26 13:56:37.192 :                   misc.py:114  : CRITICAL: Bug: uncaught TypeError

Plot multiple variables at once

Sometimes it is nice to be able to view multiple variables at once.

It can be useful to compare multiple variables in the same way (e.g. small multiples), e.g. two or more timeseries of different variables, with linked zoom frames ("facetting"), or two or more panels of 2D image plots.

It can also be useful to plot one variable against another (e.g. scatter plot).

Would it take much to get such options into Argos?

argos does not show output when failing to start

Hi!

This looks very awesome! I just tried installing argos, and seemingly succeeded, but running argos just didn't show anything. I went deeper and found that apparently your main function fails due to some PyQt5 problem, but afaict I followed your instructions, and have no idea how to fix it.

Console output (Windows 10 64bit, and Anaconda)

Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. Alle Rechte vorbehalten.

Z:\>conda create -n tryargos python numpy
Fetching package metadata .........
Solving package specifications: ..........

Package plan for installation in environment C:\Continuum\Anaconda3\envs\tryargos:

The following NEW packages will be INSTALLED:

    mkl:            2017.0.1-0
    numpy:          1.11.3-py36_0
    pip:            9.0.1-py36_1
    python:         3.6.0-0
    setuptools:     27.2.0-py36_1
    vs2015_runtime: 14.0.25123-0
    wheel:          0.29.0-py36_0

Proceed ([y]/n)?

Linking packages ...
[      COMPLETE      ]|##################################################| 100%
#
# To activate this environment, use:
# > activate tryargos
#
# To deactivate this environment, use:
# > deactivate tryargos
#
# * for power-users using bash, you must source
#

Z:\>activate tryargos

(tryargos) Z:\>pip install PyQt5 pyqtgraph argos
Collecting PyQt5
  Using cached PyQt5-5.7.1-5.7.1-cp34.cp35.cp36-none-win_amd64.whl
Collecting pyqtgraph
Collecting argos
Collecting sip>=4.19 (from PyQt5)
  Using cached sip-4.19-cp36-none-win_amd64.whl
Requirement already satisfied: numpy in c:\continuum\anaconda3\envs\tryargos\lib\site-packages (from pyqtgraph)
Installing collected packages: sip, PyQt5, pyqtgraph, argos
Successfully installed PyQt5-5.7.1 argos-0.2.1 pyqtgraph-0.10.0 sip-4.19

(tryargos) Z:\>argos -h

(tryargos) Z:\>argos

(tryargos) Z:\>python -m argos.main
Traceback (most recent call last):
  File "C:\Continuum\Anaconda3\envs\tryargos\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Continuum\Anaconda3\envs\tryargos\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Continuum\Anaconda3\envs\tryargos\lib\site-packages\argos\main.py", line 200, in <module>
    main()
  File "C:\Continuum\Anaconda3\envs\tryargos\lib\site-packages\argos\main.py", line 186, in main
    from argos.qt.misc import ABOUT_QT_BINDINGS
  File "C:\Continuum\Anaconda3\envs\tryargos\lib\site-packages\argos\qt\__init__.py", line 23, in <module>
    from argos.qt.misc import Qt, QtCore, QtGui, QtWidgets, QtSvg, QtSignal, QtSlot
  File "C:\Continuum\Anaconda3\envs\tryargos\lib\site-packages\argos\qt\misc.py", line 83, in <module>
    from PyQt5 import QtCore, QtGui, QtWidgets, QtSvg
ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden.

(tryargos) Z:\>

(The german bit says "the specified module could not be found")

Any ideas what's wrong here? Also, I would have expected that argos does not silently swallow the encountered exception, and would at least log something I can see to even know that something went wrong.

More zoom/pan modes?

Currently there are these zoom/pan modes, that I can figure out:

  • LMB-drag: pan
  • MMB-drag: pan
  • Mousewheel: zoom
  • axis LMB-drag: pan single axis
  • axis MWL zom single axis.

It would be really nice to be able to use a few more of the pan and zoom modes available in PyQtGraph, specifically:

  • LMB-drag: change this to the drag-a-rectange-and-zoom-to-that mode (this mode is better for single-button users, more familiar for Matplotlib users, and the current functionality duplicated anyway)
  • RMB-drag: scale the scene on each axis independently
  • axis LMB-drag: if in the direction of the axis, normal behaviour, if in the perpendicular direction, then scale the axis instead. e.g. on the x axis, LMB click and dragging left and right will pan left and right as normal, dragging up will zoom in, and draggin down will zoom out. On the y axis, dragging right would zoom in (maintaining the "towards the plot is inwards" mapping), and left would zoom out. This behaviour is like the drag behaviour in Ableton, and is really quick and intuitive once you get used to it.

The first two of these are already available in PyQtGraph, the first one just needs to be turned on - I'm not sure why the second is not working. The third option probably needs new functionlity in PyQtGraph, but I though I'd post this here first and check.

This is some really nice software. I've been looking for something like this for ages :)
Both

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.