SISPO-developers / sispo

Space Imaging Simulator for Proximity Operations (SISPO)
18 stars 4 forks source link

Compose empty star catalog and performance #225

Open thvaisa opened 3 years ago

thvaisa commented 3 years ago

I got this error while running sispo for comet_67_oneshot.json. I'll look into it

/app/sispo/sispo/sim/compositor.py:291: RuntimeWarning: invalid value encountered in double_scalars frame.stars[:, :, 0:3] *= starmap_flux.value / stars_sums[0] Exception in thread Thread-1: Traceback (most recent call last): File "/root/miniconda3/lib/python3.7/threading.py", line 926, in _bootstrap_inner self.run() File "/root/miniconda3/lib/python3.7/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/app/sispo/sispo/sim/compositor.py", line 328, in _compose composed_img = self.inst.sense(composed_img[:, :, 0:3]) File "/app/sispo/sispo/sim/sc.py", line 173, in sense img += np.random.poisson(img) File "mtrand.pyx", line 3569, in numpy.random.mtrand.RandomState.poisson File "_common.pyx", line 824, in numpy.random._common.disc File "_common.pyx", line 621, in numpy.random._common.discrete_broadcast_d File "_common.pyx", line 355, in numpy.random._common.check_array_constraint ValueError: lam value too large

thvaisa commented 3 years ago

Update, I finally downloaded star catalog for other purposes and this error is gone as expected. If there are no catalog present, rendering works fine until compose() happens and there will be empty space that causes multiple issues due to the division.

I think in order to lower the barrier of the use of the Sispo, empty star catalogs should be supported (Or at least allow people to use smaller star catalogs). The star rendering with huge catalog just increased the time use of the single frame by a factor of 10. I don't know whether this is a caused by the size of the catalog or just the star rendering algorithm, or something else related to what is happening in compose. Still really unpleasant performance hog.

Relevant to #226.

YgabrielsY commented 3 years ago

Also relates to #193 , one solution would also be to use e.g. the astroquery package (https://astroquery.readthedocs.io/en/latest/) to download star catalogue data