DD3LCTLZFDIPVXXSG7RDINZCQ7NGKVG3X52OFVGVZIISD5VPF35QC YE6BZJUKQ7VMYEKKI3WSKTZEBR5NWUUDIN6PGE4W7OTPIY5N3NJQC KZKLAINJJWZ64T5MUZT34LJVQIKBTKZ6EJGD7C7TTSSDGCHEDPMAC KLUEQ6X5CXVBV3KLJKEHWQYHIU6AYPP2WT4PWKM2QZJ7SNACCJ6QC 2P27XV3DGJCRA4SNJENCJYZLPR2XWZMTY7CGYYSJOY4UMDVVO25AC NS4TDPLNAWJYJN37PZDYXMG6OJSAWZCMTPSPKX73JCLZZAMY25BAC GPQSOVBPY7VTPHD75R6VWSNITPOL3AECF4DHJB32MF5Z72NV7YMQC }// parseLocation parses a "lat,lng[,timezone]" string into its components.// Timezone is optional and defaults to "" (UTC).func parseLocation(location string) (lat, lng float64, timezone string, err error) {parts := strings.Split(location, ",")if len(parts) < 2 || len(parts) > 3 {return 0, 0, "", fmt.Errorf("--location must be \"lat,lng\" or \"lat,lng,timezone\" (got %d parts)", len(parts))}lat, err = strconv.ParseFloat(strings.TrimSpace(parts[0]), 64)if err != nil {return 0, 0, "", fmt.Errorf("--location: invalid latitude: %s", parts[0])}lng, err = strconv.ParseFloat(strings.TrimSpace(parts[1]), 64)if err != nil {return 0, 0, "", fmt.Errorf("--location: invalid longitude: %s", parts[1])}if len(parts) == 3 {timezone = strings.TrimSpace(parts[2])}return lat, lng, timezone, nil
fmt.Fprintf(os.Stderr, " --night Only act on solar-night recordings (requires --lat and --lng)\n")fmt.Fprintf(os.Stderr, " --day Only act on solar-day recordings (requires --lat and --lng)\n")fmt.Fprintf(os.Stderr, " --lat <float> Latitude in decimal degrees (required with --night or --day)\n")fmt.Fprintf(os.Stderr, " --lng <float> Longitude in decimal degrees (required with --night or --day)\n")fmt.Fprintf(os.Stderr, " --timezone <zone> IANA timezone ID (e.g. Pacific/Auckland)\n")
fmt.Fprintf(os.Stderr, " --night Only act on solar-night recordings (requires --location)\n")fmt.Fprintf(os.Stderr, " --day Only act on solar-day recordings (requires --location)\n")fmt.Fprintf(os.Stderr, " --location <lat,lng[,tz]> GPS coordinates and optional IANA timezone\n")fmt.Fprintf(os.Stderr, " e.g. --location \"-36.85,174.76\" or --location \"-36.85,174.76,Pacific/Auckland\"\n")fmt.Fprintf(os.Stderr, " Required with --night or --day. Timezone defaults to UTC.\n")fmt.Fprintf(os.Stderr, " Not needed for AudioMoth data (UTC from WAV comment).\n")
fmt.Fprintf(os.Stderr, " skraak calls push-certainty --folder ./data --species Kiwi --night --lat -45.5 --lng 167.4\n")
fmt.Fprintf(os.Stderr, " skraak calls push-certainty --folder ./data --species Kiwi --night --location \"-45.5,167.4\"\n")
case "--lat":f.lat = requireFloat(arg, args, &i)f.latSet = truecase "--lng":f.lng = requireFloat(arg, args, &i)f.lngSet = truecase "--timezone":f.timezone = requireValue(arg, args, &i)
case "--location":if f.location != "" {fmt.Fprintf(os.Stderr, "Error: --location can only be specified once\n")os.Exit(1)}f.location = requireValue(arg, args, &i)
// requireFloat parses the next argument as a float64, or exits with an errorfunc requireFloat(flag string, args []string, i *int) float64 {s := requireValue(flag, args, i)v, err := strconv.ParseFloat(s, 64)if err != nil {fmt.Fprintf(os.Stderr, "Error: %s must be a number\n", flag)os.Exit(1)}return v}
if (f.night || f.day) && (!f.latSet || !f.lngSet) {fmt.Fprintf(os.Stderr, "Error: --night/--day requires both --lat and --lng\n\n")
if (f.night || f.day) && f.location == "" {fmt.Fprintf(os.Stderr, "Error: --night/--day requires --location\n\n")
fmt.Fprintf(os.Stderr, " --night Only review solar-night recordings (requires --lat and --lng)\n")fmt.Fprintf(os.Stderr, " --day Only review solar-day recordings (requires --lat and --lng)\n")fmt.Fprintf(os.Stderr, " --lat <float> Latitude in decimal degrees (required with --night or --day)\n")fmt.Fprintf(os.Stderr, " --lng <float> Longitude in decimal degrees (required with --night or --day)\n")fmt.Fprintf(os.Stderr, " --timezone <zone> IANA timezone ID (e.g. Pacific/Auckland). Required for non-AudioMoth\n")fmt.Fprintf(os.Stderr, " recorders whose filenames embed local time (e.g. DOC AR4).\n")
fmt.Fprintf(os.Stderr, " --night Only review solar-night recordings (requires --location)\n")fmt.Fprintf(os.Stderr, " --day Only review solar-day recordings (requires --location)\n")fmt.Fprintf(os.Stderr, " --location <lat,lng[,tz]> GPS coordinates and optional IANA timezone\n")fmt.Fprintf(os.Stderr, " e.g. --location \"-36.85,174.76\" or --location \"-36.85,174.76,Pacific/Auckland\"\n")fmt.Fprintf(os.Stderr, " Required with --night or --day. Timezone defaults to UTC.\n")fmt.Fprintf(os.Stderr, " Not needed for AudioMoth data (UTC from WAV comment).\n")
// requireFloat parses the next arg as float64.func (a classifyArgs) requireFloat(args []string, i int, flag string) float64 {val := a.requireValue(args, i, flag)v, err := strconv.ParseFloat(val, 64)if err != nil {fmt.Fprintf(os.Stderr, "Error: %s must be a number\n", flag)os.Exit(1)}return v}
**Breaking CLI change.** Two flag changes to `skraak calls clip`:
**Breaking CLI change.** The `--lat`, `--lng`, `--timezone` flags are replacedby a single `--location "lat,lng[,timezone]"` flag in three commands:
1. **`--lat`, `--lng`, `--timezone` → `--location`** — The three GPS/timezoneflags are replaced by a single `--location "lat,lng[,timezone]"` flag.Timezone is optional (defaults to UTC; not needed for AudioMoth).This makes invalid states unrepresentable (you can't pass lat without lng).
- `skraak calls clip`- `skraak calls classify`- `skraak calls push-certainty`
Before:```bashskraak calls clip --folder ./data --output ./clips --prefix kiwi \--species Kiwi --night --lat -40.85 --lng 172.81 --timezone Pacific/Auckland```After:```bashskraak calls clip --folder ./data --output ./clips --prefix kiwi \--species Kiwi --night --location "-40.85,172.81,Pacific/Auckland"```
Timezone is optional (defaults to UTC; not needed for AudioMoth).This makes invalid states unrepresentable (you can't pass lat without lng).
2. **`--wav-only` removed** — This flag skipped spectrogram PNG generation.Removed as unnecessary; the tool's primary purpose is generating trainingdata (PNG+WAV pairs).
Before:```bashskraak calls clip --folder ./data --output ./clips --prefix kiwi \--species Kiwi --night --lat -40.85 --lng 172.81 --timezone Pacific/Auckland```After:```bashskraak calls clip --folder ./data --output ./clips --prefix kiwi \--species Kiwi --night --location "-40.85,172.81,Pacific/Auckland"```Additionally, `--wav-only` was removed from `skraak calls clip`. This flagskipped spectrogram PNG generation; removed as unnecessary since the tool'sprimary purpose is generating training data (PNG+WAV pairs).
- `cmd/calls_clip.go` — flag parsing, validation, usage text- `tools/calls_clip.go` — `CallsClipInput` struct, `parseLocation` helper,removed `wavOnly` from function signatures, unwrapped spectrogram conditional
- `utils/location.go` — new `ParseLocation` helper- `cmd/calls_clip.go` — `--location` flag, removed `--wav-only`- `cmd/calls_classify.go` — `--location` flag- `cmd/calls_push_certainty.go` — `--location` flag- `tools/calls_clip.go` — `CallsClipInput` struct, removed `wavOnly`/`parseLocation`