diff --git a/internal/observation/observation.go b/internal/observation/observation.go index 91687ea9..a07a67d7 100644 --- a/internal/observation/observation.go +++ b/internal/observation/observation.go @@ -93,9 +93,12 @@ func WriteNotesTable(settings *conf.Settings, notes []datastore.Note, filename s continue // Skip the current iteration as the note doesn't meet the threshold } + beginTime := float64(note.BeginTime.UnixNano()) / 1e9 + endTime := float64(note.EndTime.UnixNano()) / 1e9 + // Prepare the line for notes above the threshold line := fmt.Sprintf("%d\tSpectrogram 1\t1\t%s\t%.1f\t%.1f\t0\t15000\t%s\t%s\t%.4f\n", - i+1, note.InputFile, note.BeginTime, note.EndTime, note.SpeciesCode, note.CommonName, note.Confidence) + i+1, note.InputFile, beginTime, endTime, note.SpeciesCode, note.CommonName, note.Confidence) // Attempt to write the note if _, err = w.Write([]byte(line)); err != nil { @@ -154,8 +157,11 @@ func WriteNotesCsv(settings *conf.Settings, notes []datastore.Note, filename str continue // Skip the current iteration as the note doesn't meet the threshold } + beginTime := float64(note.BeginTime.UnixNano()) / 1e9 + endTime := float64(note.EndTime.UnixNano()) / 1e9 + line := fmt.Sprintf("%f,%f,%s,%s,%.4f\n", - note.BeginTime, note.EndTime, note.ScientificName, note.CommonName, note.Confidence) + beginTime, endTime, note.ScientificName, note.CommonName, note.Confidence) if _, err = w.Write([]byte(line)); err != nil { // Break out of the loop at the first sign of an error