Skip to content

Commit

Permalink
stash
Browse files Browse the repository at this point in the history
  • Loading branch information
duytnguyendtn committed Sep 10, 2024
1 parent ea2562e commit a7bfc29
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ class VoPlugin(PluginTemplateMixin, AddResultsMixin, TableMixin):
source = Unicode("").tag(sync=True)
coordframes = List([]).tag(sync=True)
coordframe_selected = Unicode("icrs").tag(sync=True)
radius_deg = Float(1).tag(sync=True)
radius_val = Float(1).tag(sync=True)
radius_unit = Unicode("deg").tag(sync=True)

results_loading = Bool(False).tag(sync=True)
data_loading = Bool(False).tag(sync=True)
Expand Down Expand Up @@ -185,7 +186,7 @@ def vue_query_registry_resources(self, _=None):
f"Unable to resolve source coordinates: {self.source}"
)
registry_args.append(
registry.Spatial(coord, self.radius_deg, intersect="overlaps")
registry.Spatial((coord, (self.radius_val * u.Unit(self.radius_unit)).to(u.deg).value), intersect="overlaps")
)
self._full_registry_results = registry.search(*registry_args)
self.resources = list(self._full_registry_results.getcolumn("short_name"))
Expand Down Expand Up @@ -251,7 +252,7 @@ def vue_query_resource(self, _=None):
# Once coordinate lookup is complete, search service using these coords.
sia_results = sia_service.search(
coord,
size=((self.radius_deg * u.deg) if self.radius_deg > 0.0 else None),
size=((self.radius_val * u.Unit(self.radius_unit)) if self.radius_val > 0.0 else None),
format="image/fits",
)
if len(sia_results) == 0:
Expand Down
29 changes: 21 additions & 8 deletions jdaviz/configs/default/plugins/virtual_observatory/vo_plugin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,30 @@

<j-plugin-section-header>Common Options</j-plugin-section-header>

<v-row>
<v-text-field
v-model.number="radius_deg"
type="number"
label="Radius"
hint="Angular radius, in degrees, around source coordinates, within which to query for data (Default 1 degree)"
persistent-hint>
</v-text-field>

<v-row justify="space-between">
<div :style="{ width: '55%' }">
<v-text-field
v-model.number="radius_val"
type="number"
label="Radius"
hint="Angular radius around source coordinates, within which to query for data (Default 1 degree)"
persistent-hint>
</v-text-field>
</div>
<div :style="{ width: '40%' }">
<v-select
v-model="radius_unit"
attach
:items="['deg', 'rad', 'arcmin', 'arcsec']"
label="Unit">
</v-select>
</div>
</v-row>




<j-plugin-section-header>Survey Collections</j-plugin-section-header>
<v-row>
<j-tooltip tipid='plugin-vo-filter-coverage'>
Expand Down

0 comments on commit a7bfc29

Please sign in to comment.