Skip to content

Commit

Permalink
be compatible with surveys for which ra_deg is not iterable
Browse files Browse the repository at this point in the history
  • Loading branch information
ehneilsen committed May 2, 2024
1 parent 63599e8 commit 287a5fc
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions schedview/plot/survey.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,19 @@ def map_survey_healpix(

if survey is not None:
try:
try:
ra_deg = list(survey.ra_deg)
dec_deg = list(survey.dec_deg)
except TypeError:
ra_deg = [survey.ra_deg]
dec_deg = [survey.dec_deg]

survey_field_data_source = bokeh.models.ColumnDataSource(
data={
"ra": list(survey.ra_deg),
"decl": list(survey.dec_deg),
"name": ["survey_pointing {i}" for i, ra in enumerate(list(survey.ra_deg))],
"glyph_size": [20] * len(list(survey.ra_deg)),
"ra": ra_deg,
"decl": dec_deg,
"name": ["survey_pointing {i}" for i, ra in enumerate(ra_deg)],
"glyph_size": [20] * len(ra_deg),
},
name="survey_pointings",
)
Expand Down

0 comments on commit 287a5fc

Please sign in to comment.