B:BD[
6.27532] → [
6.27532:27563]
∅:D[
6.27563] → [
5.16069:16144]
B:BD[
4.1137119] → [
5.16069:16144]
B:BD[
4.1137166] → [
4.1137166:1137198]
B:BD[
4.1137198] → [
6.27564:27593]
∅:D[
5.16172] → [
4.1137337:1137356]
∅:D[
6.27593] → [
4.1137337:1137356]
B:BD[
4.1137337] → [
4.1137337:1137356]
B:BD[
4.1137356] → [
6.27594:27625]
∅:D[
5.16202] → [
4.1137499:1137518]
∅:D[
6.27625] → [
4.1137499:1137518]
B:BD[
4.1137499] → [
4.1137499:1137518]
B:BD[
4.1137518] → [
6.27626:27657]
∅:D[
5.16232] → [
4.1137661:1137680]
∅:D[
6.27657] → [
4.1137661:1137680]
B:BD[
4.1137661] → [
4.1137661:1137680]
B:BD[
4.1137680] → [
6.27658:27689]
∅:D[
5.16262] → [
4.1137823:1137842]
∅:D[
6.27689] → [
4.1137823:1137842]
B:BD[
4.1137823] → [
4.1137823:1137842]
B:BD[
4.1137842] → [
6.27690:27737]
∅:D[
5.16292] → [
4.1138101:1138121]
∅:D[
6.27737] → [
4.1138101:1138121]
B:BD[
4.1138101] → [
4.1138101:1138121]
B:BD[
4.1138121] → [
6.27738:27787]
∅:D[
5.16323] → [
4.1138384:1138406]
∅:D[
6.27787] → [
4.1138384:1138406]
B:BD[
4.1138384] → [
4.1138384:1138406]
B:BD[
4.1138406] → [
5.16324:16347]
∅:D[
5.16347] → [
4.1138665:1138787]
B:BD[
4.1138665] → [
4.1138665:1138787]
B:BD[
4.1138787] → [
6.27788:27807]
∅:D[
6.27807] → [
4.1138815:1138832]
B:BD[
4.1138815] → [
4.1138815:1138832]
B:BD[
4.1138832] → [
6.27808:27835]
∅:D[
5.16373] → [
4.1139104:1139122]
∅:D[
6.27835] → [
4.1139104:1139122]
B:BD[
4.1139104] → [
4.1139104:1139122]
B:BD[
4.1139122] → [
6.27836:27854]
∅:D[
6.27875] → [
5.16384:16393]
B:BD[
4.1139185] → [
5.16384:16393]
∅:D[
5.16393] → [
4.1139193:1139211]
B:BD[
4.1139193] → [
4.1139193:1139211]
B:BD[
4.1139211] → [
6.27876:27894]
∅:D[
6.27894] → [
5.16394:16403]
B:BD[
4.1139227] → [
5.16394:16403]
∅:D[
5.16403] → [
4.1139235:1139251]
B:BD[
4.1139235] → [
4.1139235:1139251]
B:BD[
4.1139251] → [
6.27895:27911]
∅:D[
6.27911] → [
5.16404:16413]
B:BD[
4.1139265] → [
5.16404:16413]
B:BD[
5.16413] → [
2.3048:3120]
∅:D[
2.3120] → [
4.1140061:1140118]
∅:D[
5.16499] → [
4.1140061:1140118]
∅:D[
6.28041] → [
4.1140061:1140118]
B:BD[
4.1140061] → [
4.1140061:1140118]
B:BD[
4.1140119] → [
4.1140119:1140130]
B:BD[
4.1140160] → [
4.1140160:1140301]
B:BD[
4.1140301] → [
5.16500:16509]
∅:D[
5.16509] → [
4.1140308:1140312]
B:BD[
4.1140308] → [
4.1140308:1140312]
f := clipFlags{certainty: -1}
p := &clipArgParser{args: args}
for p.i < len(args) {
arg := args[p.i]
switch arg {
case "--file":
f.file = p.nextValue(arg)
case "--folder":
f.folder = p.nextValue(arg)
case "--output":
f.output = p.nextValue(arg)
case "--prefix":
f.prefix = p.nextValue(arg)
case "--filter":
f.filter = p.nextUniqueValue(arg, f.filter)
case "--species":
f.species = p.nextUniqueValue(arg, f.species)
case "--certainty":
v := p.nextInt(arg)
if v < 0 || v > 100 {
fmt.Fprintf(os.Stderr, "Error: --certainty must be between 0 and 100\n")
os.Exit(1)
}
f.certainty = v
case "--size":
f.size = p.nextInt(arg)
case "--color":
f.color = true
p.i++
case "--night":
f.night = true
p.i++
case "--day":
f.day = true
p.i++
case "--location":
f.location = p.nextUniqueValue(arg, f.location)
case "-h", "--help":
printClipUsage()
os.Exit(0)
default:
if strings.HasPrefix(arg, "--") {
fmt.Fprintf(os.Stderr, "Error: unknown flag: %s\n\n", arg)
printClipUsage()
os.Exit(1)
}
p.i++
}
fs := flag.NewFlagSet("calls clip", flag.ExitOnError)
file := fs.String("file", "", "Path to .data file (required if no --folder)")
folder := fs.String("folder", "", "Path to folder containing .data files (required if no --file)")
output := fs.String("output", "", "Output folder for generated clips (required)")
prefix := fs.String("prefix", "", "Prefix for output filenames (required)")
filter := fs.String("filter", "", "Filter by ML model name")
species := fs.String("species", "", "Filter by species, optionally with calltype")
certainty := fs.Int("certainty", -1, "Filter by certainty value (0-100)")
size := fs.Int("size", 0, "Spectrogram image size in pixels (224-896)")
color := fs.Bool("color", false, "Apply L4 colormap to spectrogram")
night := fs.Bool("night", false, "Only clip recordings made during solar night")
day := fs.Bool("day", false, "Only clip recordings made during solar day")
location := fs.String("location", "", "GPS coordinates and optional timezone")
fs.Usage = printClipUsage
_ = fs.Parse(args)
if *certainty < -1 || *certainty > 100 {
fmt.Fprintf(os.Stderr, "Error: --certainty must be between 0 and 100\n")
os.Exit(1)
}
return clipFlags{
file: *file,
folder: *folder,
output: *output,
prefix: *prefix,
filter: *filter,
species: *species,
size: *size,
certainty: *certainty,
color: *color,
night: *night,
day: *day,
location: *location,