1818
1919__all__ = ["VOResolver" ]
2020
21- VO_PROTOCOL = {"Images" : "sia" , "Spectra" : "ssa" }
21+ VO_PROTOCOL = {"Images" : {'protocol' : 'sia' , 'size_arg' : 'size' },
22+ "Spectra" : {'protocol' : 'ssa' , 'size_arg' : 'diameter' },
23+ "Catalogs" : {'protocol' : 'scs' , 'size_arg' : 'radius' }}
2224
2325
2426@loader_resolver_registry ("virtual observatory" )
2527class VOResolver (BaseConeSearchResolver ):
2628 template_file = __file__ , "vo.vue"
2729
2830 producttype_selected = Unicode ("Images" ).tag (sync = True )
29- producttype_choices = List (
30- [{"label" : "Images" }, {"label" : "Spectra" },]
31- ).tag (sync = True )
31+ producttype_choices = List (list ({"label" : type } for type in VO_PROTOCOL .keys ())).tag (sync = True )
3232
3333 waveband_items = List ().tag (sync = True )
3434 waveband_selected = Any ().tag (sync = True ) # Any to accept Nonetype
@@ -115,7 +115,7 @@ def query_registry_resources(self, event={}):
115115
116116 try :
117117 registry_args = [
118- registry .Servicetype (VO_PROTOCOL [self .producttype_selected ]),
118+ registry .Servicetype (VO_PROTOCOL [self .producttype_selected ][ 'protocol' ] ),
119119 registry .Waveband (self .waveband_selected ),
120120 ]
121121 # If coverage filtering is enabled, lookup current
@@ -191,7 +191,7 @@ def query_archive(self):
191191 # consider indexing on the full IVOID, which is guaranteed unique.
192192 vo_service = self ._full_registry_results [
193193 self .resource_selected
194- ].get_service (service_type = VO_PROTOCOL [self .producttype_selected ])
194+ ].get_service (service_type = VO_PROTOCOL [self .producttype_selected ][ 'protocol' ] )
195195 try :
196196 # First parse user-provided source as direct coordinates
197197 coord = SkyCoord (
@@ -217,13 +217,13 @@ def query_archive(self):
217217 vo_results = vo_service .search (
218218 coord ,
219219 ** {
220- "diameter" if self .producttype_selected == "Spectra" else "size" : (
220+ VO_PROTOCOL [ self .producttype_selected ][ 'size_arg' ] : (
221221 (self .radius * u .Unit (self .radius_unit .selected ))
222222 if self .radius > 0.0
223223 else None
224224 )
225225 },
226- format = " fits" ,
226+ format = ( "" if self . producttype_selected == "Catalogs" else " fits") ,
227227 )
228228 except DALQueryError as e :
229229 # We've run into issues where the service assumes a FORMAT and injects it for us.
0 commit comments