ratt-ru / shadeMS

Rapid Measurement Set plotting with dask-ms and datashader
21 stars 6 forks source link

can't color by FREQ or CHAN #68

Open o-smirnov opened 4 years ago

o-smirnov commented 4 years ago

Trying to colour by frequency:

$ shadems msdir/4C12.03-610-cal.ms --field 0054-035 --col CORRECTED_DATA -x real -y imag -c FREQ --cnum 64 --dir plots/
2020-07-16 15:11:57 - shadems - INFO - : aggregating using 64 bins at dask.array<add, shape=(), dtype=float64, chunksize=(), chunktype=numpy.ndarray> dask.array<add, shape=(), dtype=float64, chunksize=(), chunktype=numpy.ndarray> dask.array<add, shape=(), dtype=float64, chunksize=(), chunktype=numpy.ndarray> dask.array<add, shape=(), dtype=float64, chunksize=(), chunktype=numpy.ndarray> dask.array<add, shape=(), dtype=float64, chunksize=(), chunktype=numpy.ndarray> dask.array<add, shape=(), dtype=float64, chunksize=(), chunktype=numpy.ndarray> dask.array<add, shape=(), dtype=float64, chunksize=(), chunktype=numpy.ndarray> dask.array<add, shape=(), dtype=float64, chunksize=(), chunktype=numpy.ndarray> ...
Traceback (most recent call last):
  File "/home/oms/.venv/sms/bin/shadems", line 7, in <module>
    exec(compile(f.read(), __file__, 'exec'))
  File "/home/oms/projects/shadeMS/bin/shadems", line 8, in <module>
    main.main([a for a in sys.argv[1:]])
  File "/home/oms/projects/shadeMS/shade_ms/main.py", line 743, in main
    render_single_plot(df, subset, xdatum, ydatum, adatum, ared, cdatum, pngname, title, xlabel, ylabel)
  File "/home/oms/projects/shadeMS/shade_ms/main.py", line 692, in render_single_plot
    options=options)
  File "/home/oms/projects/shadeMS/shade_ms/data_plots.py", line 393, in create_plot
    raster = canvas.points(ddf, xaxis, yaxis, agg=datashader.by(category, agg_by))
  File "/home/oms/projects/datashader/datashader/core.py", line 224, in points
    return bypixel(source, self, glyph, agg)
  File "/home/oms/projects/datashader/datashader/core.py", line 1192, in bypixel
    return bypixel.pipeline(source, schema, canvas, glyph, agg)
  File "/home/oms/projects/datashader/datashader/utils.py", line 103, in __call__
    return lk[typ](head, *rest, **kwargs)
  File "/home/oms/projects/datashader/datashader/data_libraries/dask.py", line 29, in dask_pipeline
    return da.compute(dsk, scheduler=scheduler)[0]
  File "/home/oms/.venv/sms/lib/python3.6/site-packages/dask/base.py", line 437, in compute
    results = schedule(dsk, keys, **kwargs)
  File "/home/oms/.venv/sms/lib/python3.6/site-packages/dask/threaded.py", line 84, in get
    **kwargs
  File "/home/oms/.venv/sms/lib/python3.6/site-packages/dask/local.py", line 486, in get_async
    raise_exception(exc, tb)
  File "/home/oms/.venv/sms/lib/python3.6/site-packages/dask/local.py", line 316, in reraise
    raise exc
  File "/home/oms/.venv/sms/lib/python3.6/site-packages/dask/local.py", line 222, in execute_task
    result = _execute_task(task, data)
  File "/home/oms/.venv/sms/lib/python3.6/site-packages/dask/core.py", line 121, in _execute_task
    return func(*(_execute_task(a, cache) for a in args))
  File "/home/oms/.venv/sms/lib/python3.6/site-packages/dask/optimization.py", line 982, in __call__
    return core.get(self.dsk, self.outkey, dict(zip(self.inkeys, args)))
  File "/home/oms/.venv/sms/lib/python3.6/site-packages/dask/core.py", line 151, in get
    result = _execute_task(task, cache)
  File "/home/oms/.venv/sms/lib/python3.6/site-packages/dask/core.py", line 121, in _execute_task
    return func(*(_execute_task(a, cache) for a in args))
  File "/home/oms/.venv/sms/lib/python3.6/site-packages/dask/utils.py", line 30, in apply
    return func(*args, **kwargs)
  File "/home/oms/projects/datashader/datashader/data_libraries/dask.py", line 112, in chunk
    extend(aggs, df, st, bounds)
  File "/home/oms/projects/datashader/datashader/glyphs/points.py", line 181, in extend
    aggs_and_cols = aggs + info(df)
  File "/home/oms/projects/datashader/datashader/compiler.py", line 98, in <lambda>
    return lambda df: tuple(c.apply(df) for c in cols)
  File "/home/oms/projects/datashader/datashader/compiler.py", line 98, in <genexpr>
    return lambda df: tuple(c.apply(df) for c in cols)
  File "/home/oms/projects/datashader/datashader/reductions.py", line 150, in apply
    index[np.isnan(value)] = self.nbins
  File "/home/oms/.venv/sms/lib/python3.6/site-packages/dask/array/core.py", line 1503, in __setitem__
    "Item assignment with %s not supported" % type(key)
NotImplementedError: Item assignment with <class 'numpy.ndarray'> not supported
$

Trying to colour by channel:

$ shadems msdir/4C12.03-610-cal.ms --field 0054-035 --col CORRECTED_DATA -x real -y imag -c CHAN --cmin 0 --cmax 6144 --cnum 16 --dir plots/
$
Traceback (most recent call last):
  File "/home/oms/.venv/sms/bin/shadems", line 7, in <module>
    exec(compile(f.read(), __file__, 'exec'))
  File "/home/oms/projects/shadeMS/bin/shadems", line 8, in <module>
    main.main([a for a in sys.argv[1:]])
  File "/home/oms/projects/shadeMS/shade_ms/main.py", line 743, in main
    render_single_plot(df, subset, xdatum, ydatum, adatum, ared, cdatum, pngname, title, xlabel, ylabel)
  File "/home/oms/projects/shadeMS/shade_ms/main.py", line 692, in render_single_plot
    options=options)
  File "/home/oms/projects/shadeMS/shade_ms/data_plots.py", line 344, in create_plot
    active_subset = OrderedDict(enumerate(map(str, range(bounds[caxis][1]+1))))
TypeError: 'float' object cannot be interpreted as an integer