Skip to content

07_make_segments_isdb

mike edited this page May 4, 2018 · 1 revision

Maritimes/Mar.utils - Turning ISDB data into SpatialLines

May 2, 2018 - Mike McMahon (mike.mcmahon@dfo-mpo.gc.ca)

make_segments_isdb.r

This function takes a df of the isdb data as stored in ISSETPROFILE_WIDE^*^ and makes a spatialLinesDataFrame which can be plotted. If selected, it can also QC them. Each line will have the following columns in the resulting data frame:

  • FISHSET_ID This uniquely identifies a set
  • QCPOS This field identifies potential issues with the line - including NA positions, positions that are "0", incorrect hemisphere, or impossible coordinates
  • QCTIME This field identifies potential issues with the timing of the vertices making up the line. For example, P2 should occur after P1, and 2 vertices cannot occur simultaneously. Sets less than 5 min or greater than 24 hr are also noted
  • LEN_KM This field shows the calculated distance of the resultant line in kms
  • N_VALID_VERT This field shows how many vertices appear correct after NAs, 0s and othe problematic values have been dropped

To make spatial lines of other data, please check out make_segments().

^*^The format of ISSETPROFILE_WIDE format includes fields FISHSET_ID and LAT1:LAT4 and LONG1:LONG4.

#to simply plot the tracks, you can do this
plot(make_segments_isdb(isdb.df=ISSETPROFILE_WIDE))

# to generate a qc report on the tracks, you can do this
> sets = make_segments_isdb(isdb.df=ISSETPROFILE_WIDE,do.qc = T, return.choice = "notlines")

#I cheated and found an area where the QC shows some variety, and changed the FISHSET_ID to nonsense

     FISHSET_ID              QCTIME         QCPOS    LEN_KM N_VALID_VERT
2219  999996971 No Time between pts Zero_Len Line 0.0000000           NA
2220  999996972 No Time between pts               0.3767921            2
2221  999996973 No Time between pts Zero_Len Line 0.0000000           NA
2222  999996974 No Time between pts Zero_Len Line 0.0000000           NA
2223  999996975 No Time between pts Zero_Len Line 0.0000000           NA
2224  666679489                     Zero_Len Line 0.0000000           NA
2225  666679490                     Zero_Len Line 0.0000000           NA
2226  666679491                     Zero_Len Line 0.0000000           NA
2227  666679492                     Zero_Len Line 0.0000000           NA
2228  666679493                     Zero_Len Line 0.0000000           NA
2229  666679494                     Zero_Len Line 0.0000000           NA
2230  666679495                     Zero_Len Line 0.0000000           NA
2231  666679496                     Zero_Len Line 0.0000000           NA
2232  666679497                     Zero_Len Line 0.0000000           NA
2233  666679398                     Zero_Len Line 0.0000000           NA
2234  666682028                                   0.4586141            2

Plotted ISDB sets

Clone this wiki locally