Server functions

async ska.tmlite.server.main.add_model(item_id: str, item: Union[TModelLite, MCCSGeoJSON])[source]

PUT method that takes a full model to add - will replace If the model is in MCCSGeoJSON format we will convert it to TModelLite model :param model: TModelLite or MCCSGeoJSON in json format :return: the model:

async ska.tmlite.server.main.get_instrument(item_id: str, instrument_id: str)[source]

GET method for the given instrument

Parameters

item_id – str

Returns

model

async ska.tmlite.server.main.get_model(item_id: str)[source]

GET method for the given model

Parameters

item_id – str the label for the model that is to be returned

Returns

model

async ska.tmlite.server.main.get_layout(item_id: str, instrument: str)[source]

GET method for the given model - perform a conversion from any other model

Parameters

item_id – str

Returns

model

async ska.tmlite.server.main.get_static_rfi_mask(item_id: str, instrument_id: str)[source]

GET method to return the rfi mask

Returns

the JSON representation of the RFI mask

ska.tmlite.server.main.read_root()[source]
async ska.tmlite.server.main.update_model_antennas(item_id: str, instrument_id: str, item: Mccs)[source]

Update the layout of the current model to match the input This actually takes the current station_id’s and uses them to add the antennas that match the IDs from the default model into the current model.

async ska.tmlite.server.main.update_model_layout_from_file(item_id: str, instrument_id: str, item: Union[TModelLite, MCCSGeoJSON])[source]

Updates the layout using an input model (either TModelLite or MCCSGeoJSON

async ska.tmlite.server.main.update_model_layout_from_storage(item_id: str, instrument_id: str, file_id: str)[source]

Updates the layout using the contents of a file in the backend storage

ska.tmlite.server.main.update_model_layout(item_id: str, instrument_id: str, item: dict)[source]

Updates the current model layout with the contents of the dictionary

Parameters
  • item_id – str - the label of the model to be updated

  • instrument_id – str the instrument [ska1_low | ska1_mod]

  • item – dict JSON representation of the station position