diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/views.py b/SAS/TMSS/backend/src/tmss/tmssapp/views.py index 9201566e0321398eadfe65842a43a33ff5e9d364..cc0805e394caee6899f9c1ab4a3dd1b8b2595bea 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/views.py +++ b/SAS/TMSS/backend/src/tmss/tmssapp/views.py @@ -254,12 +254,17 @@ def stations(request): from lofar.sas.tmss.tmss.tmssapp.models import CommonSchemaTemplate stations_template = CommonSchemaTemplate.get_latest(name="stations") stations = stations_template.schema['definitions']['station']['enum'] + lofar2_station_group = next(sg for sg in stations_template.schema['definitions']['station_group']['anyOf'] if sg['title'] == 'LOFAR2') + lofar2_stations = lofar2_station_group['properties']['stations']['enum'][0] result = {} for station in stations: # for now, we just add the location as lat/lon in deg. loc = create_location_for_station(station) - result[station] = {'latitude': loc.lat.deg, 'longitude': loc.lon.deg} + # and the station version. + version = 2 if station in lofar2_stations else 1 + + result[station] = {'latitude': loc.lat.deg, 'longitude': loc.lon.deg, 'version': version } return JsonResponse(result)