Skip to content

Plotting crashes when no photon in stream #65

@relleums

Description

@relleums

When there is no photon in the stream, the 3D point cloud plotting fails.

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-4-5a25295627ec> in <module>()
      1 for e in run:
----> 2     ps_plot.event(e)
      3     plt.show()
      4 

~/Desktop/phd/FACT/single_photons/photon_stream/photon_stream/plot.py in event(event, mask)
     17     fig = plt.figure()
     18     ax = fig.gca(projection='3d')
---> 19     add_event_2_ax(event=event, ax=ax, mask=mask)
     20 
     21 

~/Desktop/phd/FACT/single_photons/photon_stream/photon_stream/plot.py in add_event_2_ax(event, ax, mask, color)
     30         fov_radius=fov_radius,
     31         ax=ax,
---> 32         color=color
     33     )
     34 

~/Desktop/phd/FACT/single_photons/photon_stream/photon_stream/plot.py in add_point_cloud_2_ax(point_cloud, ax, fov_radius, color)
     52     pcl[:, 2] *= 1e9 # to nano seconds
     53 
---> 54     min_time = pcl[:, 2].min()
     55     max_time = pcl[:, 2].max()
     56 

~/anaconda3/lib/python3.5/site-packages/numpy/core/_methods.py in _amin(a, axis, out, keepdims)
     27 
     28 def _amin(a, axis=None, out=None, keepdims=False):
---> 29     return umr_minimum(a, axis, None, out, keepdims)
     30 
     31 def _sum(a, axis=None, dtype=None, out=None, keepdims=False):

ValueError: zero-size array to reduction operation minimum which has no identity

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions