Skip to content

Make GeoTrackNet more flexible #35

@mar3021

Description

@mar3021

Allow calculation of bins, without user having to define them. GeoTrackNet requires bins for lat, lon, sog, cog. All our mobiml datasets have lat, lon, but not all have sog, cog (although sog, cog could be calculated). Allow user to add another parameter. Please see code snippet below for definition of bins for calculating AIS mean for GeoTrackNet that ideally should be avoided in the future:

LAT_BINS = 100; LON_BINS = 200; SOG_BINS = 30; COG_BINS = 72

def sparse_AIS_to_dense(msgs_, num_timesteps, mmsis):
    def create_dense_vect(msg, lat_bins = 100, lon_bins = 200, sog_bins = 30 , cog_bins = 72):
        lat, lon, sog, cog = msg[0], msg[1], msg[2], msg[3]
        data_dim = lat_bins + lon_bins + sog_bins + cog_bins
        dense_vect = np.zeros(data_dim)
        dense_vect[int(lat*lat_bins)] = 1.0
        dense_vect[int(lon*lon_bins) + lat_bins] = 1.0
        dense_vect[int(sog*sog_bins) + lat_bins + lon_bins] = 1.0
        dense_vect[int(cog*cog_bins) + lat_bins + lon_bins + sog_bins] = 1.0
        return dense_vect
    dense_msgs = []
    for msg in msgs_:
        dense_msgs.append(create_dense_vect(msg,
                                            lat_bins = LAT_BINS,
                                            lon_bins = LON_BINS,
                                            sog_bins = SOG_BINS ,
                                            cog_bins = COG_BINS))
    dense_msgs = np.array(dense_msgs)
    return dense_msgs, num_timesteps, mmsis

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions