Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • Christoph.Fischer/enstools-feature
1 result
Show changes
Showing
with 1416 additions and 195 deletions
Template Object Compare
=======================
Template for tracking, where the tracking strategy is solely based on pairwise comparison of object descriptions from consecutive timesteps.
.. autoclass:: enstools.feature.tracking.template_object_compare.TrackingCompareTemplate
# init file for identification # init file for identification
from .identification import IdentificationTechnique from .identification import IdentificationStrategy
\ No newline at end of file \ No newline at end of file
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT! # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tmpwk8txbl6 # source: tmpo5hidrpg
"""Generated protocol buffer code.""" """Generated protocol buffer code."""
from google.protobuf.internal import builder as _builder from google.protobuf.internal import builder as _builder
from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor as _descriptor
...@@ -13,10 +13,10 @@ _sym_db = _symbol_database.Default() ...@@ -13,10 +13,10 @@ _sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0btmpwk8txbl6\"(\n\x0cLatLonPoints\x12\x0b\n\x03lat\x18\x01 \x01(\x02\x12\x0b\n\x03lon\x18\x02 \x01(\x02\"E\n\x0b\x42oundingBox\x12\x1a\n\x03min\x18\x01 \x01(\x0b\x32\r.LatLonPoints\x12\x1a\n\x03max\x18\x02 \x01(\x0b\x32\r.LatLonPoints\"[\n\nProperties\x12\x1f\n\x08line_pts\x18\x01 \x03(\x0b\x32\r.LatLonPoints\x12\x18\n\x02\x62\x62\x18\x02 \x01(\x0b\x32\x0c.BoundingBox\x12\x12\n\nlength_deg\x18\x03 \x01(\x02\")\n\tVoxelData\x12\r\n\x05index\x18\x01 \x03(\r\x12\r\n\x05value\x18\x02 \x01(\x02\"-\n\nVertexData\x12\x10\n\x08position\x18\x01 \x03(\x02\x12\r\n\x05value\x18\x02 \x01(\x02\"+\n\x08\x46\x61\x63\x65\x44\x61ta\x12\x10\n\x08vertices\x18\x01 \x03(\r\x12\r\n\x05value\x18\x02 \x01(\x02\"C\n\x13VoxelRepresentation\x12\x0c\n\x04\x64\x65sc\x18\x01 \x01(\t\x12\x1e\n\nvoxel_data\x18\x02 \x03(\x0b\x32\n.VoxelData\"D\n\x12LineRepresentation\x12\x0c\n\x04\x64\x65sc\x18\x01 \x01(\t\x12 \n\x0bvertex_data\x18\x02 \x03(\x0b\x32\x0b.VertexData\"f\n\x16\x42oundaryRepresentation\x12\x0c\n\x04\x64\x65sc\x18\x01 \x01(\t\x12 \n\x0bvertex_data\x18\x02 \x03(\x0b\x32\x0b.VertexData\x12\x1c\n\tface_data\x18\x03 \x03(\x0b\x32\t.FaceData\"2\n\tGraphNode\x12\x0c\n\x04time\x18\x01 \x02(\t\x12\x17\n\x06object\x18\x02 \x02(\x0b\x32\x07.Object\"I\n\x0fGraphConnection\x12\x1a\n\x06parent\x18\x01 \x02(\x0b\x32\n.GraphNode\x12\x1a\n\x06\x63hilds\x18\x02 \x03(\x0b\x32\n.GraphNode\".\n\x0bObjectGraph\x12\x1f\n\x05\x65\x64ges\x18\x01 \x03(\x0b\x32\x10.GraphConnection\"\xb4\x01\n\x06Object\x12\n\n\x02id\x18\x01 \x02(\x05\x12%\n\x08line_rep\x18\x02 \x03(\x0b\x32\x13.LineRepresentation\x12\'\n\tvoxel_rep\x18\x03 \x01(\x0b\x32\x14.VoxelRepresentation\x12-\n\x0c\x62oundary_rep\x18\x04 \x03(\x0b\x32\x17.BoundaryRepresentation\x12\x1f\n\nproperties\x18\x05 \x01(\x0b\x32\x0b.Properties\"8\n\x08Timestep\x12\x12\n\nvalid_time\x18\x01 \x01(\t\x12\x18\n\x07objects\x18\x02 \x03(\x0b\x32\x07.Object\"\x99\x01\n\x0cTrackableSet\x12\x11\n\tinit_time\x18\x01 \x01(\t\x12\x0e\n\x06member\x18\x02 \x01(\r\x12\r\n\x05level\x18\x03 \x01(\x02\x12\x1c\n\ttimesteps\x18\x04 \x03(\x0b\x32\t.Timestep\x12\x1b\n\x05graph\x18\x05 \x01(\x0b\x32\x0c.ObjectGraph\x12\x1c\n\x06tracks\x18\x06 \x03(\x0b\x32\x0c.ObjectGraph\"_\n\x12\x44\x61tasetDescription\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04\x66ile\x18\x02 \x01(\t\x12\x10\n\x08run_time\x18\x03 \x02(\t\x12\x1b\n\x04sets\x18\x04 \x03(\x0b\x32\r.TrackableSet') DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0btmpo5hidrpg\"(\n\x0cLatLonPoints\x12\x0b\n\x03lat\x18\x01 \x01(\x02\x12\x0b\n\x03lon\x18\x02 \x01(\x02\"E\n\x0b\x42oundingBox\x12\x1a\n\x03min\x18\x01 \x01(\x0b\x32\r.LatLonPoints\x12\x1a\n\x03max\x18\x02 \x01(\x0b\x32\r.LatLonPoints\"[\n\nProperties\x12\x1f\n\x08line_pts\x18\x01 \x03(\x0b\x32\r.LatLonPoints\x12\x18\n\x02\x62\x62\x18\x02 \x01(\x0b\x32\x0c.BoundingBox\x12\x12\n\nlength_deg\x18\x03 \x01(\x02\")\n\tVoxelData\x12\r\n\x05index\x18\x01 \x03(\r\x12\r\n\x05value\x18\x02 \x01(\x02\"-\n\nVertexData\x12\x10\n\x08position\x18\x01 \x03(\x02\x12\r\n\x05value\x18\x02 \x01(\x02\"+\n\x08\x46\x61\x63\x65\x44\x61ta\x12\x10\n\x08vertices\x18\x01 \x03(\r\x12\r\n\x05value\x18\x02 \x01(\x02\"C\n\x13VoxelRepresentation\x12\x0c\n\x04\x64\x65sc\x18\x01 \x01(\t\x12\x1e\n\nvoxel_data\x18\x02 \x03(\x0b\x32\n.VoxelData\"D\n\x12LineRepresentation\x12\x0c\n\x04\x64\x65sc\x18\x01 \x01(\t\x12 \n\x0bvertex_data\x18\x02 \x03(\x0b\x32\x0b.VertexData\"f\n\x16\x42oundaryRepresentation\x12\x0c\n\x04\x64\x65sc\x18\x01 \x01(\t\x12 \n\x0bvertex_data\x18\x02 \x03(\x0b\x32\x0b.VertexData\x12\x1c\n\tface_data\x18\x03 \x03(\x0b\x32\t.FaceData\"2\n\tGraphNode\x12\x0c\n\x04time\x18\x01 \x02(\t\x12\x17\n\x06object\x18\x02 \x02(\x0b\x32\x07.Object\"K\n\x0fGraphConnection\x12\x1a\n\x06parent\x18\x01 \x02(\x0b\x32\n.GraphNode\x12\x1c\n\x08\x63hildren\x18\x02 \x03(\x0b\x32\n.GraphNode\".\n\x0bObjectGraph\x12\x1f\n\x05\x65\x64ges\x18\x01 \x03(\x0b\x32\x10.GraphConnection\"\xb4\x01\n\x06Object\x12\n\n\x02id\x18\x01 \x02(\x05\x12%\n\x08line_rep\x18\x02 \x03(\x0b\x32\x13.LineRepresentation\x12\'\n\tvoxel_rep\x18\x03 \x01(\x0b\x32\x14.VoxelRepresentation\x12-\n\x0c\x62oundary_rep\x18\x04 \x03(\x0b\x32\x17.BoundaryRepresentation\x12\x1f\n\nproperties\x18\x05 \x01(\x0b\x32\x0b.Properties\"8\n\x08Timestep\x12\x12\n\nvalid_time\x18\x01 \x01(\t\x12\x18\n\x07objects\x18\x02 \x03(\x0b\x32\x07.Object\"\x99\x01\n\x0cTrackableSet\x12\x11\n\tinit_time\x18\x01 \x01(\t\x12\x0e\n\x06member\x18\x02 \x01(\r\x12\r\n\x05level\x18\x03 \x01(\x02\x12\x1c\n\ttimesteps\x18\x04 \x03(\x0b\x32\t.Timestep\x12\x1b\n\x05graph\x18\x05 \x01(\x0b\x32\x0c.ObjectGraph\x12\x1c\n\x06tracks\x18\x06 \x03(\x0b\x32\x0c.ObjectGraph\"_\n\x12\x44\x61tasetDescription\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04\x66ile\x18\x02 \x01(\t\x12\x10\n\x08run_time\x18\x03 \x02(\t\x12\x1b\n\x04sets\x18\x04 \x03(\x0b\x32\r.TrackableSet')
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tmpwk8txbl6_pb2', globals()) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tmpo5hidrpg_pb2', globals())
if _descriptor._USE_C_DESCRIPTORS == False: if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None DESCRIPTOR._options = None
...@@ -41,15 +41,15 @@ if _descriptor._USE_C_DESCRIPTORS == False: ...@@ -41,15 +41,15 @@ if _descriptor._USE_C_DESCRIPTORS == False:
_GRAPHNODE._serialized_start=599 _GRAPHNODE._serialized_start=599
_GRAPHNODE._serialized_end=649 _GRAPHNODE._serialized_end=649
_GRAPHCONNECTION._serialized_start=651 _GRAPHCONNECTION._serialized_start=651
_GRAPHCONNECTION._serialized_end=724 _GRAPHCONNECTION._serialized_end=726
_OBJECTGRAPH._serialized_start=726 _OBJECTGRAPH._serialized_start=728
_OBJECTGRAPH._serialized_end=772 _OBJECTGRAPH._serialized_end=774
_OBJECT._serialized_start=775 _OBJECT._serialized_start=777
_OBJECT._serialized_end=955 _OBJECT._serialized_end=957
_TIMESTEP._serialized_start=957 _TIMESTEP._serialized_start=959
_TIMESTEP._serialized_end=1013 _TIMESTEP._serialized_end=1015
_TRACKABLESET._serialized_start=1016 _TRACKABLESET._serialized_start=1018
_TRACKABLESET._serialized_end=1169 _TRACKABLESET._serialized_end=1171
_DATASETDESCRIPTION._serialized_start=1171 _DATASETDESCRIPTION._serialized_start=1173
_DATASETDESCRIPTION._serialized_end=1266 _DATASETDESCRIPTION._serialized_end=1268
# @@protoc_insertion_point(module_scope) # @@protoc_insertion_point(module_scope)
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT! # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tmpp47nzntz # source: tmp1d24z_3j
"""Generated protocol buffer code.""" """Generated protocol buffer code."""
from google.protobuf.internal import builder as _builder from google.protobuf.internal import builder as _builder
from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor as _descriptor
...@@ -13,10 +13,10 @@ _sym_db = _symbol_database.Default() ...@@ -13,10 +13,10 @@ _sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0btmpp47nzntz\"P\n\nProperties\x12\x19\n\x08\x63\x65ntroid\x18\x01 \x01(\x0b\x32\x07.Vector\x12\x0c\n\x04size\x18\x02 \x01(\x05\x12\x19\n\x11list_of_something\x18\x03 \x03(\t\")\n\x06Vector\x12\t\n\x01x\x18\x01 \x02(\x02\x12\t\n\x01y\x18\x02 \x02(\x02\x12\t\n\x01z\x18\x03 \x01(\x02\")\n\tVoxelData\x12\r\n\x05index\x18\x01 \x03(\r\x12\r\n\x05value\x18\x02 \x01(\x02\"-\n\nVertexData\x12\x10\n\x08position\x18\x01 \x03(\x02\x12\r\n\x05value\x18\x02 \x01(\x02\"+\n\x08\x46\x61\x63\x65\x44\x61ta\x12\x10\n\x08vertices\x18\x01 \x03(\r\x12\r\n\x05value\x18\x02 \x01(\x02\"C\n\x13VoxelRepresentation\x12\x0c\n\x04\x64\x65sc\x18\x01 \x01(\t\x12\x1e\n\nvoxel_data\x18\x02 \x03(\x0b\x32\n.VoxelData\"D\n\x12LineRepresentation\x12\x0c\n\x04\x64\x65sc\x18\x01 \x01(\t\x12 \n\x0bvertex_data\x18\x02 \x03(\x0b\x32\x0b.VertexData\"f\n\x16\x42oundaryRepresentation\x12\x0c\n\x04\x64\x65sc\x18\x01 \x01(\t\x12 \n\x0bvertex_data\x18\x02 \x03(\x0b\x32\x0b.VertexData\x12\x1c\n\tface_data\x18\x03 \x03(\x0b\x32\t.FaceData\"2\n\tGraphNode\x12\x0c\n\x04time\x18\x01 \x02(\t\x12\x17\n\x06object\x18\x02 \x02(\x0b\x32\x07.Object\"I\n\x0fGraphConnection\x12\x1a\n\x06parent\x18\x01 \x02(\x0b\x32\n.GraphNode\x12\x1a\n\x06\x63hilds\x18\x02 \x03(\x0b\x32\n.GraphNode\".\n\x0bObjectGraph\x12\x1f\n\x05\x65\x64ges\x18\x01 \x03(\x0b\x32\x10.GraphConnection\"\xb4\x01\n\x06Object\x12\n\n\x02id\x18\x01 \x02(\x05\x12%\n\x08line_rep\x18\x02 \x03(\x0b\x32\x13.LineRepresentation\x12\'\n\tvoxel_rep\x18\x03 \x01(\x0b\x32\x14.VoxelRepresentation\x12-\n\x0c\x62oundary_rep\x18\x04 \x03(\x0b\x32\x17.BoundaryRepresentation\x12\x1f\n\nproperties\x18\x05 \x01(\x0b\x32\x0b.Properties\"8\n\x08Timestep\x12\x12\n\nvalid_time\x18\x01 \x01(\t\x12\x18\n\x07objects\x18\x02 \x03(\x0b\x32\x07.Object\"\x99\x01\n\x0cTrackableSet\x12\x11\n\tinit_time\x18\x01 \x01(\t\x12\x0e\n\x06member\x18\x02 \x01(\r\x12\r\n\x05level\x18\x03 \x01(\x02\x12\x1c\n\ttimesteps\x18\x04 \x03(\x0b\x32\t.Timestep\x12\x1b\n\x05graph\x18\x05 \x01(\x0b\x32\x0c.ObjectGraph\x12\x1c\n\x06tracks\x18\x06 \x03(\x0b\x32\x0c.ObjectGraph\"_\n\x12\x44\x61tasetDescription\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04\x66ile\x18\x02 \x01(\t\x12\x10\n\x08run_time\x18\x03 \x02(\t\x12\x1b\n\x04sets\x18\x04 \x03(\x0b\x32\r.TrackableSet') DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0btmp1d24z_3j\"P\n\nProperties\x12\x19\n\x08\x63\x65ntroid\x18\x01 \x01(\x0b\x32\x07.Vector\x12\x0c\n\x04size\x18\x02 \x01(\x05\x12\x19\n\x11list_of_something\x18\x03 \x03(\t\")\n\x06Vector\x12\t\n\x01x\x18\x01 \x02(\x02\x12\t\n\x01y\x18\x02 \x02(\x02\x12\t\n\x01z\x18\x03 \x01(\x02\")\n\tVoxelData\x12\r\n\x05index\x18\x01 \x03(\r\x12\r\n\x05value\x18\x02 \x01(\x02\"-\n\nVertexData\x12\x10\n\x08position\x18\x01 \x03(\x02\x12\r\n\x05value\x18\x02 \x01(\x02\"+\n\x08\x46\x61\x63\x65\x44\x61ta\x12\x10\n\x08vertices\x18\x01 \x03(\r\x12\r\n\x05value\x18\x02 \x01(\x02\"C\n\x13VoxelRepresentation\x12\x0c\n\x04\x64\x65sc\x18\x01 \x01(\t\x12\x1e\n\nvoxel_data\x18\x02 \x03(\x0b\x32\n.VoxelData\"D\n\x12LineRepresentation\x12\x0c\n\x04\x64\x65sc\x18\x01 \x01(\t\x12 \n\x0bvertex_data\x18\x02 \x03(\x0b\x32\x0b.VertexData\"f\n\x16\x42oundaryRepresentation\x12\x0c\n\x04\x64\x65sc\x18\x01 \x01(\t\x12 \n\x0bvertex_data\x18\x02 \x03(\x0b\x32\x0b.VertexData\x12\x1c\n\tface_data\x18\x03 \x03(\x0b\x32\t.FaceData\"2\n\tGraphNode\x12\x0c\n\x04time\x18\x01 \x02(\t\x12\x17\n\x06object\x18\x02 \x02(\x0b\x32\x07.Object\"K\n\x0fGraphConnection\x12\x1a\n\x06parent\x18\x01 \x02(\x0b\x32\n.GraphNode\x12\x1c\n\x08\x63hildren\x18\x02 \x03(\x0b\x32\n.GraphNode\".\n\x0bObjectGraph\x12\x1f\n\x05\x65\x64ges\x18\x01 \x03(\x0b\x32\x10.GraphConnection\"\xb4\x01\n\x06Object\x12\n\n\x02id\x18\x01 \x02(\x05\x12%\n\x08line_rep\x18\x02 \x03(\x0b\x32\x13.LineRepresentation\x12\'\n\tvoxel_rep\x18\x03 \x01(\x0b\x32\x14.VoxelRepresentation\x12-\n\x0c\x62oundary_rep\x18\x04 \x03(\x0b\x32\x17.BoundaryRepresentation\x12\x1f\n\nproperties\x18\x05 \x01(\x0b\x32\x0b.Properties\"8\n\x08Timestep\x12\x12\n\nvalid_time\x18\x01 \x01(\t\x12\x18\n\x07objects\x18\x02 \x03(\x0b\x32\x07.Object\"\x99\x01\n\x0cTrackableSet\x12\x11\n\tinit_time\x18\x01 \x01(\t\x12\x0e\n\x06member\x18\x02 \x01(\r\x12\r\n\x05level\x18\x03 \x01(\x02\x12\x1c\n\ttimesteps\x18\x04 \x03(\x0b\x32\t.Timestep\x12\x1b\n\x05graph\x18\x05 \x01(\x0b\x32\x0c.ObjectGraph\x12\x1c\n\x06tracks\x18\x06 \x03(\x0b\x32\x0c.ObjectGraph\"_\n\x12\x44\x61tasetDescription\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04\x66ile\x18\x02 \x01(\t\x12\x10\n\x08run_time\x18\x03 \x02(\t\x12\x1b\n\x04sets\x18\x04 \x03(\x0b\x32\r.TrackableSet')
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tmpp47nzntz_pb2', globals()) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tmp1d24z_3j_pb2', globals())
if _descriptor._USE_C_DESCRIPTORS == False: if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None DESCRIPTOR._options = None
...@@ -39,15 +39,15 @@ if _descriptor._USE_C_DESCRIPTORS == False: ...@@ -39,15 +39,15 @@ if _descriptor._USE_C_DESCRIPTORS == False:
_GRAPHNODE._serialized_start=518 _GRAPHNODE._serialized_start=518
_GRAPHNODE._serialized_end=568 _GRAPHNODE._serialized_end=568
_GRAPHCONNECTION._serialized_start=570 _GRAPHCONNECTION._serialized_start=570
_GRAPHCONNECTION._serialized_end=643 _GRAPHCONNECTION._serialized_end=645
_OBJECTGRAPH._serialized_start=645 _OBJECTGRAPH._serialized_start=647
_OBJECTGRAPH._serialized_end=691 _OBJECTGRAPH._serialized_end=693
_OBJECT._serialized_start=694 _OBJECT._serialized_start=696
_OBJECT._serialized_end=874 _OBJECT._serialized_end=876
_TIMESTEP._serialized_start=876 _TIMESTEP._serialized_start=878
_TIMESTEP._serialized_end=932 _TIMESTEP._serialized_end=934
_TRACKABLESET._serialized_start=935 _TRACKABLESET._serialized_start=937
_TRACKABLESET._serialized_end=1088 _TRACKABLESET._serialized_end=1090
_DATASETDESCRIPTION._serialized_start=1090 _DATASETDESCRIPTION._serialized_start=1092
_DATASETDESCRIPTION._serialized_end=1185 _DATASETDESCRIPTION._serialized_end=1187
# @@protoc_insertion_point(module_scope) # @@protoc_insertion_point(module_scope)
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT! # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tmpq73xg_yv # source: tmpn63nnypr
"""Generated protocol buffer code.""" """Generated protocol buffer code."""
from google.protobuf.internal import builder as _builder from google.protobuf.internal import builder as _builder
from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor as _descriptor
...@@ -13,10 +13,10 @@ _sym_db = _symbol_database.Default() ...@@ -13,10 +13,10 @@ _sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0btmpq73xg_yv\"4\n\tVectorGeo\x12\r\n\x05level\x18\x64 \x01(\x02\x12\x0b\n\x03lat\x18\x65 \x01(\x02\x12\x0b\n\x03lon\x18\x66 \x01(\x02\")\n\x06Vector\x12\t\n\x01z\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\x12\t\n\x01x\x18\x03 \x01(\x02\"\xf6\x02\n\nProperties\x12\x1c\n\x08\x63\x65ntroid\x18\x01 \x01(\x0b\x32\n.VectorGeo\x12\x12\n\nvolume_km3\x18\x02 \x01(\x02\x12\x13\n\x0bvolume_km2K\x18\x03 \x01(\x02\x12\x10\n\x08\x61rea_km2\x18\x04 \x01(\x02\x12\x1c\n\x08min_bbox\x18\x05 \x01(\x0b\x32\n.VectorGeo\x12\x1c\n\x08max_bbox\x18\x06 \x01(\x0b\x32\n.VectorGeo\x12\x0e\n\x06max_pv\x18\x07 \x01(\x02\x12\x0e\n\x06\x61vg_pv\x18\x08 \x01(\x02\x12\x11\n\tis_cutoff\x18\t \x01(\x08\x12\x0e\n\x06length\x18\n \x01(\x02\x12\x14\n\x0clength_ratio\x18\x0b \x01(\x02\x12\x1b\n\nmajor_axis\x18\x0c \x01(\x0b\x32\x07.Vector\x12\x1c\n\x0bmedium_axis\x18\r \x01(\x0b\x32\x07.Vector\x12\x1b\n\nminor_axis\x18\x0e \x01(\x0b\x32\x07.Vector\x12\"\n\x1amajor_axis_orientation_deg\x18\x0f \x01(\x02\")\n\tVoxelData\x12\r\n\x05index\x18\x01 \x03(\r\x12\r\n\x05value\x18\x02 \x01(\x02\"-\n\nVertexData\x12\x10\n\x08position\x18\x01 \x03(\x02\x12\r\n\x05value\x18\x02 \x01(\x02\"+\n\x08\x46\x61\x63\x65\x44\x61ta\x12\x10\n\x08vertices\x18\x01 \x03(\r\x12\r\n\x05value\x18\x02 \x01(\x02\"C\n\x13VoxelRepresentation\x12\x0c\n\x04\x64\x65sc\x18\x01 \x01(\t\x12\x1e\n\nvoxel_data\x18\x02 \x03(\x0b\x32\n.VoxelData\"D\n\x12LineRepresentation\x12\x0c\n\x04\x64\x65sc\x18\x01 \x01(\t\x12 \n\x0bvertex_data\x18\x02 \x03(\x0b\x32\x0b.VertexData\"f\n\x16\x42oundaryRepresentation\x12\x0c\n\x04\x64\x65sc\x18\x01 \x01(\t\x12 \n\x0bvertex_data\x18\x02 \x03(\x0b\x32\x0b.VertexData\x12\x1c\n\tface_data\x18\x03 \x03(\x0b\x32\t.FaceData\"2\n\tGraphNode\x12\x0c\n\x04time\x18\x01 \x02(\t\x12\x17\n\x06object\x18\x02 \x02(\x0b\x32\x07.Object\"I\n\x0fGraphConnection\x12\x1a\n\x06parent\x18\x01 \x02(\x0b\x32\n.GraphNode\x12\x1a\n\x06\x63hilds\x18\x02 \x03(\x0b\x32\n.GraphNode\".\n\x0bObjectGraph\x12\x1f\n\x05\x65\x64ges\x18\x01 \x03(\x0b\x32\x10.GraphConnection\"\xb4\x01\n\x06Object\x12\n\n\x02id\x18\x01 \x02(\x05\x12%\n\x08line_rep\x18\x02 \x03(\x0b\x32\x13.LineRepresentation\x12\'\n\tvoxel_rep\x18\x03 \x01(\x0b\x32\x14.VoxelRepresentation\x12-\n\x0c\x62oundary_rep\x18\x04 \x03(\x0b\x32\x17.BoundaryRepresentation\x12\x1f\n\nproperties\x18\x05 \x01(\x0b\x32\x0b.Properties\"8\n\x08Timestep\x12\x12\n\nvalid_time\x18\x01 \x01(\t\x12\x18\n\x07objects\x18\x02 \x03(\x0b\x32\x07.Object\"\x99\x01\n\x0cTrackableSet\x12\x11\n\tinit_time\x18\x01 \x01(\t\x12\x0e\n\x06member\x18\x02 \x01(\r\x12\r\n\x05level\x18\x03 \x01(\x02\x12\x1c\n\ttimesteps\x18\x04 \x03(\x0b\x32\t.Timestep\x12\x1b\n\x05graph\x18\x05 \x01(\x0b\x32\x0c.ObjectGraph\x12\x1c\n\x06tracks\x18\x06 \x03(\x0b\x32\x0c.ObjectGraph\"_\n\x12\x44\x61tasetDescription\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04\x66ile\x18\x02 \x01(\t\x12\x10\n\x08run_time\x18\x03 \x02(\t\x12\x1b\n\x04sets\x18\x04 \x03(\x0b\x32\r.TrackableSet') DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0btmpn63nnypr\"4\n\tVectorGeo\x12\r\n\x05level\x18\x64 \x01(\x02\x12\x0b\n\x03lat\x18\x65 \x01(\x02\x12\x0b\n\x03lon\x18\x66 \x01(\x02\")\n\x06Vector\x12\t\n\x01z\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\x12\t\n\x01x\x18\x03 \x01(\x02\"\xf6\x02\n\nProperties\x12\x1c\n\x08\x63\x65ntroid\x18\x01 \x01(\x0b\x32\n.VectorGeo\x12\x12\n\nvolume_km3\x18\x02 \x01(\x02\x12\x13\n\x0bvolume_km2K\x18\x03 \x01(\x02\x12\x10\n\x08\x61rea_km2\x18\x04 \x01(\x02\x12\x1c\n\x08min_bbox\x18\x05 \x01(\x0b\x32\n.VectorGeo\x12\x1c\n\x08max_bbox\x18\x06 \x01(\x0b\x32\n.VectorGeo\x12\x0e\n\x06max_pv\x18\x07 \x01(\x02\x12\x0e\n\x06\x61vg_pv\x18\x08 \x01(\x02\x12\x11\n\tis_cutoff\x18\t \x01(\x08\x12\x0e\n\x06length\x18\n \x01(\x02\x12\x14\n\x0clength_ratio\x18\x0b \x01(\x02\x12\x1b\n\nmajor_axis\x18\x0c \x01(\x0b\x32\x07.Vector\x12\x1c\n\x0bmedium_axis\x18\r \x01(\x0b\x32\x07.Vector\x12\x1b\n\nminor_axis\x18\x0e \x01(\x0b\x32\x07.Vector\x12\"\n\x1amajor_axis_orientation_deg\x18\x0f \x01(\x02\")\n\tVoxelData\x12\r\n\x05index\x18\x01 \x03(\r\x12\r\n\x05value\x18\x02 \x01(\x02\"-\n\nVertexData\x12\x10\n\x08position\x18\x01 \x03(\x02\x12\r\n\x05value\x18\x02 \x01(\x02\"+\n\x08\x46\x61\x63\x65\x44\x61ta\x12\x10\n\x08vertices\x18\x01 \x03(\r\x12\r\n\x05value\x18\x02 \x01(\x02\"C\n\x13VoxelRepresentation\x12\x0c\n\x04\x64\x65sc\x18\x01 \x01(\t\x12\x1e\n\nvoxel_data\x18\x02 \x03(\x0b\x32\n.VoxelData\"D\n\x12LineRepresentation\x12\x0c\n\x04\x64\x65sc\x18\x01 \x01(\t\x12 \n\x0bvertex_data\x18\x02 \x03(\x0b\x32\x0b.VertexData\"f\n\x16\x42oundaryRepresentation\x12\x0c\n\x04\x64\x65sc\x18\x01 \x01(\t\x12 \n\x0bvertex_data\x18\x02 \x03(\x0b\x32\x0b.VertexData\x12\x1c\n\tface_data\x18\x03 \x03(\x0b\x32\t.FaceData\"2\n\tGraphNode\x12\x0c\n\x04time\x18\x01 \x02(\t\x12\x17\n\x06object\x18\x02 \x02(\x0b\x32\x07.Object\"K\n\x0fGraphConnection\x12\x1a\n\x06parent\x18\x01 \x02(\x0b\x32\n.GraphNode\x12\x1c\n\x08\x63hildren\x18\x02 \x03(\x0b\x32\n.GraphNode\".\n\x0bObjectGraph\x12\x1f\n\x05\x65\x64ges\x18\x01 \x03(\x0b\x32\x10.GraphConnection\"\xb4\x01\n\x06Object\x12\n\n\x02id\x18\x01 \x02(\x05\x12%\n\x08line_rep\x18\x02 \x03(\x0b\x32\x13.LineRepresentation\x12\'\n\tvoxel_rep\x18\x03 \x01(\x0b\x32\x14.VoxelRepresentation\x12-\n\x0c\x62oundary_rep\x18\x04 \x03(\x0b\x32\x17.BoundaryRepresentation\x12\x1f\n\nproperties\x18\x05 \x01(\x0b\x32\x0b.Properties\"8\n\x08Timestep\x12\x12\n\nvalid_time\x18\x01 \x01(\t\x12\x18\n\x07objects\x18\x02 \x03(\x0b\x32\x07.Object\"\x99\x01\n\x0cTrackableSet\x12\x11\n\tinit_time\x18\x01 \x01(\t\x12\x0e\n\x06member\x18\x02 \x01(\r\x12\r\n\x05level\x18\x03 \x01(\x02\x12\x1c\n\ttimesteps\x18\x04 \x03(\x0b\x32\t.Timestep\x12\x1b\n\x05graph\x18\x05 \x01(\x0b\x32\x0c.ObjectGraph\x12\x1c\n\x06tracks\x18\x06 \x03(\x0b\x32\x0c.ObjectGraph\"_\n\x12\x44\x61tasetDescription\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04\x66ile\x18\x02 \x01(\t\x12\x10\n\x08run_time\x18\x03 \x02(\t\x12\x1b\n\x04sets\x18\x04 \x03(\x0b\x32\r.TrackableSet')
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tmpq73xg_yv_pb2', globals()) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tmpn63nnypr_pb2', globals())
if _descriptor._USE_C_DESCRIPTORS == False: if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None DESCRIPTOR._options = None
...@@ -41,15 +41,15 @@ if _descriptor._USE_C_DESCRIPTORS == False: ...@@ -41,15 +41,15 @@ if _descriptor._USE_C_DESCRIPTORS == False:
_GRAPHNODE._serialized_start=867 _GRAPHNODE._serialized_start=867
_GRAPHNODE._serialized_end=917 _GRAPHNODE._serialized_end=917
_GRAPHCONNECTION._serialized_start=919 _GRAPHCONNECTION._serialized_start=919
_GRAPHCONNECTION._serialized_end=992 _GRAPHCONNECTION._serialized_end=994
_OBJECTGRAPH._serialized_start=994 _OBJECTGRAPH._serialized_start=996
_OBJECTGRAPH._serialized_end=1040 _OBJECTGRAPH._serialized_end=1042
_OBJECT._serialized_start=1043 _OBJECT._serialized_start=1045
_OBJECT._serialized_end=1223 _OBJECT._serialized_end=1225
_TIMESTEP._serialized_start=1225 _TIMESTEP._serialized_start=1227
_TIMESTEP._serialized_end=1281 _TIMESTEP._serialized_end=1283
_TRACKABLESET._serialized_start=1284 _TRACKABLESET._serialized_start=1286
_TRACKABLESET._serialized_end=1437 _TRACKABLESET._serialized_end=1439
_DATASETDESCRIPTION._serialized_start=1439 _DATASETDESCRIPTION._serialized_start=1441
_DATASETDESCRIPTION._serialized_end=1534 _DATASETDESCRIPTION._serialized_end=1536
# @@protoc_insertion_point(module_scope) # @@protoc_insertion_point(module_scope)
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tmpz751s9fm
"""Generated protocol buffer code."""
from google.protobuf.internal import builder as _builder
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0btmpz751s9fm\"\x1f\n\x03Pos\x12\x0b\n\x03lat\x18\x01 \x02(\x02\x12\x0b\n\x03lon\x18\x02 \x02(\x02\"B\n\nProperties\x12\x14\n\x0cmin_pressure\x18\x01 \x02(\x02\x12\x1e\n\x10min_pressure_pos\x18\x02 \x02(\x0b\x32\x04.Pos\")\n\tVoxelData\x12\r\n\x05index\x18\x01 \x03(\r\x12\r\n\x05value\x18\x02 \x01(\x02\"-\n\nVertexData\x12\x10\n\x08position\x18\x01 \x03(\x02\x12\r\n\x05value\x18\x02 \x01(\x02\"+\n\x08\x46\x61\x63\x65\x44\x61ta\x12\x10\n\x08vertices\x18\x01 \x03(\r\x12\r\n\x05value\x18\x02 \x01(\x02\"C\n\x13VoxelRepresentation\x12\x0c\n\x04\x64\x65sc\x18\x01 \x01(\t\x12\x1e\n\nvoxel_data\x18\x02 \x03(\x0b\x32\n.VoxelData\"D\n\x12LineRepresentation\x12\x0c\n\x04\x64\x65sc\x18\x01 \x01(\t\x12 \n\x0bvertex_data\x18\x02 \x03(\x0b\x32\x0b.VertexData\"f\n\x16\x42oundaryRepresentation\x12\x0c\n\x04\x64\x65sc\x18\x01 \x01(\t\x12 \n\x0bvertex_data\x18\x02 \x03(\x0b\x32\x0b.VertexData\x12\x1c\n\tface_data\x18\x03 \x03(\x0b\x32\t.FaceData\"2\n\tGraphNode\x12\x0c\n\x04time\x18\x01 \x02(\t\x12\x17\n\x06object\x18\x02 \x02(\x0b\x32\x07.Object\"K\n\x0fGraphConnection\x12\x1a\n\x06parent\x18\x01 \x02(\x0b\x32\n.GraphNode\x12\x1c\n\x08\x63hildren\x18\x02 \x03(\x0b\x32\n.GraphNode\".\n\x0bObjectGraph\x12\x1f\n\x05\x65\x64ges\x18\x01 \x03(\x0b\x32\x10.GraphConnection\"\xb4\x01\n\x06Object\x12\n\n\x02id\x18\x01 \x02(\x05\x12%\n\x08line_rep\x18\x02 \x03(\x0b\x32\x13.LineRepresentation\x12\'\n\tvoxel_rep\x18\x03 \x01(\x0b\x32\x14.VoxelRepresentation\x12-\n\x0c\x62oundary_rep\x18\x04 \x03(\x0b\x32\x17.BoundaryRepresentation\x12\x1f\n\nproperties\x18\x05 \x01(\x0b\x32\x0b.Properties\"8\n\x08Timestep\x12\x12\n\nvalid_time\x18\x01 \x01(\t\x12\x18\n\x07objects\x18\x02 \x03(\x0b\x32\x07.Object\"\x99\x01\n\x0cTrackableSet\x12\x11\n\tinit_time\x18\x01 \x01(\t\x12\x0e\n\x06member\x18\x02 \x01(\r\x12\r\n\x05level\x18\x03 \x01(\x02\x12\x1c\n\ttimesteps\x18\x04 \x03(\x0b\x32\t.Timestep\x12\x1b\n\x05graph\x18\x05 \x01(\x0b\x32\x0c.ObjectGraph\x12\x1c\n\x06tracks\x18\x06 \x03(\x0b\x32\x0c.ObjectGraph\"_\n\x12\x44\x61tasetDescription\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04\x66ile\x18\x02 \x01(\t\x12\x10\n\x08run_time\x18\x03 \x02(\t\x12\x1b\n\x04sets\x18\x04 \x03(\x0b\x32\r.TrackableSet')
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tmpz751s9fm_pb2', globals())
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
_POS._serialized_start=15
_POS._serialized_end=46
_PROPERTIES._serialized_start=48
_PROPERTIES._serialized_end=114
_VOXELDATA._serialized_start=116
_VOXELDATA._serialized_end=157
_VERTEXDATA._serialized_start=159
_VERTEXDATA._serialized_end=204
_FACEDATA._serialized_start=206
_FACEDATA._serialized_end=249
_VOXELREPRESENTATION._serialized_start=251
_VOXELREPRESENTATION._serialized_end=318
_LINEREPRESENTATION._serialized_start=320
_LINEREPRESENTATION._serialized_end=388
_BOUNDARYREPRESENTATION._serialized_start=390
_BOUNDARYREPRESENTATION._serialized_end=492
_GRAPHNODE._serialized_start=494
_GRAPHNODE._serialized_end=544
_GRAPHCONNECTION._serialized_start=546
_GRAPHCONNECTION._serialized_end=621
_OBJECTGRAPH._serialized_start=623
_OBJECTGRAPH._serialized_end=669
_OBJECT._serialized_start=672
_OBJECT._serialized_end=852
_TIMESTEP._serialized_start=854
_TIMESTEP._serialized_end=910
_TRACKABLESET._serialized_start=913
_TRACKABLESET._serialized_end=1066
_DATASETDESCRIPTION._serialized_start=1068
_DATASETDESCRIPTION._serialized_end=1163
# @@protoc_insertion_point(module_scope)
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT! # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tmpa9_3ixx5 # source: tmpqxin01s0
"""Generated protocol buffer code.""" """Generated protocol buffer code."""
from google.protobuf.internal import builder as _builder from google.protobuf.internal import builder as _builder
from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor as _descriptor
...@@ -13,10 +13,10 @@ _sym_db = _symbol_database.Default() ...@@ -13,10 +13,10 @@ _sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0btmpa9_3ixx5\"P\n\nProperties\x12\x19\n\x08\x63\x65ntroid\x18\x01 \x01(\x0b\x32\x07.Vector\x12\x0c\n\x04size\x18\x02 \x01(\x05\x12\x19\n\x11list_of_something\x18\x03 \x03(\t\")\n\x06Vector\x12\t\n\x01x\x18\x01 \x02(\x02\x12\t\n\x01y\x18\x02 \x02(\x02\x12\t\n\x01z\x18\x03 \x01(\x02\")\n\tVoxelData\x12\r\n\x05index\x18\x01 \x03(\r\x12\r\n\x05value\x18\x02 \x01(\x02\"-\n\nVertexData\x12\x10\n\x08position\x18\x01 \x03(\x02\x12\r\n\x05value\x18\x02 \x01(\x02\"+\n\x08\x46\x61\x63\x65\x44\x61ta\x12\x10\n\x08vertices\x18\x01 \x03(\r\x12\r\n\x05value\x18\x02 \x01(\x02\"C\n\x13VoxelRepresentation\x12\x0c\n\x04\x64\x65sc\x18\x01 \x01(\t\x12\x1e\n\nvoxel_data\x18\x02 \x03(\x0b\x32\n.VoxelData\"D\n\x12LineRepresentation\x12\x0c\n\x04\x64\x65sc\x18\x01 \x01(\t\x12 \n\x0bvertex_data\x18\x02 \x03(\x0b\x32\x0b.VertexData\"f\n\x16\x42oundaryRepresentation\x12\x0c\n\x04\x64\x65sc\x18\x01 \x01(\t\x12 \n\x0bvertex_data\x18\x02 \x03(\x0b\x32\x0b.VertexData\x12\x1c\n\tface_data\x18\x03 \x03(\x0b\x32\t.FaceData\"2\n\tGraphNode\x12\x0c\n\x04time\x18\x01 \x02(\t\x12\x17\n\x06object\x18\x02 \x02(\x0b\x32\x07.Object\"I\n\x0fGraphConnection\x12\x1a\n\x06parent\x18\x01 \x02(\x0b\x32\n.GraphNode\x12\x1a\n\x06\x63hilds\x18\x02 \x03(\x0b\x32\n.GraphNode\".\n\x0bObjectGraph\x12\x1f\n\x05\x65\x64ges\x18\x01 \x03(\x0b\x32\x10.GraphConnection\"\xb4\x01\n\x06Object\x12\n\n\x02id\x18\x01 \x02(\x05\x12%\n\x08line_rep\x18\x02 \x03(\x0b\x32\x13.LineRepresentation\x12\'\n\tvoxel_rep\x18\x03 \x01(\x0b\x32\x14.VoxelRepresentation\x12-\n\x0c\x62oundary_rep\x18\x04 \x03(\x0b\x32\x17.BoundaryRepresentation\x12\x1f\n\nproperties\x18\x05 \x01(\x0b\x32\x0b.Properties\"8\n\x08Timestep\x12\x12\n\nvalid_time\x18\x01 \x01(\t\x12\x18\n\x07objects\x18\x02 \x03(\x0b\x32\x07.Object\"\x99\x01\n\x0cTrackableSet\x12\x11\n\tinit_time\x18\x01 \x01(\t\x12\x0e\n\x06member\x18\x02 \x01(\r\x12\r\n\x05level\x18\x03 \x01(\x02\x12\x1c\n\ttimesteps\x18\x04 \x03(\x0b\x32\t.Timestep\x12\x1b\n\x05graph\x18\x05 \x01(\x0b\x32\x0c.ObjectGraph\x12\x1c\n\x06tracks\x18\x06 \x03(\x0b\x32\x0c.ObjectGraph\"_\n\x12\x44\x61tasetDescription\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04\x66ile\x18\x02 \x01(\t\x12\x10\n\x08run_time\x18\x03 \x02(\t\x12\x1b\n\x04sets\x18\x04 \x03(\x0b\x32\r.TrackableSet') DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0btmpqxin01s0\"P\n\nProperties\x12\x19\n\x08\x63\x65ntroid\x18\x01 \x01(\x0b\x32\x07.Vector\x12\x0c\n\x04size\x18\x02 \x01(\x05\x12\x19\n\x11list_of_something\x18\x03 \x03(\t\")\n\x06Vector\x12\t\n\x01x\x18\x01 \x02(\x02\x12\t\n\x01y\x18\x02 \x02(\x02\x12\t\n\x01z\x18\x03 \x01(\x02\")\n\tVoxelData\x12\r\n\x05index\x18\x01 \x03(\r\x12\r\n\x05value\x18\x02 \x01(\x02\"-\n\nVertexData\x12\x10\n\x08position\x18\x01 \x03(\x02\x12\r\n\x05value\x18\x02 \x01(\x02\"+\n\x08\x46\x61\x63\x65\x44\x61ta\x12\x10\n\x08vertices\x18\x01 \x03(\r\x12\r\n\x05value\x18\x02 \x01(\x02\"C\n\x13VoxelRepresentation\x12\x0c\n\x04\x64\x65sc\x18\x01 \x01(\t\x12\x1e\n\nvoxel_data\x18\x02 \x03(\x0b\x32\n.VoxelData\"D\n\x12LineRepresentation\x12\x0c\n\x04\x64\x65sc\x18\x01 \x01(\t\x12 \n\x0bvertex_data\x18\x02 \x03(\x0b\x32\x0b.VertexData\"f\n\x16\x42oundaryRepresentation\x12\x0c\n\x04\x64\x65sc\x18\x01 \x01(\t\x12 \n\x0bvertex_data\x18\x02 \x03(\x0b\x32\x0b.VertexData\x12\x1c\n\tface_data\x18\x03 \x03(\x0b\x32\t.FaceData\"2\n\tGraphNode\x12\x0c\n\x04time\x18\x01 \x02(\t\x12\x17\n\x06object\x18\x02 \x02(\x0b\x32\x07.Object\"K\n\x0fGraphConnection\x12\x1a\n\x06parent\x18\x01 \x02(\x0b\x32\n.GraphNode\x12\x1c\n\x08\x63hildren\x18\x02 \x03(\x0b\x32\n.GraphNode\".\n\x0bObjectGraph\x12\x1f\n\x05\x65\x64ges\x18\x01 \x03(\x0b\x32\x10.GraphConnection\"\xb4\x01\n\x06Object\x12\n\n\x02id\x18\x01 \x02(\x05\x12%\n\x08line_rep\x18\x02 \x03(\x0b\x32\x13.LineRepresentation\x12\'\n\tvoxel_rep\x18\x03 \x01(\x0b\x32\x14.VoxelRepresentation\x12-\n\x0c\x62oundary_rep\x18\x04 \x03(\x0b\x32\x17.BoundaryRepresentation\x12\x1f\n\nproperties\x18\x05 \x01(\x0b\x32\x0b.Properties\"8\n\x08Timestep\x12\x12\n\nvalid_time\x18\x01 \x01(\t\x12\x18\n\x07objects\x18\x02 \x03(\x0b\x32\x07.Object\"\x99\x01\n\x0cTrackableSet\x12\x11\n\tinit_time\x18\x01 \x01(\t\x12\x0e\n\x06member\x18\x02 \x01(\r\x12\r\n\x05level\x18\x03 \x01(\x02\x12\x1c\n\ttimesteps\x18\x04 \x03(\x0b\x32\t.Timestep\x12\x1b\n\x05graph\x18\x05 \x01(\x0b\x32\x0c.ObjectGraph\x12\x1c\n\x06tracks\x18\x06 \x03(\x0b\x32\x0c.ObjectGraph\"_\n\x12\x44\x61tasetDescription\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04\x66ile\x18\x02 \x01(\t\x12\x10\n\x08run_time\x18\x03 \x02(\t\x12\x1b\n\x04sets\x18\x04 \x03(\x0b\x32\r.TrackableSet')
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tmpa9_3ixx5_pb2', globals()) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'tmpqxin01s0_pb2', globals())
if _descriptor._USE_C_DESCRIPTORS == False: if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None DESCRIPTOR._options = None
...@@ -39,15 +39,15 @@ if _descriptor._USE_C_DESCRIPTORS == False: ...@@ -39,15 +39,15 @@ if _descriptor._USE_C_DESCRIPTORS == False:
_GRAPHNODE._serialized_start=518 _GRAPHNODE._serialized_start=518
_GRAPHNODE._serialized_end=568 _GRAPHNODE._serialized_end=568
_GRAPHCONNECTION._serialized_start=570 _GRAPHCONNECTION._serialized_start=570
_GRAPHCONNECTION._serialized_end=643 _GRAPHCONNECTION._serialized_end=645
_OBJECTGRAPH._serialized_start=645 _OBJECTGRAPH._serialized_start=647
_OBJECTGRAPH._serialized_end=691 _OBJECTGRAPH._serialized_end=693
_OBJECT._serialized_start=694 _OBJECT._serialized_start=696
_OBJECT._serialized_end=874 _OBJECT._serialized_end=876
_TIMESTEP._serialized_start=876 _TIMESTEP._serialized_start=878
_TIMESTEP._serialized_end=932 _TIMESTEP._serialized_end=934
_TRACKABLESET._serialized_start=935 _TRACKABLESET._serialized_start=937
_TRACKABLESET._serialized_end=1088 _TRACKABLESET._serialized_end=1090
_DATASETDESCRIPTION._serialized_start=1090 _DATASETDESCRIPTION._serialized_start=1092
_DATASETDESCRIPTION._serialized_end=1185 _DATASETDESCRIPTION._serialized_end=1187
# @@protoc_insertion_point(module_scope) # @@protoc_insertion_point(module_scope)
163,205,231
120,149,223
81, 92,216
63,164, 52
86,209, 76
255,245, 75
254,185, 63
251,136, 49
251, 22, 33
184, 18, 26
135, 7, 18
#!/usr/bin/env python #!/usr/bin/env python
from os.path import expanduser, join from os.path import expanduser, join
from datetime import timedelta from datetime import timedelta
import numpy as np
# data area # data area
# latN = 35 # latN = 35
...@@ -10,13 +11,33 @@ from datetime import timedelta ...@@ -10,13 +11,33 @@ from datetime import timedelta
data_lat = (-35, 35) data_lat = (-35, 35)
data_lon = (-100, 45) data_lon = (-100, 45)
aew_clim_dir = 'C:\\Users\\Christoph\\phd\\data\\enstools-feature\\cv_clim_era5.nc' # '/home/christoph/phd/data/aew/clim/cv_clim_era5.nc' # '/home/christoph/phd/data/framework_example_ds/aew/' # '/project/meteo/w2w/C3/fischer/belanger/aew_clim/' # aew_clim_dir = '/home/ws/he7273/phd_all/data/aew/clim/cv_clim_era5.nc' # 'C:\\Users\\Christoph\\phd\\data\\enstools-feature\\cv_clim_era5.nc' # '/home/christoph/phd/data/aew/clim/cv_clim_era5.nc' # '/home/christoph/phd/data/framework_example_ds/aew/' # '/project/meteo/w2w/C3/fischer/belanger/aew_clim/' #
in_files = 'C:\\Users\\Christoph\\phd\\data\\enstools-feature\\2008_sum_uv.nc' # '/home/christoph/phd/data/framework_example_ds/aew/cv_aug_08.nc' in_files = '/home/ws/he7273/phd_all/data/coll_oper/jja2021/jja2021.nc' # 'C:\\Users\\Christoph\\phd\\data\\enstools-feature\\2008_sum_uv.nc' # '/home/christoph/phd/data/framework_example_ds/aew/cv_aug_08.nc'
out_dir = join(expanduser("~") + '/phd/data/aew/out/') # '/project/meteo/w2w/C3/fischer/belanger/out/' out_dir = join('/home/ws/he7273/phd_all/data/aew/out/') # '/project/meteo/w2w/C3/fischer/belanger/out/'
plot_dir = join(expanduser("~") + '/phd/data/aew/plots/') # '/project/meteo/w2w/C3/fischer/belanger/plots/' plot_dir = join('/home/ws/he7273/phd_all/data/aew/plots/') # '/project/meteo/w2w/C3/fischer/belanger/plots/'
cv_data_dir = '/project/meteo/w2w/C2/athul/data_athul/AEW_cv_data/' # reference where ALL cv data is (for clim calc.) timedelta_ana = np.timedelta64(7, 'D')
# aew_kitweather_ecmwf_dir = '/lsdf/MOD/Gruppe_Transregio/Gruppe_Knippertz/kitweather/data/ecmwf-hres/forecasts/'
# num_files_ecmwf = 41 # files in finished forecast data
# file_prefix_ecmwf = 'ecmwf-hres_latlon_1.0deg_'
# file_prefix_ecmwf_rain = 'ecmwf-hres_latlon_0.4deg_'
plot_dir_ecmwf = '/home/iconeps/plots/aew/ecmwf-hres/' # '/project/meteo/w2w/C3/fischer/belanger/plots/'
# aew_kitweather_icon_dir = '/lsdf/MOD/Gruppe_Transregio/Gruppe_Knippertz/kitweather/data/icon-global-det/forecasts/'
# num_files_icon = 31 # files in finished forecast data
# file_prefix_icon = 'icon-global-det_latlon_1.0deg_'
# file_prefix_icon_rain = 'icon-global-det_latlon_0.25deg_'
plot_dir_icon = '/home/iconeps/plots/aew/icon-global-det/' # '/project/meteo/w2w/C3/fischer/belanger/plots/'
plot_dir_gfs = '/home/iconeps/plots/aew/gfs/'
latest_run_dir = '/home/iconeps/plots/aew/'
latest_run_info_file_name = 'latest_aew_run.txt'
# out_dir = join(expanduser("~") + '/phd/data/aew/out/') # '/project/meteo/w2w/C3/fischer/belanger/out/'
cv_data_dir = '/project/meteo/w2w/C2/athul/data_athul/AEW_cv_data/' # reference where ALL cv data is (only for clim calc.)
cv_data_ex = join(cv_data_dir, '*.nc') cv_data_ex = join(cv_data_dir, '*.nc')
...@@ -34,12 +55,15 @@ def get_clim_file(): ...@@ -34,12 +55,15 @@ def get_clim_file():
wave_filter_lat = (0, 30) wave_filter_lat = (0, 30)
wave_filter_lon = (-110, 55) wave_filter_lon = (-110, 55)
levels = [70000] # 700 hPa levels = [700] # 700 hPa
u_dim = 'u700_rea'
v_dim = 'v700_rea'
# time of interest, if None all # time of interest, if None all
# june-oct is AEW season # june-oct is AEW season
start_date = '2008-08-01T00:00' # # '2008-08-01T00:00'
end_date = '2008-08-15T00:00' # None # '2008-08-03T00:00' start_date = None # '2008-08-01T00:00' # # '2008-08-01T00:00'
end_date = None # '2008-08-15T00:00' # None # '2008-08-03T00:00'
# Algorithm parameters # Algorithm parameters
# max u wind (m/s) (0 = only keep west-propagating). Belanger: 2.5; Berry: 0.0 # max u wind (m/s) (0 = only keep west-propagating). Belanger: 2.5; Berry: 0.0
......
from enstools.feature.identification import IdentificationTechnique from enstools.feature.identification import IdentificationStrategy
import xarray as xr import xarray as xr
import numpy as np import numpy as np
import os, sys import os, sys
...@@ -7,6 +7,7 @@ import metpy.calc as mpcalc ...@@ -7,6 +7,7 @@ import metpy.calc as mpcalc
from .util import calc_adv from .util import calc_adv
from matplotlib import pyplot as plt from matplotlib import pyplot as plt
import cartopy.crs as ccrs import cartopy.crs as ccrs
from .processing import populate_object, compute_cv from .processing import populate_object, compute_cv
from skimage.draw import line_aa from skimage.draw import line_aa
from enstools.feature.util.enstools_utils import get_u_var, get_v_var, get_vertical_dim, get_longitude_dim, get_latitude_dim from enstools.feature.util.enstools_utils import get_u_var, get_v_var, get_vertical_dim, get_longitude_dim, get_latitude_dim
...@@ -14,7 +15,7 @@ import threading ...@@ -14,7 +15,7 @@ import threading
from skimage.draw import line from skimage.draw import line
class AEWIdentification(IdentificationTechnique): class AEWIdentification(IdentificationStrategy):
def __init__(self, wt_out_file=False, wt_traj_dir=None, cv='cv', year_summer=None, month=None, **kwargs): def __init__(self, wt_out_file=False, wt_traj_dir=None, cv='cv', year_summer=None, month=None, **kwargs):
""" """
...@@ -73,24 +74,46 @@ class AEWIdentification(IdentificationTechnique): ...@@ -73,24 +74,46 @@ class AEWIdentification(IdentificationTechnique):
cv_clim = compute_climatology(self.config) cv_clim = compute_climatology(self.config)
cv_clim.to_netcdf(clim_file) cv_clim.to_netcdf(clim_file)
lat_str_clim = get_latitude_dim(cv_clim)
lon_str_clim = get_longitude_dim(cv_clim)
cv_clim = cv_clim.sel( cv_clim = cv_clim.sel(
**{lat_str: slice(lat_range[0], lat_range[1])}, **{lat_str_clim: slice(lat_range[0], lat_range[1])},
**{lon_str: slice(lon_range[0], lon_range[1])}) **{lon_str_clim: slice(lon_range[0], lon_range[1])})
# --------------- SUBSET DATA ACCORDING TO CFG # --------------- SUBSET DATA ACCORDING TO CFG
start_date_dt = np.datetime64(self.config.start_date) if self.config.start_date is not None else None start_date_dt = np.datetime64(self.config.start_date) if self.config.start_date is not None else None
end_date_dt = np.datetime64(self.config.end_date) if self.config.end_date is not None else None end_date_dt = np.datetime64(self.config.end_date) if self.config.end_date is not None else None
# get the data we want to investigate
# if data is lon=0..360, change it to -180..180
dataset.coords[lon_str] = (dataset.coords[lon_str] + 180) % 360 - 180
dataset = dataset.sortby(dataset[lon_str])
# get the data we want to investigate
dataset = dataset.sortby(lat_str) # in case of descending
dataset = dataset.sel( dataset = dataset.sel(
**{lat_str: slice(lat_range[0], lat_range[1])}, **{lat_str: slice(lat_range[0], lat_range[1])},
**{lon_str: slice(lon_range[0], lon_range[1])}, **{lon_str: slice(lon_range[0], lon_range[1])},
time=slice(start_date_dt, end_date_dt)) time=slice(start_date_dt, end_date_dt))
if len(dataset.time.values) == 0:
print("Given start and end time leads to no data to process.")
exit(1)
u_name = self.config.u_dim if self.config.u_dim is not None else get_u_var(dataset)
v_name = self.config.v_dim if self.config.v_dim is not None else get_v_var(dataset)
if u_name is None or v_name is None:
print("Could not locate u and v fields in dataset. Needed to compute advection terms.")
exit()
# dataset = dataset.expand_dims('level') # dataset = dataset.expand_dims('level')
# level_str = 'level' # level_str = 'level'
if level_str is not None: if level_str in dataset[u_name].dims:
dataset = dataset.sel(**{level_str: self.config.levels}) dataset = dataset.sel(**{level_str: self.config.levels}) # 3-D wind field, select levels
else:
dataset = dataset.sel(**{level_str: self.config.levels}) # 2-D, reduce 3-D field too
dataset[u_name] = dataset[u_name].expand_dims('level')
dataset[v_name] = dataset[v_name].expand_dims('level')
# rename cv_clim dimensions to be same as in data. # rename cv_clim dimensions to be same as in data.
cv_clim = cv_clim.rename({'lat': lat_str, 'lon': lon_str}) cv_clim = cv_clim.rename({'lat': lat_str, 'lon': lon_str})
...@@ -99,14 +122,14 @@ class AEWIdentification(IdentificationTechnique): ...@@ -99,14 +122,14 @@ class AEWIdentification(IdentificationTechnique):
cv_clim = cv_clim.rename({'plev': level_str}) cv_clim = cv_clim.rename({'plev': level_str})
cv_clim = cv_clim.assign_coords({level_str: cv_clim[level_str] / 100}) cv_clim = cv_clim.assign_coords({level_str: cv_clim[level_str] / 100})
# also only use levels also present in data
cv_clim = cv_clim.sel({level_str: dataset[level_str].values})
if self.config.cv_name not in dataset.data_vars: if self.config.cv_name not in dataset.data_vars:
print("Curvature Vorticity not found, trying to compute it out of U and V...") print("Curvature Vorticity not found, trying to compute it out of U and V...")
u_name = get_u_var(dataset)
v_name = get_v_var(dataset)
dataset = compute_cv(dataset, u_name, v_name, self.config.cv_name) dataset = compute_cv(dataset, u_name, v_name, self.config.cv_name)
# make dataset to 2.5 (or same as cv_clim) # make dataset to 2.5 (or same as cv_clim)
dataset = dataset.interp({lat_str: cv_clim.coords[lat_str], lon_str: cv_clim.coords[lon_str]}) dataset = dataset.interp({lat_str: cv_clim.coords[lat_str], lon_str: cv_clim.coords[lon_str]})
# make sure that lat and lon are last two dimensions # make sure that lat and lon are last two dimensions
...@@ -118,12 +141,14 @@ class AEWIdentification(IdentificationTechnique): ...@@ -118,12 +141,14 @@ class AEWIdentification(IdentificationTechnique):
# --------------- DO NUMPY PARALLELIZED STUFF: CREATE TROUGH MASKS # --------------- DO NUMPY PARALLELIZED STUFF: CREATE TROUGH MASKS
u = dataset.u if 'u' in dataset.data_vars else dataset.U u = dataset[u_name]
v = dataset.v if 'v' in dataset.data_vars else dataset.V v = dataset[v_name]
cv = dataset[self.config.cv_name] cv = dataset[self.config.cv_name]
# smooth CV with kernel # smooth CV with kernel
cv = mpcalc.smooth_n_point(cv, n=9, passes=2).metpy.dequantify() cv = mpcalc.smooth_n_point(cv, n=9, passes=2).metpy.dequantify()
# create hourofyear to get anomalies # create hourofyear to get anomalies
cv = cv.assign_coords(hourofyear=cv.time.dt.strftime("%m-%d %H")) cv = cv.assign_coords(hourofyear=cv.time.dt.strftime("%m-%d %H"))
cv_anom = cv.groupby('hourofyear') - cv_clim.cv cv_anom = cv.groupby('hourofyear') - cv_clim.cv
...@@ -139,7 +164,7 @@ class AEWIdentification(IdentificationTechnique): ...@@ -139,7 +164,7 @@ class AEWIdentification(IdentificationTechnique):
perc_mask = perc_mask_h.swap_dims(dims_dict={'hourofyear': 'time'}) perc_mask = perc_mask_h.swap_dims(dims_dict={'hourofyear': 'time'})
cv_perc_thresh = np.nanpercentile(cv, self.config.cv_percentile) # 66th percentile of cv anomalies cv_perc_thresh = np.nanpercentile(cv, self.config.cv_percentile) # 66th percentile of cv anomalies
print(cv_perc_thresh) # print(cv_perc_thresh)
print('Locating wave troughs...') print('Locating wave troughs...')
# filter the advection field given our conditions: # filter the advection field given our conditions:
...@@ -177,6 +202,8 @@ class AEWIdentification(IdentificationTechnique): ...@@ -177,6 +202,8 @@ class AEWIdentification(IdentificationTechnique):
dataset['lat05'].attrs['units'] = 'degrees_north' dataset['lat05'].attrs['units'] = 'degrees_north'
dataset['lon05'].attrs['units'] = 'degrees_east' dataset['lon05'].attrs['units'] = 'degrees_east'
dataset = dataset.drop_dims('step') # TODO REMOVE
return dataset return dataset
def identify(self, data_chunk: xr.Dataset, **kwargs): def identify(self, data_chunk: xr.Dataset, **kwargs):
......
...@@ -2,7 +2,9 @@ import os.path ...@@ -2,7 +2,9 @@ import os.path
from matplotlib import pyplot as plt from matplotlib import pyplot as plt
import numpy as np import numpy as np
from PIL import Image
import matplotlib import matplotlib
import matplotlib as mpl
import matplotlib.patches as patches import matplotlib.patches as patches
import cartopy.crs as ccrs import cartopy.crs as ccrs
import cartopy.feature as cfeature import cartopy.feature as cfeature
...@@ -10,6 +12,146 @@ from datetime import datetime ...@@ -10,6 +12,146 @@ from datetime import datetime
from enstools.feature.util.data_utils import pb_str_to_datetime from enstools.feature.util.data_utils import pb_str_to_datetime
from pathlib import Path from pathlib import Path
import enstools.feature.identification.african_easterly_waves.configuration as cfg import enstools.feature.identification.african_easterly_waves.configuration as cfg
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER
def get_kitweather_rain_cm():
rgb_colors = []
pathtotxtfile = '/home/iconeps/icon_data/additional_data/colorpalettes/'
filename_colorpalette = 'colorpalette_dyamond_prec_rate.txt'
with open(pathtotxtfile + filename_colorpalette, 'r') as f:
lines = f.readlines()
for i, line in enumerate(lines):
rgb_colors.append([float(line[0:3])/255, float(line[4:7])/255, float(line[8:11])/255, 1])
rgb_colors = [[1, 1, 1, 0]] + rgb_colors + [[0.35, 0, 0.4, 1]]
cmap = mpl.colors.ListedColormap(rgb_colors[1:-1]) # , name=colorpalette
cmap = cmap.with_extremes(bad='white', under=rgb_colors[0], over=rgb_colors[-1])
levels = [0.1,0.2,0.3,0.5,1,2,3,5,10,20,30,50]
norm = mpl.colors.BoundaryNorm(levels, cmap.N)
return levels, cmap, norm
def crop_top_bottom_whitespace(path):
# pixels from image left where a vertical column is scanned from top and bottom for non-white pixels
x_scan_position = 450
add_bottom_delta = 20
im = Image.open(path)
image_array_y = np.where(np.asarray(im.convert('L')) < 255, 1, 0)[:, x_scan_position]
vmargins = [np.where(image_array_y[2:] == 1)[0][0] + 2 + 1,
image_array_y[:-2].shape[0] - np.where(image_array_y[:-2] == 1)[0][-1] + 2]
im_cropped = Image.new('RGBA',(im.size[0], im.size[1] - vmargins[0] - vmargins[1] + add_bottom_delta), (0, 0, 0, 0))
im_cropped.paste(im.crop((0, vmargins[0], im.size[0], im.size[1] - vmargins[1] + add_bottom_delta)), (0, 0))
im.close()
im_cropped.save(path, 'png')
im_cropped.close()
return
## MAIN PLOTTING FUNC FOR KITWEATHER PLOTS
def plot_ts_filtered_waves(wts_part_of_tracks, fig_name, ds=None, tp=None):
from timeit import default_timer as timer
t1 = timer()
resolution = 1600
cbar_space_px = 80
subplotparameters = mpl.figure.SubplotParams(left=0, bottom=0, right=1 - cbar_space_px / resolution, top=1,
wspace=0, hspace=0)
fig, ax = plt.subplots(figsize=(resolution / 100, resolution / 100),
dpi=100,
subplotpars=subplotparameters,
subplot_kw=dict(projection = ccrs.PlateCarree()))
extent = [-100, 35, -10, 35]
levels_rain, rain_cm, norm = get_kitweather_rain_cm()
distance_plot_to_cbar = 0.010
axins = ax.inset_axes([1 + distance_plot_to_cbar, 0.05, 0.015, 0.93],
transform=ax.transAxes)
ticks_list = levels_rain
cbar = fig.colorbar(mpl.cm.ScalarMappable(cmap=rain_cm, norm=norm),
cax=axins, extend='both', extendfrac=0.03,
ticks=ticks_list)
axins.text(0.5, -0.06, 'mm/hr', transform=axins.transAxes,
horizontalalignment='left', verticalalignment='center')
t2 = timer()
if ds is not None:
# print("Before dec")
# streamplot_func = _add_transform_first_to_streamplot(ds.plot.streamplot)
# print("After dec")
ds.plot.streamplot(x='lon', y='lat', u='u', v='v', linewidth=0.6,
arrowsize = 0.5,
density=6,
color='black') # , transform_first=True not working, or is already implemented. still slow.
t3 = timer()
if tp is not None:
# transform to mm
tp.plot.contourf(levels=levels_rain, extend='max', subplot_kws={'transform_first': True},
cmap=rain_cm, norm=norm, add_colorbar=False)
t4 = timer()
# generate plot per pressure level, per time step
for obj_idx, node in enumerate(wts_part_of_tracks):
line_pts = node.object.properties.line_pts
line = patches.Path([[p.lon, p.lat] for p in line_pts])
patch = patches.PathPatch(line, linewidth=3, facecolor='none', edgecolor='crimson') # cmap(time_weight)
ax.add_patch(patch)
t5 = timer()
# ax.coastlines()
ax.add_feature(cfeature.BORDERS.with_scale('50m'), linewidth=0.3)
ax.add_feature(cfeature.COASTLINE.with_scale('50m'), linewidth=0.3)
ax.set_extent(extent, crs=ccrs.PlateCarree())
ax.add_feature(cfeature.LAND.with_scale('50m'), facecolor=list(np.array([255, 225, 171])/255))
ax.get_xaxis().set_ticklabels([])
ax.get_yaxis().set_ticklabels([])
gl = ax.gridlines(crs=ccrs.PlateCarree(), draw_labels=True, linewidth=0.5, color='gray', alpha=0.5, linestyle='--')
gl.top_labels = False
gl.right_labels = False
gl.xformatter = LONGITUDE_FORMATTER
gl.yformatter = LATITUDE_FORMATTER
ax.set_title("")
fig.tight_layout()
plt.savefig(fig_name, format='png', backend='agg')
plt.figure().clear()
plt.close()
plt.cla()
plt.clf()
crop_top_bottom_whitespace(fig_name)
t6 = timer()
"""
print("Init: " + str(t2 - t1))
print("Streamplot: " + str(t3 - t2))
print("Rain: " + str(t4 - t3))
print("Wavetroughs: " + str(t5 - t4))
print("Finalize: " + str(t6 - t5))
print("Saved to " + fig_name)
exit()
"""
print("Saved to " + fig_name)
return
# plots the wave state (all wavetroughs given specific timestep in a set) ts: pb2.Timestep # plots the wave state (all wavetroughs given specific timestep in a set) ts: pb2.Timestep
def plot_wavetroughs(ts, fig_name, cv=None): def plot_wavetroughs(ts, fig_name, cv=None):
...@@ -127,14 +269,10 @@ def plot_track(track, fn): ...@@ -127,14 +269,10 @@ def plot_track(track, fn):
return figure_name return figure_name
from collections import defaultdict from collections import defaultdict
def plot_differences(set_graph, tracks, cv=None): # TODO CV too? def plot_differences(set_graph, tracks, ds=None, tp=None, plot_prefix=None):
# plot the differences of the total graph and the tracks # plot the differences of the total graph and the tracks
# so check which WTs are part of a track and which have been dropped. # so check which WTs are part of a track and which have been dropped.
# TODO
# join tracks list
# set_graph elements not in tracks
# for eaach timestep plot two mengen
set_nodes = [e.parent for e in set_graph.graph.edges] set_nodes = [e.parent for e in set_graph.graph.edges]
is_in_set_nodes = [False] * len(set_nodes) is_in_set_nodes = [False] * len(set_nodes)
...@@ -168,61 +306,28 @@ def plot_differences(set_graph, tracks, cv=None): # TODO CV too? ...@@ -168,61 +306,28 @@ def plot_differences(set_graph, tracks, cv=None): # TODO CV too?
dates_list = list(dates) dates_list = list(dates)
dates_list.sort() dates_list.sort()
for date in dates_list: if plot_prefix is None:
fig_name = cfg.plot_dir + "part_of_wave_" + date.replace(':', '_') + ".png" plot_prefix = cfg.plot_dir
cv_ss = cv.sel(time=date) # create subdirs if needed
plot_ts_part_of_track(wts_in_tracks[date], wts_not_in_tracks[date], fig_name, cv_ss) plot_dir = '/'.join(plot_prefix.split('/')[:-1]) + '/'
os.makedirs(plot_dir, exist_ok=True)
def plot_ts_part_of_track(wts_part_of_tracks, wt_not_part_of_tracks, fig_name, cv=None):
fig, ax = plt.subplots(nrows=1, ncols=1, figsize=(11, 4), subplot_kw=dict(projection=ccrs.PlateCarree()))
x_ticks = [-100, -95, -85, -75, -65, -55, -45, -35, -25, -15, -5, 5, 15, 25, 35]
y_ticks = [0, 10, 20, 30]
extent = [-100, -45, -10, 35]
if cv is not None:
levelfc = np.asarray([0, 0.5, 1, 2, 3]) * 1e-5
cv.plot.contourf(levels=levelfc, vmin=0, extend='max', cmap='Blues')
# generate plot per pressure level, per time step
# colors per time step
# min_time = wave_thr_list[0].time.astype('float64')
# max_time = wave_thr_list[-1].time.astype('float64')
# cmap = matplotlib.cm.get_cmap('rainbow')
# color_wgts = np.linspace(0.0, 1.0, len(wave_thr_list))
# colors = ['red', 'yellow', 'green', 'blue', 'purple']
for obj_idx, node in enumerate(wts_part_of_tracks):
line_pts = node.object.properties.line_pts
line = patches.Path([[p.lon, p.lat] for p in line_pts])
patch = patches.PathPatch(line, linewidth=2, facecolor='none', edgecolor='lime') # cmap(time_weight)
ax.add_patch(patch)
for obj_idx, node in enumerate(wt_not_part_of_tracks):
line_pts = node.object.properties.line_pts
line = patches.Path([[p.lon, p.lat] for p in line_pts])
patch = patches.PathPatch(line, linewidth=2, facecolor='none', edgecolor='red') # cmap(time_weight)
ax.add_patch(patch)
ax.coastlines() for date in dates_list:
ax.add_feature(cfeature.BORDERS.with_scale('50m')) fig_name = plot_prefix + date[0:4] + date[5:7] + date[8:10] + "T" + date[11:13] + ".png"
ax.set_extent(extent, crs=ccrs.PlateCarree()) ds_ss = ds.sel(time=date)
yt1 = ax.set_yticks(y_ticks, crs=ccrs.PlateCarree()) try:
xt1 = ax.set_xticks(x_ticks, crs=ccrs.PlateCarree()) tp_ss = tp.sel(time=date).tp
print("Save to " + fig_name) except (KeyError, AttributeError) as e:
plt.savefig(fig_name, format='png') print("No rain data for " + str(date))
tp_ss = None
plt.figure().clear() plot_ts_filtered_waves(wts_in_tracks[date], fig_name, ds=ds_ss, tp=tp_ss) # wts_not_in_tracks[date],
plt.close() # except KeyError:
plt.cla() # print("No rain data for " + str(date))
plt.clf()
# tp_ss = None
# plot_ts_part_of_track(wts_in_tracks[date], wts_not_in_tracks[date], fig_name, ds=ds_ss, tp=tp_ss)
return
def plot_track_from_graph(track_desc, fig_name_prefix, cv=None): def plot_track_from_graph(track_desc, fig_name_prefix, cv=None):
......
...@@ -2,13 +2,109 @@ ...@@ -2,13 +2,109 @@
import numpy as np import numpy as np
import xarray as xr import xarray as xr
import metpy.calc as mpcalc import math
import itertools from enstools.feature.util.enstools_utils import get_u_var, get_v_var, get_vertical_dim, get_longitude_dim, \
get_latitude_dim
# calculates the dx's and dy's for each grid cell
# takes list of latitudes and longitudes as input and returns field with dimensions len(lats) x len(lons)
def calculate_dx_dy(lats, lons):
lat_res = lats[1] - lats[0]
lon_res = lons[1] - lons[0]
nlat = len(lats)
nlon = len(lons)
lon_percent = (lon_res * nlon) / 360.0 # percentage of global longitudes. e.g. if 110W to 70E -> 0.5
lat_percent = (lat_res * nlat) / 180.0 # percentage of global latitudes
Re = 6378100
# field filled with the latitude value at each grid point
lat_f = np.tile(lats, (nlon, 1)).transpose()
# field filled with the longitude value at each grid point
lon_f = np.tile(lons, (nlat, 1))
# dx: circumference at current latitude * percentage of longitudes in dataset / amount of lon grid points
dx = np.cos(lat_f * math.pi / 180.0) * 2.0 * math.pi * Re * lon_percent / nlon
# dy: constant everywhere: half circumference * latitude percentage / amount of lat points
dy = (lat_f * 0) + lat_percent * math.pi * Re / nlat
return dx, dy
from matplotlib import pyplot as plt def compute_cv(dataset, u_str, v_str, cv_str):
import cartopy.crs as ccrs xr.set_options(keep_attrs=True) # assign coords keeps attributes
import cartopy.feature as cfeature
lon_str = get_longitude_dim(dataset)
lat_str = get_latitude_dim(dataset)
lats = dataset.coords[lat_str].data
lons = dataset.coords[lon_str].data
# be careful if your data is non-continuous by the chosen window (e.g. +120E..-120W)
# reorder axis for efficient numpy broadcasting
dataset = dataset.sortby(lat_str)
dataset = dataset.transpose(..., lat_str, lon_str)
dataset[cv_str] = xr.zeros_like(dataset[u_str], dtype=float)
dataset[cv_str].attrs = {'long_name': "Curvature Vorticity", 'units': "s**-1"}
# calculate dx and dy for each cell in grid in meters
dx, dy = calculate_dx_dy(lats, lons)
# Relative Vorticity = dv/dx - du/dy, use central differences
u_arr = dataset[u_str].data
v_arr = dataset[v_str].data
ndims = u_arr.ndim
# roll axes so we have a reference to each cell's neighbours
# ax[-1] = lon, ax[-2] = lat
# works as expected if longitude band is full 360 degrees. Rolling does exactly that.
v_xp = np.roll(v_arr, -1, axis=ndims - 1) # roll -1 to get +1. v_xp = v(x+1)
v_xm = np.roll(v_arr, 1, axis=ndims - 1)
v_yp = np.roll(v_arr, -1, axis=ndims - 2)
v_ym = np.roll(v_arr, 1, axis=ndims - 2)
u_xp = np.roll(u_arr, -1, axis=ndims - 1) # roll -1 to get +1
u_xm = np.roll(u_arr, 1, axis=ndims - 1)
u_yp = np.roll(u_arr, -1, axis=ndims - 2)
u_ym = np.roll(u_arr, 1, axis=ndims - 2)
# central differences: (V(x+1)-V(x-1)) / 2x - (U(y+1)-U(y-1)) / 2y
RV = ((v_xp - v_xm) / (2 * dx)) - ((u_yp - u_ym) / (2 * dy))
# results verified to ERA5 vo-data
# split into shear + curvature: RV = -dV/dn + V/R
# shear vorticity:
# rate of change of wind speed in the direction of flow
# -dV/dn
# wind direction of this cell
ref_angle = np.arctan2(v_arr, u_arr)
### METHOD 1 ### from analytical standpoint
sin_angle = np.sin(ref_angle)
cos_angle = np.cos(ref_angle)
# here is where the magic happens...
# to cartesian: dV/dn = - dV/dx * sin(phi) + dV/dy * cos(phi) ## n is normal to V, split it into x,y respecting the
# n-direction, where phi is the rotation angle of the natural coordinate system, this also is the angle of the
# wind vector
#
# we get the magnitude of shear as the projection of dV/dn onto the vector itself (direction e_t)
# with e_t = cos(phi)*e_x + sin(phi)*e_y , so:
# dV/dn * e_t = du/dx * (-sin*cos) + du/dy cos^2 + dv/dx *(-sin^2) + dv/dy (cos*sin)
SV = (u_xp - u_xm) / (2 * dx) * (-sin_angle * cos_angle) + \
(u_yp - u_ym) / (2 * dy) * (cos_angle ** 2) + \
(v_xp - v_xm) / (2 * dx) * (-(sin_angle ** 2)) + \
(v_yp - v_ym) / (2 * dy) * (sin_angle * cos_angle)
SV = -SV # -dV/dn
# remainder is CV
CV = RV - SV
dataset[cv_str].values = CV
xr.set_options(keep_attrs='default') # assign coords keeps attributes
return dataset
import math import math
from enstools.feature.util.enstools_utils import get_u_var, get_v_var, get_vertical_dim, get_longitude_dim, \ from enstools.feature.util.enstools_utils import get_u_var, get_v_var, get_vertical_dim, get_longitude_dim, \
...@@ -137,7 +233,8 @@ def populate_object(obj_props, path): ...@@ -137,7 +233,8 @@ def populate_object(obj_props, path):
max_lat = v[1] max_lat = v[1]
if v_idx > 0: if v_idx > 0:
dist_deg = dist_deg + (((path.vertices[v_idx - 1][0] - v[0]) ** 2 + (path.vertices[v_idx - 1][1] - v[1]) ** 2) ** 0.5) dist_deg = dist_deg + (
((path.vertices[v_idx - 1][0] - v[0]) ** 2 + (path.vertices[v_idx - 1][1] - v[1]) ** 2) ** 0.5)
# bounding box # bounding box
obj_props.bb.min.lat = min_lat obj_props.bb.min.lat = min_lat
...@@ -149,5 +246,3 @@ def populate_object(obj_props, path): ...@@ -149,5 +246,3 @@ def populate_object(obj_props, path):
# identify troughs in data (should contain U,V,cv), based on the cv climatology # identify troughs in data (should contain U,V,cv), based on the cv climatology
# def identify_troughs(data, cv_clim, cfg): # def identify_troughs(data, cv_clim, cfg):
#!/usr/bin/env python
# Usage Example # Usage Example
from enstools.feature.pipeline import FeaturePipeline from enstools.feature.pipeline import FeaturePipeline
from enstools.feature.identification.african_easterly_waves import AEWIdentification from enstools.feature.identification.african_easterly_waves import AEWIdentification
from enstools.feature.tracking.african_easterly_waves import AEWTracking from enstools.feature.tracking.african_easterly_waves import AEWTracking
from datetime import timedelta from datetime import timedelta, datetime
from enstools.feature.identification._proto_gen import african_easterly_waves_pb2 from enstools.feature.identification._proto_gen import african_easterly_waves_pb2
from os.path import expanduser, join from os.path import expanduser, join
from enstools.feature.util.graph import DataGraph from enstools.feature.util.graph import DataGraph
from enstools.feature.identification.african_easterly_waves.plotting import plot_differences, plot_track, plot_track_in_ts, plot_timesteps_from_desc, plot_tracks_from_desc from enstools.feature.identification.african_easterly_waves.plotting import plot_differences, plot_track, plot_track_in_ts, plot_timesteps_from_desc, plot_tracks_from_desc
import enstools.feature.identification.african_easterly_waves.configuration as cfg import enstools.feature.identification.african_easterly_waves.configuration as cfg
import sys import os, sys, glob, shutil
from enstools.feature.util.data_utils import get_subset_by_description from enstools.feature.util.data_utils import get_subset_by_description
import xarray as xr
xr.set_options(keep_attrs=True)
import numpy as np
from pprint import pprint
pipeline = FeaturePipeline(african_easterly_waves_pb2, processing_mode='2d') pipeline = FeaturePipeline(african_easterly_waves_pb2, processing_mode='2d')
# in_files_all_cv_data = cfg.cv_data_ex # in_files_all_cv_data = cfg.cv_data_ex
in_file = cfg.in_files
out_dir = cfg.out_dir
if len(sys.argv) > 1: if len(sys.argv) >= 3 and sys.argv[1] == '-kw':
proc_summer_of_year = int(sys.argv[1]) from kwutil import *
if len(sys.argv) > 2: print("Executing in kitweather mode...")
proc_month_of_year = int(sys.argv[2]) # kitweather: use last 7 days of analysis and the ecmwf forecast
run = None
if len(sys.argv) == 4:
run = sys.argv[3]
if sys.argv[2] == 'ecmwf_fc':
ds, run = get_ecmwf_forecast(run=run, include_analysis_delta=cfg.timedelta_ana, add_prec_rate=True)
elif sys.argv[2] == 'icon_fc':
ds, run = get_icon_forecast(run=run, include_analysis_delta=cfg.timedelta_ana, add_prec_rate=True)
elif sys.argv[2] == 'gfs_fc':
ds, run = get_gfs_forecast(run=run, include_analysis_delta=cfg.timedelta_ana, add_prec_rate=True)
else:
print("Unknown command line parameter " + sys.argv[2] + ", expected ecmwf_fc or icon_fc.")
exit(1)
data_ds = ds[0]
rain_ds = None if len(ds) == 1 else ds[1]
print("Done collecting files.")
pipeline.set_data(data_ds)
else:
in_file = cfg.in_files
out_dir = cfg.out_dir
pipeline.set_data_path(in_file)
# init AEWIdentification strategy, can take different parameters # init AEWIdentification strategy, can take different parameters
i_strat = AEWIdentification(wt_out_file=False, cv='cv') # , year_summer=proc_summer_of_year, month=proc_month_of_year) i_strat = AEWIdentification(wt_out_file=False, cv='cv') # , year_summer=proc_summer_of_year, month=proc_month_of_year)
t_strat = AEWTracking() t_strat = AEWTracking()
...@@ -29,14 +59,13 @@ t_strat = AEWTracking() ...@@ -29,14 +59,13 @@ t_strat = AEWTracking()
pipeline.set_identification_strategy(i_strat) pipeline.set_identification_strategy(i_strat)
pipeline.set_tracking_strategy(t_strat) pipeline.set_tracking_strategy(t_strat)
pipeline.set_data_path(in_file)
# execute pipeline # execute pipeline
pipeline.execute() pipeline.execute()
od = pipeline.get_object_desc() od = pipeline.get_object_desc()
for trackable_set in od.sets: for trackable_set in od.sets:
# generate graph out of tracked data # generate graph out of tracked data
g = DataGraph(trackable_set, t_strat) g = DataGraph(trackable_set, t_strat)
...@@ -46,7 +75,7 @@ for trackable_set in od.sets: ...@@ -46,7 +75,7 @@ for trackable_set in od.sets:
tracks = g.set_desc.tracks tracks = g.set_desc.tracks
# parents of a node: track.get_parents(track.graph.edges[0].parent) # parents of a node: track.get_parents(track.graph.edges[0].parent)
# childs of a node: track.get_childs(track.graph.edges[0].parent) # children of a node: track.get_children(track.graph.edges[0].parent)
# plot tracks # plot tracks
for track_id, track in enumerate(tracks): for track_id, track in enumerate(tracks):
...@@ -58,9 +87,40 @@ for trackable_set in od.sets: ...@@ -58,9 +87,40 @@ for trackable_set in od.sets:
plot_differences(g, tracks, cv=ds_set.cv) plot_differences(g, tracks, cv=ds_set.cv)
# no out data besides plots on kitweather
if sys.argv[1] == '-kw':
# delete old plots
subdirs = [dI for dI in os.listdir(plot_dir) if os.path.isdir(os.path.join(plot_dir,dI))]
for sd in subdirs: # for each subdir in plot dir
# out_netcdf_path = data_path + '_streamers.nc' if not sd == run and datetime.fromtimestamp(os.path.getmtime(os.path.join(plot_dir, sd))) < datetime.now() - timedelta(days=7): # not touched in a week? delete it.
print("Removing directory " + str(os.path.join(plot_dir, sd)))
shutil.rmtree(os.path.join(plot_dir, sd))
# All done. Update text file containing time of latest finished run.
if os.path.exists(cfg.plot_dir_ecmwf + run) and os.path.exists(cfg.plot_dir_icon + run) and os.path.exists(cfg.plot_dir_gfs + run):
print("Run " + run + " done for ECMWF, ICON, GFS. Update latest run info file.")
yyyymmddhh = run[4:]
latest_run_file_path = cfg.latest_run_dir + cfg.latest_run_info_file_name
with open(latest_run_file_path, 'w+') as info_file:
info_file.write(yyyymmddhh)
# All done. scp data over to webserver.
# TODO when port 22 free test.
# TODO improve plotting performance
"""
path_webserver = '/home/iconeps/Data3/plots/ecmwf/aew_prediction_maps/'
print('scp -r ' + cfg.plot_dir + time_dir + '/ ' + 'iconeps@imk-tss-web.imk-tro.kit.edu:' + path_webserver)
os.system('scp -r ' + cfg.plot_dir + time_dir + '/ ' + 'iconeps@imk-tss-web.imk-tro.kit.edu:' + path_webserver)
os.system('scp ' + cfg.latest_run_info_file + ' iconeps@imk-tss-web.imk-tro.kit.edu:' + path_webserver)
"""
exit()
# out_netcdf_path = data_path + '_streamers.nc'
"""
if len(sys.argv) == 1: if len(sys.argv) == 1:
out_json_path = out_dir + 'aew_desc.json' out_json_path = out_dir + 'aew_desc.json'
out_dataset_path = out_dir + '05_wt.nc' out_dataset_path = out_dir + '05_wt.nc'
...@@ -72,12 +132,6 @@ else: ...@@ -72,12 +132,6 @@ else:
out_json_path = out_dir + 'aew_desc_' + str(proc_summer_of_year) + '_' + m_str + '.json' out_json_path = out_dir + 'aew_desc_' + str(proc_summer_of_year) + '_' + m_str + '.json'
out_dataset_path = out_dir + '05_wt_' + str(proc_summer_of_year) + '_' + m_str + '.nc' out_dataset_path = out_dir + '05_wt_' + str(proc_summer_of_year) + '_' + m_str + '.nc'
"""
pipeline.save_result(description_type='json', description_path=out_json_path) # , dataset_path=out_dataset_path) # dataset_path=out_dataset_path, pipeline.save_result(description_type='json', description_path=out_json_path) # , dataset_path=out_dataset_path) # dataset_path=out_dataset_path,
# , description_path=out_json_path, graph_path=out_graph_path
# print("Plot.")
# plot_timesteps_from_desc(od, pipeline.get_data())
# plot_tracks_from_desc(od, None)
...@@ -43,11 +43,11 @@ message GraphNode { ...@@ -43,11 +43,11 @@ message GraphNode {
} }
/* Connections of the tracking graph. A connection is defined as one node (parent, the key object), /* Connections of the tracking graph. A connection is defined as one node (parent, the key object),
and all to its connected nodes. (list of childs, typically of the consecutive timestep) and all to its connected nodes. (list of children, typically of the consecutive timestep)
*/ */
message GraphConnection { message GraphConnection {
required GraphNode parent = 1; required GraphNode parent = 1;
repeated GraphNode childs = 2; repeated GraphNode children = 2;
} }
/* The tracking graph is defined by a set of above connections. /* The tracking graph is defined by a set of above connections.
......
...@@ -3,6 +3,7 @@ import google ...@@ -3,6 +3,7 @@ import google
import numpy as np import numpy as np
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
import xarray as xr import xarray as xr
from datetime import datetime
import bisect import bisect
import logging import logging
from enstools.feature.util.data_utils import SplitDimension, print_lock from enstools.feature.util.data_utils import SplitDimension, print_lock
...@@ -10,10 +11,10 @@ from itertools import product ...@@ -10,10 +11,10 @@ from itertools import product
from enstools.feature.util.data_utils import get_split_dimensions, get_time_split_dimension from enstools.feature.util.data_utils import get_split_dimensions, get_time_split_dimension
class IdentificationTechnique(ABC): class IdentificationStrategy(ABC):
""" """
Base abstract class for new feature identification algorithms. Need to implement abstract methods precompute, Base abstract class for new feature identification algorithms. Need to implement abstract methods precompute,
identify and postprocess. An identification technique gets called for a dataset. The dataset is split along identify and postprocess. An identification strategy gets called for a dataset. The dataset is split along
dimensions to parallelize the identification. The abstract method identify() is called for each spatial block of the dimensions to parallelize the identification. The abstract method identify() is called for each spatial block of the
dataset (2D, 3D), for example for each timestamp and for each ensemble member, and if processing_mode is set to dataset (2D, 3D), for example for each timestamp and for each ensemble member, and if processing_mode is set to
'2d' also for each level. Beforehand, precompute() is called once, here one-time precomputations can be done. '2d' also for each level. Beforehand, precompute() is called once, here one-time precomputations can be done.
...@@ -80,11 +81,22 @@ class IdentificationTechnique(ABC): ...@@ -80,11 +81,22 @@ class IdentificationTechnique(ABC):
------- -------
The (altered) data block. The (altered) data block.
""" """
# get order of dimensions to re-order them after
dim_orders = dict()
for v in data_block.data_vars:
dim_orders[v] = data_block[v].dims
# called in parallel from map_blocks # called in parallel from map_blocks
split_dims = kwargs.keys() split_dims = kwargs.keys()
split_string = '; '.join([str(dim) + ": " + str(data_block.coords[dim].data[0]) for dim in split_dims]) split_string = ''
print_lock("Start processing data block with dimensions: " + split_string) for dim in split_dims:
dim_val = data_block.coords[dim].data[0]
if isinstance(dim_val, np.datetime64):
dt = datetime.utcfromtimestamp(dim_val.astype('O') / 1e9)
dim_val = dt.replace(microsecond=0).isoformat()
split_string += str(dim) + ":" + str(dim_val) + " \t"
# split_string = '; '.join([str(dim) + ": " + str(data_block.coords[dim].data[0]) for dim in split_dims])
print_lock("Start processing data block with dimensions:\t" + split_string)
# get mapping which data fields' coords are getting squeezed (time, ens, ...). some fields may not have them all. # get mapping which data fields' coords are getting squeezed (time, ens, ...). some fields may not have them all.
squeeze_da_dim = [] squeeze_da_dim = []
...@@ -95,13 +107,17 @@ class IdentificationTechnique(ABC): ...@@ -95,13 +107,17 @@ class IdentificationTechnique(ABC):
data_block[da_str] = data_block[da_str].squeeze(dim=[split_dim]) data_block[da_str] = data_block[da_str].squeeze(dim=[split_dim])
access_indices = index_accessor.values.item() access_indices = index_accessor.values.item()
data_block, object_block = self.identify(data_block) data_block, object_block = self.identify(data_block)
self.pb_dataset.sets[access_indices[0]].timesteps[access_indices[1]].objects.extend(object_block) self.pb_dataset.sets[access_indices[0]].timesteps[access_indices[1]].objects.extend(object_block)
for unsqueeze_da, unsqueeze_dim in squeeze_da_dim: for unsqueeze_da, unsqueeze_dim in squeeze_da_dim:
data_block[unsqueeze_da] = data_block[unsqueeze_da].expand_dims(dim=unsqueeze_dim) data_block[unsqueeze_da] = data_block[unsqueeze_da].expand_dims(dim=unsqueeze_dim)
# restore dim order
for v in data_block.data_vars:
data_block[v] = data_block[v].transpose(*(dim_orders[v]))
return data_block return data_block
def execute(self, dataset: xr.Dataset, **kwargs): def execute(self, dataset: xr.Dataset, **kwargs):
...@@ -124,8 +140,8 @@ class IdentificationTechnique(ABC): ...@@ -124,8 +140,8 @@ class IdentificationTechnique(ABC):
# build meta data for protobuf structure # build meta data for protobuf structure
if not hasattr(self, 'pb_reference'): if not hasattr(self, 'pb_reference'):
print("The protobuf type has not been set in the ID technique.") print("The protobuf type has not been set in the ID strategy.")
print("Check the templates, the IdentificationTechnique.__init__() needs to set the pb2 type.") print("Check the templates, the IdentificationStrategy.__init__() needs to set the pb2 type.")
exit(1) exit(1)
self.pb_dataset = self.pb_reference.DatasetDescription() self.pb_dataset = self.pb_reference.DatasetDescription()
...@@ -134,6 +150,7 @@ class IdentificationTechnique(ABC): ...@@ -134,6 +150,7 @@ class IdentificationTechnique(ABC):
prec_ds = self.precompute(dataset) prec_ds = self.precompute(dataset)
if prec_ds is not None: if prec_ds is not None:
dataset = prec_ds dataset = prec_ds
print("Precomputation done.")
# from enstools.misc import get_ensemble_dim, get_time_dim # from enstools.misc import get_ensemble_dim, get_time_dim
# from enstools.feature.util.enstools_utils import get_vertical_dim, get_init_time_dim # from enstools.feature.util.enstools_utils import get_vertical_dim, get_init_time_dim
...@@ -216,6 +233,7 @@ class IdentificationTechnique(ABC): ...@@ -216,6 +233,7 @@ class IdentificationTechnique(ABC):
# map the blocks, computation here # map the blocks, computation here
mb = xr.map_blocks(self.identify_block, ds_rechunked, args=[index_field], kwargs=dict_split_arrays, mb = xr.map_blocks(self.identify_block, ds_rechunked, args=[index_field], kwargs=dict_split_arrays,
template=ds_rechunked) template=ds_rechunked)
print("Start")
ds_mapped = mb.compute() # num_workers=4 ds_mapped = mb.compute() # num_workers=4
# postprocess # postprocess
......
...@@ -11,7 +11,7 @@ from enstools.feature.util.graph import DataGraph ...@@ -11,7 +11,7 @@ from enstools.feature.util.graph import DataGraph
# set the pb_reference to the compiled pb2.py file (see proto_gen directory) # set the pb_reference to the compiled pb2.py file (see proto_gen directory)
pipeline = FeaturePipeline(overlap_example_pb2, processing_mode='3d') pipeline = FeaturePipeline(overlap_example_pb2, processing_mode='3d')
# change this to an identification technique that actually does something: existing one or implement your own # change this to an identification strategy that actually does something: existing one or implement your own
i_strat = OverlapIdentificationExample() # set the Identification strategy i_strat = OverlapIdentificationExample() # set the Identification strategy
t_strat = OverlapTracking(field_name='identified_areas') # set the tracking strategy t_strat = OverlapTracking(field_name='identified_areas') # set the tracking strategy
...@@ -37,7 +37,7 @@ for set in od.sets: # for each set, e.g. each ensemble member, or each level ...@@ -37,7 +37,7 @@ for set in od.sets: # for each set, e.g. each ensemble member, or each level
for track in set.tracks: # for each identified track (run generate_tracks beforehand) for track in set.tracks: # for each identified track (run generate_tracks beforehand)
single_track_graph = DataGraph(track, overlap_example_pb2) # track as data graph (basically subgraph of above) single_track_graph = DataGraph(track, overlap_example_pb2) # track as data graph (basically subgraph of above)
# single_track_graph.get_parents(some node...) # single_track_graph.get_parents(some node...)
# single_track_graph.get_childs(some node...) # single_track_graph.get_children(some node...)
pipeline.save_result(description_type='json', description_path=out_graph_path, pipeline.save_result(description_type='json', description_path=out_graph_path,
......
from ..identification import IdentificationTechnique from ..identification import IdentificationStrategy
import xarray as xr import xarray as xr
from random import randrange from random import randrange
import datetime import datetime
class OverlapIdentificationExample(IdentificationTechnique): class OverlapIdentificationExample(IdentificationStrategy):
def __init__(self, some_parameter='', **kwargs): def __init__(self, some_parameter='', **kwargs):
# Constructor. Called from example_template.py, parameters can be passed and set here. # Constructor. Called from example_template.py, parameters can be passed and set here.
......
from enstools.feature.identification.pv_streamer.processing import * from enstools.feature.identification.pv_streamer.processing import *
from enstools.feature.identification import IdentificationTechnique from enstools.feature.identification import IdentificationStrategy
import xarray as xr import xarray as xr
import numpy as np import numpy as np
import copy import copy
...@@ -7,7 +7,7 @@ from enstools.feature.identification.pv_streamer.object_desc import get_object_d ...@@ -7,7 +7,7 @@ from enstools.feature.identification.pv_streamer.object_desc import get_object_d
from enstools.feature.identification.pv_streamer.projection_cdo import project_latlon_to_stereo, project_stereo_to_latlon from enstools.feature.identification.pv_streamer.projection_cdo import project_latlon_to_stereo, project_stereo_to_latlon
class PVIdentification(IdentificationTechnique): class PVIdentification(IdentificationStrategy):
def __init__(self, unit='pv', mode_2d_layer=None, theta_range=None, extract_containing=None, centroid_lat_thr=None, def __init__(self, unit='pv', mode_2d_layer=None, theta_range=None, extract_containing=None, centroid_lat_thr=None,
out_type='stereo', **kwargs): out_type='stereo', **kwargs):
......
from ..identification import IdentificationTechnique from ..identification import IdentificationStrategy
from enstools.feature.identification.pv_streamer.data_util import get_pv_field_name from enstools.feature.identification.pv_streamer.data_util import get_pv_field_name
import xarray as xr import xarray as xr
...@@ -7,7 +7,7 @@ import numpy as np ...@@ -7,7 +7,7 @@ import numpy as np
from shutil import copyfile from shutil import copyfile
# wrapper calling Wernli Sprenger 2007 identification written in Fortran. # wrapper calling Wernli Sprenger 2007 identification written in Fortran.
class PVWernliSprenger2007(IdentificationTechnique): class PVWernliSprenger2007(IdentificationStrategy):
def __init__(self, unit='pv', level=0, **kwargs): def __init__(self, unit='pv', level=0, **kwargs):
# put custom args # put custom args
......