Repository: astropy/astroquery

Issue:
SvoFps.get_filter_index unit conversion issue?
```
wmin = 5000 * units.angstrom
wmax = 7000 * units.angstrom
index_a = svo.get_filter_index(wavelength_eff_min = wmin, \
                                                 wavelength_eff_max = wmax, timeout = 180)
```

returns 3026 filters, but changing the units to micron, as follows:

```
wmin = 0.5 * units.micron
wmax = 0.7 * units.micron
index_m = svo.get_filter_index(wavelength_eff_min = wmin, \
                                                 wavelength_eff_max = wmax, timeout = 180)
```

throws an IndexError:

```
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/astroquery/svo_fps/core.py", line 58, in data_from_svo
    return parse_single_table(votable).to_table()
  File "/usr/local/lib/python3.9/site-packages/astropy/io/votable/table.py", line 180, in parse_single_table
    return votable.get_first_table()

  File "/usr/local/lib/python3.9/site-packages/astropy/io/votable/tree.py", line 3719, in get_first_table
    raise IndexError("No table found in VOTABLE file.")
IndexError: No table found in VOTABLE file.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.9/site-packages/astroquery/svo_fps/core.py", line 87, in get_filter_index
    return self.data_from_svo(query=query, error_msg=error_msg, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/astroquery/svo_fps/core.py", line 61, in data_from_svo
    raise IndexError(error_msg)
IndexError: No filter found for requested Wavelength Effective range

```
`get_filter_index` should be able to internally convert the units to Angstrom if that's what causing this issue.

Discussion:

Patch:
diff --git a/CHANGES.rst b/CHANGES.rst
index e72116da..aa439514 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -62,6 +62,12 @@ oac
 - Fix bug in parsing events that contain html tags (e.g. in their alias
   field). [#2423]
 
+svo_fps
+^^^^^^^
+
+- The wavelength limits in ``get_filter_index()`` can now be specified using any
+  length unit, not just angstroms. [#2444]
+
 gaia
 ^^^^
 
diff --git a/astroquery/svo_fps/core.py b/astroquery/svo_fps/core.py
index ad157c43..2192e351 100644
--- a/astroquery/svo_fps/core.py
+++ b/astroquery/svo_fps/core.py
@@ -68,9 +68,9 @@ class SvoFpsClass(BaseQuery):
 
         Parameters
         ----------
-        wavelength_eff_min : `~astropy.units.Quantity` having units of angstrom, optional
+        wavelength_eff_min : `~astropy.units.Quantity` with units of length, optional
             Minimum value of Wavelength Effective (default is 0 angstrom)
-        wavelength_eff_max : `~astropy.units.Quantity` having units of angstrom, optional
+        wavelength_eff_max : `~astropy.units.Quantity` with units of length, optional
             Maximum value of Wavelength Effective (default is a very large
             quantity FLOAT_MAX angstroms i.e. maximum value of np.float64)
         kwargs : dict
@@ -81,8 +81,8 @@ class SvoFpsClass(BaseQuery):
         astropy.table.table.Table object
             Table containing data fetched from SVO (in response to query)
         """
-        query = {'WavelengthEff_min': wavelength_eff_min.value,
-                 'WavelengthEff_max': wavelength_eff_max.value}
+        query = {'WavelengthEff_min': wavelength_eff_min.to_value(u.angstrom),
+                 'WavelengthEff_max': wavelength_eff_max.to_value(u.angstrom)}
         error_msg = 'No filter found for requested Wavelength Effective range'
         return self.data_from_svo(query=query, error_msg=error_msg, **kwargs)
 


Test patch:
diff --git a/astroquery/svo_fps/tests/test_svo_fps.py b/astroquery/svo_fps/tests/test_svo_fps.py
index ed61171a..59b4bedf 100644
--- a/astroquery/svo_fps/tests/test_svo_fps.py
+++ b/astroquery/svo_fps/tests/test_svo_fps.py
@@ -46,9 +46,14 @@ def get_mockreturn(method, url, params=None, timeout=10, cache=None, **kwargs):
 
 
 def test_get_filter_index(patch_get):
-    table = SvoFps.get_filter_index(TEST_LAMBDA*u.angstrom, (TEST_LAMBDA+100)*u.angstrom)
+    lambda_min = TEST_LAMBDA*u.angstrom
+    lambda_max = lambda_min + 100*u.angstrom
+    table = SvoFps.get_filter_index(lambda_min, lambda_max)
     # Check if column for Filter ID (named 'filterID') exists in table
     assert 'filterID' in table.colnames
+    # Results should not depend on the unit of the wavelength: #2443. If they do then
+    # `get_mockreturn` raises `NotImplementedError`.
+    SvoFps.get_filter_index(lambda_min.to(u.m), lambda_max)
 
 
 def test_get_transmission_data(patch_get):
diff --git a/astroquery/svo_fps/tests/test_svo_fps_remote.py b/astroquery/svo_fps/tests/test_svo_fps_remote.py
index 41591b6e..e771a293 100644
--- a/astroquery/svo_fps/tests/test_svo_fps_remote.py
+++ b/astroquery/svo_fps/tests/test_svo_fps_remote.py
@@ -1,5 +1,6 @@
 import pytest
 import astropy.io.votable.exceptions
+from astropy import units as u
 
 from ..core import SvoFps
 
@@ -8,7 +9,7 @@ from ..core import SvoFps
 class TestSvoFpsClass:
 
     def test_get_filter_index(self):
-        table = SvoFps.get_filter_index()
+        table = SvoFps.get_filter_index(12_000*u.angstrom, 12_100*u.angstrom)
         # Check if column for Filter ID (named 'filterID') exists in table
         assert 'filterID' in table.colnames