File transform.jq changed (mode: 100755) (index ce6ddb3..35179f2) |
... |
... |
def as_coord: |
275 |
275 |
interaction: ( .IA | split("|") | |
interaction: ( .IA | split("|") | |
276 |
276 |
map([capture("(?<type>[FMC]{2})(?<animal_id>FB\\d+)"; "g")]) |
map([capture("(?<type>[FMC]{2})(?<animal_id>FB\\d+)"; "g")]) |
277 |
277 |
), |
), |
|
278 |
|
# behavior type and species code |
|
279 |
|
# species code not always present, use input as fallback |
|
280 |
|
behavior: ( .BH | split("|") | |
|
281 |
|
# match() returns "empty" which we can not test with if |
|
282 |
|
map(. as $b | match("[A-C][A-Z]\\d+[A-Z]([\\s\\.]+)?$"; "m")//false | |
|
283 |
|
if . then |
|
284 |
|
{ |
|
285 |
|
type: ($b[0:.offset] | gsub("^\\s+|\\s+$";"") | if (.|length) > 0 then . else null end), |
|
286 |
|
species_code: .string | gsub("^\\s+|\\s+$";"") |
|
287 |
|
} |
|
288 |
|
# fallback without species code |
|
289 |
|
else |
|
290 |
|
{ type: $b | gsub("^\\s+|\\s+$";"") } |
|
291 |
|
end |
|
292 |
|
) |
|
293 |
|
), |
278 |
294 |
# Genus name and species code |
# Genus name and species code |
279 |
295 |
genus: ( .GS | split("|") | |
genus: ( .GS | split("|") | |
280 |
296 |
map(. as $s | match("[A-C][A-Z]\\d+[A-Z](\\s+)?$"; "m") | |
map(. as $s | match("[A-C][A-Z]\\d+[A-Z](\\s+)?$"; "m") | |
File webroot/data.md changed (mode: 100644) (index d053091..9162799) |
1 |
1 |
% Technical notes on the content of the Watkins Marine Mammal Sound Database |
% Technical notes on the content of the Watkins Marine Mammal Sound Database |
2 |
2 |
% |
% |
3 |
|
% Last updated: June 11, 2019 |
|
|
3 |
|
% Last updated: June 14, 2019 |
4 |
4 |
|
|
5 |
5 |
## Download converted data |
## Download converted data |
6 |
6 |
|
|
|
... |
... |
Generally the database is very densely encoded with information due to the DOS-A |
59 |
59 |
| NT | Note | | 4 | 5398 | No | .note | |
| NT | Note | | 4 | 5398 | No | .note | |
60 |
60 |
| DA | Record Date | | 30 | 437 | No | .last_modified_date | |
| DA | Record Date | | 30 | 437 | No | .last_modified_date | |
61 |
61 |
| IP | ID of con present | 15 | | 2 | Yes | | |
| IP | ID of con present | 15 | | 2 | Yes | | |
62 |
|
| BH | Behavior | 2442 | | 48 | No | | |
|
|
62 |
|
| BH | [Behavior](#behavior) | 2442 | | 48 | Yes | .animal.behavior.type | |
|
63 |
|
| | | | | | | .animal.behavior.species_code | |
63 |
64 |
| OS | Other Species | 3995 | | 75 | Yes | | |
| OS | Other Species | 3995 | | 75 | Yes | | |
64 |
65 |
| NA | Number of Animals Vocalizing | 14889 | | 420 | Yes | | |
| NA | Number of Animals Vocalizing | 14889 | | 420 | Yes | | |
65 |
66 |
| GB | Geo B | 13354 | | 362 | | .location.name[] | |
| GB | Geo B | 13354 | | 362 | | .location.name[] | |
|
... |
... |
Generally the database is very densely encoded with information due to the DOS-A |
76 |
77 |
|
|
77 |
78 |
### Examples and Transformations |
### Examples and Transformations |
78 |
79 |
|
|
79 |
|
(TODO) |
|
80 |
|
|
|
81 |
|
#### GS / Genus |
|
82 |
|
|
|
83 |
|
(TODO) |
|
|
80 |
|
(WIP) |
|
81 |
|
|
|
82 |
|
#### Behavior |
|
83 |
|
|
|
84 |
|
> Behavior codes, species code. |
|
85 |
|
|
|
86 |
|
Example values in the database |
|
87 |
|
|
|
88 |
|
``` |
|
89 |
|
[...] |
|
90 |
|
52 Sperm whale surfaced 30m off stern, swam near stern phone and followed along | side of boat up to side hydrophone. |
|
91 |
|
59 Harpooned |
|
92 |
|
61 Feeding at surface BD5A |
|
93 |
|
84 Bow riding BD17A |
|
94 |
|
93 Bow riding BD3B |
|
95 |
|
94 Milling BD6A | Breaching BD6A |
|
96 |
|
101 Feeding BD19D |
|
97 |
|
127 Resting at surface BD4A |
|
98 |
|
156 Social BE7A |
|
99 |
|
166 Travelling BD15A |
|
100 |
|
264 Milling BD15C |
|
101 |
|
319 Courtship AA1A |
|
102 |
|
408 BE7A |
|
103 |
|
``` |
|
104 |
|
|
|
105 |
|
Note lines "Harpooned" and "BE7A", species code or behavior type is not always present. |
|
106 |
|
|
|
107 |
|
Examples of `.animal.behavior[].type` after processing. |
|
108 |
|
|
|
109 |
|
``` |
|
110 |
|
[...] |
|
111 |
|
20 Dive |
|
112 |
|
23 Foraging activity |
|
113 |
|
24 Socializing |
|
114 |
|
47 Surface feeding |
|
115 |
|
52 side of boat up to side hydrophone. |
|
116 |
|
52 Sperm whale surfaced 30m off stern, swam near stern phone and followed along |
|
117 |
|
59 Harpooned |
|
118 |
|
61 Feeding at surface |
|
119 |
|
135 Breaching |
|
120 |
|
156 Social |
|
121 |
|
163 Resting at surface |
|
122 |
|
178 Travelling |
|
123 |
|
191 Bow riding |
|
124 |
|
224 Feeding |
|
125 |
|
362 Milling |
|
126 |
|
366 Courtship |
|
127 |
|
408 null |
|
128 |
|
``` |
|
129 |
|
|
|
130 |
|
Variants in writing ("Surface feeding", "Feeding at surface", etc) are not normalized. |
84 |
131 |
|
|