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?