Does fido.search still support the "and" and "or" operations?

Following the example in Sunpy (link), I created this search query:

Here is my code

attrs_time = a.Time('2015/01/01 00:00', '2015/01/01 00:59')
search_mh = a.Instrument.maunaloa & a.Physobs.intensity
search_bh = a.Instrument.bigbear & a.Physobs.intensity

result = Fido.search(attrs_time, search_mh | search_bh, a.Sample(10*u.minute))

But it seems that when there is 0 result for one of the search queries, the OR operation throws an error. In the above case, search_bh finds no results and as a result I get this error (python 3.8):


TypeError                                 Traceback (most recent call last)
Input In [53], in <cell line: 10>()
      7 search_lh = a.Instrument.learmonth & a.Physobs.intensity
      9 # result = Fido.search(attrs_time, search_mh)
---> 10 result = Fido.search(attrs_time, search_mh | search_bh, a.Sample(10*u.minute))

File ~/CODES/PyCode/mleco-datacollection/venv/lib/python3.8/site-packages/sunpy/net/fido_factory.py:322, in UnifiedDownloaderFactory.search(self, *query)
    320     for vres in vso_results:
    321         if len(vres) == 0:
--> 322             results.remove(vres)
    324 return UnifiedResponse(*results)

File ~/CODES/PyCode/mleco-datacollection/venv/lib/python3.8/site-packages/astropy/table/table.py:3426, in Table.__eq__(self, other)
   3425 def __eq__(self, other):
-> 3426     return self._rows_equal(other)

File ~/CODES/PyCode/mleco-datacollection/venv/lib/python3.8/site-packages/astropy/table/table.py:3474, in Table._rows_equal(self, other)
   3472         result = (self.as_array() == other.data) & (other.mask == false_mask)
   3473     else:
-> 3474         result = self.as_array() == other
   3476 return result

TypeError: Cannot compare structured or void to non-void arrays.

The documentation does not specify anything that can help.
Can anyone please suggest a work around or tell me what the correct implementation would look like?

1 Like

You have run into this bug: Error removing Fido results in gallery examples · Issue #6300 · sunpy/sunpy · GitHub

The quickest solution would be to downgrade your numpy version until there is a released fix (either in sunpy or astropy).

2 Likes

This should now be fixed in the latest version of sunpy 4.0.3

If you can update and see if that resolves that error, I would be much appericated.