adamkraus / Comove

A python package for finding comoving neighbours to a target star and returning useful information regarding youth.
9 stars 5 forks source link

DoWISE=False crashes #4

Open awmann opened 2 years ago

awmann commented 2 years ago

Anytime you run without WISE it crashes:

Traceback (most recent call last):
  File "example.py", line 21, in <module>
    output_location = Comove.findfriends(targname,radvel,velocity_limit=vlim,search_radius=srad,radec=rd,output_directory=None,DoWISE=False,DoGALEX=False,verbose=False,showplots=False,DoROSAT=False)
  File "/Users/andrewmann/Comove/Comove.py", line 913, in findfriends
    if (spt[yy2[0]] > 5):
IndexError: index 0 is out of bounds for axis 0 with size 0

It looks like the code still tries to make the wise plot. Wrapping the whole section from print('Searching on neighbors in WISE') to plt.close('all') in a if DoWISE==true fixed the immediate issue but created some downstream effects (I think printing to the file). Replacing the wise arrays with np.nan and commenting out this area fixed it, but this is pretty inelegant and doesn't match the formatting or method of the rest of the code.