observation.py 2.75 KB
Newer Older
1
"""
2
    schema: Observation Message sent by platforms when points of interest are found.
3
"""
4 5
# from . import full_message_schema, api
# from flask_restx import fields
6

7 8 9 10 11 12 13 14
observation_schema = {
    "allOf": [{"$ref": "#/components/schemas/Message"}],
    "type": "object",
    "properties": {
        "platform_serial": {
            "description": "Serial of platform to sendign observations",
            "example": "ecosub-3",
        },
15 16
        # "observation_type" ==> payloads tied to different types maybe?
        # properties of each observation?
17 18
        "points_of_interest": {
            "description": "Points from features of interest identified by"
19
            + " platform if any found. DEFINE FORMAT.",
20 21 22 23
            "example": "",
        },
        "region_surveyed": {
            "description": "Region surveyed by given platform. DEFINE FORMAT."
24
            + " GEOJSON?",
25 26 27 28
            "example": "",
        },
        "quality_of_points": {
            "description": "Quality/strength of points from features of interest"
29
            + " identified by platform. DEFINE FORMAT.",
30 31 32 33 34 35
            "example": 0.98,
        },
        "additional_data": {
            "description": "Placeholder field for any additional data",
            "example": {"sensor_payload": False},
        },
36
    },
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
    "required": ["platform_serial"],
}

# observation_schema = api.model(
#     "Observation",
#     {
#         "message": fields.Nested(
#             full_message_schema,
#             required=True,
#             description="Message header",
#         ),
#         "platform_serial": fields.String(
#             required=True,
#             description="Serial of platform to sendign observations",
#             example="ecosub-3",
#         ),
#         # "observation_type" ==> payloads tied to different types maybe?
#         # properties of each observation?
#         "points_of_interest": fields.Float(
#             required=False,
#             description="Points from features of interest identified by"
#             + " platform if any found. DEFINE FORMAT.",
#             example="",
#         ),
#         "region_surveyed": fields.Float(
#             required=False,
#             description="Region surveyed by given platform. DEFINE FORMAT."
#             + " GEOJSON?",
#             example="",
#         ),
#         "quality_of_points": fields.Float(
#             required=False,
#             description="Quality/strength of points from features of interest"
#             + " identified by platform. DEFINE FORMAT.",
#             example=0.98,
#         ),
#         "additional_data": fields.Raw(
#             required=False,
#             description="Placeholder field for any additional data",
#             example={"sensor_payload": False},
#         ),
#     },
# )