Coder Social home page Coder Social logo

xrviz's Introduction

XrViz

Anaconda-Server Badge PyPI version Build Status Documentation Status Gitter

XrViz is an interactive graphical user interface(GUI) for visually browsing Xarrays. You can view data arrays along various dimensions, examine data values, change color maps, extract series, display geographic data on maps and much more. It is built on Xarray, HvPlot and Panel. It can be used with Intake to ease the process of investigating and loading datasets.

Documentation is available at Read the Docs. Try it out on binder: Binder


Installation

Recommended method using conda:

conda install -c conda-forge xrviz

You can also install using pip:

pip install xrviz

Usage

You can view the example dashboard by running following in command line (this will open a tab in your browser):

python -c "import xrviz; xrviz.example()"

xrviz's People

Contributors

hdsingh avatar jsignell avatar martindurant avatar philippjfr avatar rsignell-usgs 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  avatar

xrviz's Issues

Add custom colormap and colorbar ticklabels

Hi,

I have two questions:

Is it possible to use custom colormaps in xrviz without changing too much of base code?

Here's my implementation of an animation using an xarray dataset:

import xarray as xr
from xrviz.dashboard import Dashboard

data = xr.open_mfdataset('./*.nc',parallel=True)


hid_colors = ['#D7CCC8', 'FFCCBC', 'FF8A65', 'BF360C', 'F44336',
              'FFEE58', '94D82D', '51CF66', '2B8A3E', '66D9E8',
              '228BE6', '364FC7', 'EEBEFA', 'F783AC', 'F8F9FA',
              'F8F9FA','F8F9FA','F8F9FA']


cmaphid_colors = [hex_to_rgb(color) for color in hid_colors]
cmaphid = [[t/255 for t in x] for x in cmaphid_colors]

cmapncarpid = colors.ListedColormap(cmaphid)
plt.register_cmap(name='ncarpid',cmap=cmapncarpid)

initial_params = {# Select Variable
                  'Variables': 'PID',

                  # Set Coords
                  'Set Coords': ['lat0', 'lon0'],

                  # Axes
                  'x': 'lon0',
                  'y': 'lat0',
                  'z': 'animate',

                  # Style
                  'height': 300,
                  'width': 650,
                  'colorbar': True,
                  'cmap': 'ncarpid'     
}

However, when I use the custom cmap ncarpid, it is not recognized by xrviz.

Also, is there a way to replace default colorbar ticklabels with strings of our choice?

Here's an example of the dashboard generated from code snippet above:

Screen Shot 2020-11-10 at 1 43 43 PM

Widgets to fix colormap limits

We need widgets to fix the colormap limits. This is useful for static maps, but is essential for animations, where you don't usually want the color limits changing from frame to frame.

Xrviz + ocean simulations : vertical section

Hello !

I am working with 4D ocean simulations outputs (dimension : lat/lon, level, time)

A useful 2D-plot could be a vertical section along a specific line. It needs to interpolate the data on the vertical (if sigma levels).
(And so, it will be also possible to have a real vertical profile (curve line) for a specific point, in case of sigma).

Another useful need could be to be able to load another datasets in order to create comparisons figures.
For example, in-situ data at a station could plot on the 1D-plot in order to compare it with simulated data, etc..

Well, I am thinking to start with xrviz and try to add such features... ;)

Thanks for any help !
Vincent

Volume Rendering for multi-dimensional datasets

For the project Web based volume rendering and 3D/4D visualization of Model Forecast (NM389-ISRO) of Indian Space Research Organisation and as a part of Smart India Hackathon 2020, I along with my team members tried to further extend the interface of XrViz to have capabilities for generating a 3D volumetic cube of the data points. Due to time limits of the hackathon, the created interface works perfect for this specific dataset, but may not be completely generalisable as of now. The aim of creating this issue is to suggest 3D volume rendering as a feature, to assist in even better exploration of the dataset. The extended code can be found in SIH-SuperUsers/xrviz.

Implementation Details:

  1. Adding a third dimension creates a challenge by increasing the data size tremendously as compared to a single 2D layer. We handled this by setting a skip interval for each of the dimension, since the data we need to visualize (the small cube) is very less as compared to actual volume. For example, skip_X = 30 means consider only every 30th point along the X-axis. These parmeters can be manually set by the user in the interface. This process of selecting and down sampling the volume has been done using numpy. Also before actually loading the data, it is important to select only that part of the data which is requried.

  2. Plotly has been used for volume rendering, which is already supported by Panel, hence making the process of adding cube in the interface very easy. I also tested the performance of K3D and Ipyvolume, and found those much slower as compared to Plotly. Also the cube generated by plotly looks much better visually.

  3. A basemap can also be added by providing the location of borders as geoJSON.

  4. Opacity and Surface count can be changed by the user to change the visual look of the cube.

The cube can be rotated, viewed along any dimension and the user can zoom in at any point on the surface or inside the volume.

Here are some images of the dashboard showing Temperature as it varies along along latitude and longitude for different pressure levels.

interface3d

Its corresponding 2D plot,
bokeh_plot

By asking about an efficient method for volume rendering in pyviz Gitter, I got to know about the issue Implement 3D Volume regridding (in progress) in datashader, which when combined with the VTKVolume pane in Panel will be more efficient (via @philippjfr).

The specific changes can be found in this commit.

This issue might be useful and act as reference for anyone who wants to futher develop this idea.

In case you want to run this dashboard, you may install this condaenv, since default installation of XrViz resulted in some issues for me due to update in dependencies and download the dataset.

consistent line spacing in GUI?

Is it possible to use the consistent line spacing for both regions 1 and 2 shown here?
2019-06-17_9-02-55

It might seem silly, but I think these style issues are important for the user experience.

Data disappears with `global_extents=true`

Reproducible code:

import xarray as xr
from xrviz.dashboard import Dashboard

# open remote data with xarray
url = 'http://opendap.co-ops.nos.noaa.gov/thredds/dodsC/NOAA/LOOFS/MODELS/201907/glofs.loofs.fields.forecast.20190720.t06z.nc'
data = xr.open_dataset(url)

initial_params = {# Select Variable
                  'Variables': 'temp',

                  # Set Coords
                  'Set Coords': ['lat', 'lon'],

                  # Axes
                  'x': 'lon',
                  'y': 'lat',
                  'sigma': 'animate',
                  'extract along':'time',

                  # Style
                  'height': 300,
                  'width': 650,
                  'colorbar': True,
                  'cmap': 'Viridis',

                  # Projection
                  'is_geo': True,
                  'basemap': 'OSM',
                  'crs': 'PlateCarree',
                  'projection': 'Orthographic',
                  'crs params': "{'central_longitude': 0.0}",
                  'projection params': "{'central_longitude': -78, 'central_latitude': 43, 'globe': {'ellipse':'sphere'}}"
                  }
dash = Dashboard(data, initial_params=initial_params)
dash.panel

Install sample data following pyviz approach?

I tried to run an example and it failed to find the example data:

----> 3 from xrviz.dashboard import Dashboard
      4 

/opt/conda/lib/python3.6/site-packages/xrviz/__init__.py in <module>()
----> 1 from . import sample_data
      2 
      3 from ._version import get_versions
      4 __version__ = get_versions()['version']
      5 del get_versions

/opt/conda/lib/python3.6/site-packages/xrviz/sample_data/__init__.py in <module>()
      5         os.path.abspath(
      6             os.path.join(
----> 7                 os.path.dirname(__file__)+'/great_lakes.nc')))

Can we use the pyviz approach to load the example data, something like running xrviz examples?

Return to dropdown selection selection of variables

I think the "start typing w/ autocomplete" is cool, but I think it's more intuitive (and even easier) to pick a variable from a drop down list, as we had before. A new user (including me a few minutes ago) wouldn't know what to do when encountering this:
2019-11-22_7-22-34

Web visualization

Hello,

I'm interested in web-based visualization of netCDF data. Are there plans for xrviz to connect with a web front-end, both for locally-hosted netCDF files, or via OPeNDaP for remotely-hosted files? In any case, if you have not considered such applications of the tech, I encourage you to think about it, and will be happy to provide a use case or two!

Beyond visualization, I'd also like to facilitate export of the subset of data being plotted (either as netCDF, or a simpler format (say, csv) for 1D arrays. Do you know of any package that does that? If not, what would be technical hurdles to consider?

Julien

Top level callable

I recommend that there should be something in the top-level __init__ which is the main entry-point for users, e.g.,

from .dashboard import Dashboard as XRViz

so that we can recommend the normal usage as

import xrviz
xrviz.XRViz(data, ...).show()

quantile doesn't work for dask-powered xarrays

The code currently uses quantiles to set the colour-map limits, unless explicitly given by the user. If the data has dask-arrays internally, however, then you just get an error. I suppose we should explicitly .compute() the first slice in this case, before attempting the quantile, and calculate min/max when doing the whole data-set.

CI failing

The CI is running on Travis and the environment is not resolving correctly. This should be addressed, and this would be a convenient time to switch to github-actions, as other dask and intake projects have done.

TextInput None Error

Hello,

I'm trying to use xrviz with a multi-file Xarray dataset containing netcdf data. Originally, the data looks like this:
Screen Shot 2021-04-20 at 6 07 31 PM

I have various data variables, defined in Lon/lat/time (and sometimes vertical level). The output unfortunately has rather bad time-stamping. For example, the date 3700-01-31 is stored as a float 37000131.75 so I have a small function to clean that up. Note that these are hypothetical dates, and could just as easily just count months upward from an arbitrary year 1:

import cftime
from intake_xarray.netcdf import NetCDFSource
import xarray

class Echam5MainMM(NetCDFSource):
    name = "echam5-main-mm"
    version = "0.1.0"
    partition_access = True
  
    #TODO(PG)
    # def load
    # def fixup

    def _preprocess_ds(self, ds_in):
        ts_in_arr = list(ds_in.coords["time"].data)
        ts_in = ds_in.coords["time"]
        for idx, ts_in in enumerate(ts_in):
            ts_out = self._echam_timestamp_to_cftime(ts_in)
            ts_in_arr[idx] = ts_out
        ds_out = ds_in.assign_coords({"time": ts_in_arr})
        ds_out.time.attrs.update(ds_in.time.attrs)
        return ds_out
        
    @staticmethod
    def _echam_timestamp_to_cftime(ts_in):
        if not isinstance(ts_in, xarray.core.dataarray.DataArray):
            raise TypeError("Please pass timesteps in after being loaded into xarray")
        assert hasattr(ts_in, "units")
        ts_in = str(ts_in.data).split(".")[0]
        year = ts_in[:4]
        month = ts_in[4:6]
        day = ts_in[6:9]
        ts_out = cftime.datetime(int(year), int(month), int(day))
        return ts_out

My eventual goal is to build an intake driver, and I'm learning more about how that works. The first step would be to have the dates automatically cleaned up. I haven't hooked up the intake driver yet and am still running the preprocess method by hand (if there are any hints how to do that, I'd be very grateful!)

So, I have something like:

>>> data_source = Echam5MainMM("example-data/conpi_echam5_main_mm_*.nc")
>>> xrds = data_source.read_chunked()
>>> xrds_out = conpi_echam5_main._preprocess_ds(xrds)
>>> import xrviz
>>> db = xrviz.dashboard.Dashboard(xrds_out)
>>> db.show()

I noticed that the read_chunked takes a while, even though it should just be loaded in the metadata rather than the actual arrays. If there are any ideas how to speed that up, I'd be interested.

The xrviz dashboard loads up and shows me a list of variables, which seems correct.

image

However, the plot button is greyed out, and I can find the following error in the console:

Found valid latitude/longitude coordinates, assuming latitude_longitude for projection grid_mapping variable
tornado.application - ERROR - Exception in callback functools.partial(<bound method IOLoop._discard_future_result of <tornado.platform.asyncio.AsyncIOMainLoop object at 0x10af69b20>>, <Task finished name='Task-88' coro=<_needs_document_lock.<locals>._needs_document_lock_wrapper() done, defined at /Users/pgierz/anaconda3/envs/paleodyn-database-viewer/lib/python3.9/site-packages/bokeh/server/session.py:51> exception=ValueError("failed to validate TextInput(id='1170', ...).value: expected a value of type str, got None of type NoneType")>)
Traceback (most recent call last):
  File "/Users/pgierz/anaconda3/envs/paleodyn-database-viewer/lib/python3.9/site-packages/tornado/ioloop.py", line 741, in _run_callback
    ret = callback()
  File "/Users/pgierz/anaconda3/envs/paleodyn-database-viewer/lib/python3.9/site-packages/tornado/ioloop.py", line 765, in _discard_future_result
    future.result()
  File "/Users/pgierz/anaconda3/envs/paleodyn-database-viewer/lib/python3.9/site-packages/bokeh/server/session.py", line 71, in _needs_document_lock_wrapper
    result = await result
  File "/Users/pgierz/anaconda3/envs/paleodyn-database-viewer/lib/python3.9/site-packages/tornado/gen.py", line 216, in wrapper
    result = ctx_run(func, *args, **kwargs)
  File "/Users/pgierz/anaconda3/envs/paleodyn-database-viewer/lib/python3.9/site-packages/panel/reactive.py", line 252, in _change_coroutine
    self._change_event(doc)
  File "/Users/pgierz/anaconda3/envs/paleodyn-database-viewer/lib/python3.9/site-packages/panel/reactive.py", line 262, in _change_event
    self._process_events(events)
  File "/Users/pgierz/anaconda3/envs/paleodyn-database-viewer/lib/python3.9/site-packages/panel/reactive.py", line 245, in _process_events
    self.param.set_param(**self._process_property_change(events))
  File "/Users/pgierz/anaconda3/envs/paleodyn-database-viewer/lib/python3.9/site-packages/param/parameterized.py", line 1472, in set_param
    self_._batch_call_watchers()
  File "/Users/pgierz/anaconda3/envs/paleodyn-database-viewer/lib/python3.9/site-packages/param/parameterized.py", line 1611, in _batch_call_watchers
    self_._execute_watcher(watcher, events)
  File "/Users/pgierz/anaconda3/envs/paleodyn-database-viewer/lib/python3.9/site-packages/param/parameterized.py", line 1573, in _execute_watcher
    watcher.fn(*args, **kwargs)
  File "/Users/pgierz/anaconda3/envs/paleodyn-database-viewer/lib/python3.9/site-packages/xrviz/sigslot.py", line 76, in _signal
    self._emit(self._map[wn], event.new)
  File "/Users/pgierz/anaconda3/envs/paleodyn-database-viewer/lib/python3.9/site-packages/xrviz/sigslot.py", line 95, in _emit
    if callback(value) is False:
  File "/Users/pgierz/anaconda3/envs/paleodyn-database-viewer/lib/python3.9/site-packages/xrviz/style.py", line 95, in setup
    self.lower_limit.value = None
  File "/Users/pgierz/anaconda3/envs/paleodyn-database-viewer/lib/python3.9/site-packages/param/parameterized.py", line 318, in _f
    return f(self, obj, val)
  File "/Users/pgierz/anaconda3/envs/paleodyn-database-viewer/lib/python3.9/site-packages/param/parameterized.py", line 936, in __set__
    obj.param._call_watcher(watcher, event)
  File "/Users/pgierz/anaconda3/envs/paleodyn-database-viewer/lib/python3.9/site-packages/param/parameterized.py", line 1591, in _call_watcher
    self_._execute_watcher(watcher, (event,))
  File "/Users/pgierz/anaconda3/envs/paleodyn-database-viewer/lib/python3.9/site-packages/param/parameterized.py", line 1573, in _execute_watcher
    watcher.fn(*args, **kwargs)
  File "/Users/pgierz/anaconda3/envs/paleodyn-database-viewer/lib/python3.9/site-packages/panel/reactive.py", line 238, in _param_change
    self._apply_update(events, msg, model, ref)
  File "/Users/pgierz/anaconda3/envs/paleodyn-database-viewer/lib/python3.9/site-packages/panel/reactive.py", line 192, in _apply_update
    self._update_model(events, msg, root, model, doc, comm)
  File "/Users/pgierz/anaconda3/envs/paleodyn-database-viewer/lib/python3.9/site-packages/panel/reactive.py", line 205, in _update_model
    model.update(**msg)
  File "/Users/pgierz/anaconda3/envs/paleodyn-database-viewer/lib/python3.9/site-packages/bokeh/core/has_props.py", line 441, in update
    setattr(self, k, v)
  File "/Users/pgierz/anaconda3/envs/paleodyn-database-viewer/lib/python3.9/site-packages/bokeh/core/has_props.py", line 298, in __setattr__
    super().__setattr__(name, value)
  File "/Users/pgierz/anaconda3/envs/paleodyn-database-viewer/lib/python3.9/site-packages/bokeh/core/property/descriptors.py", line 552, in __set__
    self._internal_set(obj, value, setter=setter)
  File "/Users/pgierz/anaconda3/envs/paleodyn-database-viewer/lib/python3.9/site-packages/bokeh/core/property/descriptors.py", line 784, in _internal_set
    value = self.property.prepare_value(obj, self.name, value)
  File "/Users/pgierz/anaconda3/envs/paleodyn-database-viewer/lib/python3.9/site-packages/bokeh/core/property/bases.py", line 350, in prepare_value
    raise ValueError(f"failed to validate {obj_repr}.{name}: {error}")
ValueError: failed to validate TextInput(id='1170', ...).value: expected a value of type str, got None of type NoneType

Also, the online documentation seems to have options for setting up the projection. I can't find those.

Any hints would be great! Thanks!
Paul

Incorrect time series plot when `extract along` passed in `initial_params`

Time series extraction works fine, however upon specifying the extract along parameter in initial_params it produces constant straight line graph.

For temporary basis, this problem could be solved by de-selecting and re-selecting the extract along dimension, but it would be good to have a permanent solution.

Screenshot from 2019-11-27 07-38-20

Reproducible code:

import xarray as xr
from xrviz.dashboard import Dashboard

# open remote data with xarray
url = 'http://opendap.co-ops.nos.noaa.gov/thredds/dodsC/NOAA/LOOFS/MODELS/201907/glofs.loofs.fields.forecast.20190720.t06z.nc'
data = xr.open_dataset(url)

initial_params = {# Select Variable
                  'Variables': 'temp',

                  # Set Coords
                  'Set Coords': ['lat', 'lon'],

                  # Axes
                  'x': 'lon',
                  'y': 'lat',
                  'sigma': 'animate',
                  'extract along':'time',

                  # Style
                  'height': 300,
                  'width': 650,
                  'colorbar': True,
                  'cmap': 'Viridis',

                  # Projection
                  'is_geo': True,
                  'basemap': 'OSM',
                  'crs': 'PlateCarree',
                  'projection': 'Orthographic',
                  'crs params': "{'central_longitude': 0.0}",
                  'projection params': "{'central_longitude': -78, 'central_latitude': 43, 'globe': {'ellipse':'sphere'}}"
                  }
dash = Dashboard(data, initial_params=initial_params)
dash.panel

This might be due to improper sequence of initialisation of relevant events (not so sure).

Colormap not found if installed from pip

I just tried out the example in xrviz following your Medium blog post. Not a conda user, so installed from pip. If I try to plot a variable, I hit a ValueError due to missing colormap, see full traceback:

ERROR:tornado.application:Exception in callback functools.partial(<bound method IOLoop._discard_future_result of <tornado.platform.asyncio.AsyncIOMainLoop object at 0x7f08a3475390>>, <Future finished exception=ValueError('Supplied cmap fire not found among matplotlib, bokeh, or colorcet colormaps.',)>)
Traceback (most recent call last):
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/tornado/ioloop.py", line 743, in _run_callback
    ret = callback()
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/tornado/ioloop.py", line 767, in _discard_future_result
    future.result()
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/tornado/gen.py", line 748, in run
    yielded = self.gen.send(value)
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/bokeh/server/session.py", line 70, in _needs_document_lock_wrapper
    result = yield yield_for_all_futures(func(self, *args, **kwargs))
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/bokeh/server/session.py", line 191, in with_document_locked
    return func(*args, **kwargs)
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/bokeh/document/document.py", line 1127, in wrapper
    return doc._with_self_as_curdoc(invoke)
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/bokeh/document/document.py", line 1113, in _with_self_as_curdoc
    return f()
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/bokeh/document/document.py", line 1126, in invoke
    return f(*args, **kwargs)
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/bokeh/document/document.py", line 916, in remove_then_invoke
    return callback(*args, **kwargs)
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/panel/viewable.py", line 653, in _change_event
    self.set_param(**self._process_property_change(events))
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/param/parameterized.py", line 1219, in inner
    return fn(*args, **kwargs)
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/param/parameterized.py", line 2572, in set_param
    return self_or_cls.param.set_param(*args,**kwargs)
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/param/parameterized.py", line 1365, in set_param
    self_._batch_call_watchers()
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/param/parameterized.py", line 1480, in _batch_call_watchers
    watcher.fn(*events)
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/xrviz/sigslot.py", line 54, in _signal
    self._emit(self._map[wn], event.new)
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/xrviz/sigslot.py", line 63, in _emit
    if callback(value) is False:
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/xrviz/dashboard.py", line 105, in create_plot
    self.create_indexed_graph()
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/xrviz/dashboard.py", line 144, in create_indexed_graph
    self.output[0] = graph
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/panel/layout.py", line 219, in __setitem__
    self.objects = new_objects
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/param/parameterized.py", line 296, in _f
    return f(self, obj, val)
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/param/parameterized.py", line 861, in __set__
    obj.param._call_watcher(watcher, event)
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/param/parameterized.py", line 1454, in _call_watcher
    watcher.fn(self_._update_event_type(watcher, event, self_.self_or_cls.param._TRIGGER))
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/panel/viewable.py", line 604, in param_change
    self._update_model(events, msg, root, model, doc, comm)
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/panel/layout.py", line 63, in _update_model
    msg[self._rename['objects']] = self._get_objects(model, old, doc, root, comm)
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/panel/layout.py", line 94, in _get_objects
    child = pane._get_model(doc, root, model, comm)
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/panel/pane/holoviews.py", line 125, in _get_model
    plot = self._render(doc, comm, root)
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/panel/pane/holoviews.py", line 150, in _render
    return renderer.get_plot(self.object, **kwargs)
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/holoviews/plotting/bokeh/renderer.py", line 135, in get_plot
    plot = super(BokehRenderer, self_or_cls).get_plot(obj, renderer, **kwargs)
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/holoviews/plotting/renderer.py", line 207, in get_plot
    plot.update(init_key)
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/holoviews/plotting/plot.py", line 595, in update
    return self.initialize_plot()
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/holoviews/plotting/bokeh/element.py", line 1259, in initialize_plot
    self._init_glyphs(plot, element, ranges, source)
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/holoviews/plotting/bokeh/element.py", line 1206, in _init_glyphs
    data, mapping, style = self.get_data(element, ranges, style)
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/holoviews/plotting/bokeh/raster.py", line 207, in get_data
    cmapper = self._get_colormapper(z, element, ranges, style)
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/holoviews/plotting/bokeh/element.py", line 1674, in _get_colormapper
    palette = process_cmap(cmap, ncolors, categorical=categorical)
  File "/home/milan/Work/xrviz/venv/lib/python3.6/site-packages/holoviews/plotting/util.py", line 894, in process_cmap
    (cmap,providers_checked))
ValueError: Supplied cmap fire not found among matplotlib, bokeh, or colorcet colormaps.

Adding matplotlib to requirements.txt fixes this. Let me know if you'd like a PR.

Make a short video demonstrating the interface

It would be good to have a short, 10 minute video demonstration of the interface. The video can be uploaded on Youtube and linked in documentation. It will help the newcomers in familiarising quickly with the interface.

CLI doesn't work in Windows when installed with `conda`

Invoking xrviz gives this:

#!/bin/sh
'''exec' C:/Users/zmoon/.conda/envs/xrviz/bin/python "$0" "$@"
' '''
# -*- coding: utf-8 -*-
import re
import sys
from xrviz.cli import main
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

I installed from conda-forge.

With a pip install it is fine (xrviz is a .exe).

Display calendar dates in hover

Currently the hover tool on the series plots is showing linux time (or something) rather than calendar (gregorian) dates:
2019-11-22_7-18-03
I can see from the image in the readme.md that this used to work!

Don't load sample data by default

I don't think the sample data should be imported when the package or dashboard is imported. Loading the sample data should be a separate action.

----> 3 from xrviz.dashboard import Dashboard

/opt/conda/lib/python3.6/site-packages/xrviz/__init__.py in <module>()
----> 1 from . import sample_data

New release for AGU?

@hdsingh or @martindurant , could we get a new release before AGU next week? Annie Burgess from ESIP will be including xrviz in her talk and it would be nice to have the latest functionality from master (which we are already using in the binder demo). And there probably won't be much more development for a while now that @jsignell has moved to SaturnCloud. ๐Ÿ˜ข

1D variable support

In processing a file with a mix of 1D and 2D data, it seems I cannot get it to plot a line plot for the 1D data. I did see that line plots were supported for some types after aggregation. It's quite possible I am doing something wrong so generally the workflow I tried was:

  1. Picking just time as a coord, and also letting it set the two coords (time and bin in my case).
  2. On second tab when I select a 2D variable, it plots. When selecting a 1D variable, the plot button becomes grayed out.

On the axes tab it correctly sets just one axes to time.

I understand it is early in development so I just wanted to clarify if this was me doing something wrong, a bug, or just features that have not yet been developed.

Thanks, I think this will be a great tool and people here are already excited about it.

metpy warning

@rsignell-usgs , any idea what the following warning means? Seen when looking at the great-lakes data

/Users/mdurant/anaconda/envs/py37/lib/python3.7/site-packages/metpy/xarray.py:276: MetpyDeprecationWarning: Multidimensional coordinate lon assigned for axis "x". This behavior has been deprecated and will be removed in v1.0 (only one-dimensional coordinates will be available for the "x" axis).
  f'be available for the "{axis}" axis).', metpyDeprecation)

Is mapping no longer done??

Smooth animation via caching?

The animation capability is great. It would also be even greater if we could cache the frames for smoother animation after the 1st time through. I realize this might not be a xrviz issue per se, but could you please look into it @hdsingh ?

I know that with Matplotlib animation, you can set cache_frame_data=True, but not sure to accomplish this with panel.

Problem with dask arrays using jupyterlab

First of all thanks a lot for this great tool! I can see this becoming a standard tool for quick exploratoin of nc file based data for me in the future.

I am working with very large ocean model files and would like to do initial quality control using xrviz.
I am however not able to produce plots when my xarray data is in a dask.array (which is absolutely essential since my files can be several TB large, prohibiting me from loading them into memory).

I am currently using xrviz in jupyterlab on a remote cluster.

Trying this example does not plot anything:

import xarray as xr
from xrviz.dashboard import Dashboard

ds = xr.tutorial.open_dataset('air_temperature',
                              chunks={'lat': 25, 'lon': 25, 'time': -1})
dash = Dashboard(ds)
dash.panel

if I add .load() (loading the data into memory)

ds = xr.tutorial.open_dataset('air_temperature',
                              chunks={'lat': 25, 'lon': 25, 'time': -1}).load()

I get the expected behaviour.

I am not sure how I could further diagnose what is going wrong. Is there something about dash.panel that would differ from panel.show in this regard?

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.