macaodha / batdetect2

Other
53 stars 10 forks source link

No file name in console output #7

Closed Jeff37 closed 1 year ago

Jeff37 commented 1 year ago

(me again! I'm not sure if this comment should be in issues? Happy to change it if needed!)

With the first version of batdetect2 the output in command line was giving a serial number and the filename before the result of the processing of the file. Like this (2 results out of many files in a folder):

128 PaRecAR1292524_20230429_215723.wav 0 call(s) detected above the threshold.

129 PaRecAR1292524_20230429_202535.wav 6 call(s) detected above the threshold. species name probablity present Eptesicus serotinus 0.62 Nyctalus noctula 0.191 Nyctalus leisleri 0.142 Plecotus auritus 0.03 Plecotus austriacus 0.013

But now, since v1.0.x, there is not anymore the first line in the output, for example:

time_exp_fact 10 13 call(s) detected above the threshold. species name probablity present Pipistrellus pipistrellus 0.972 Nyctalus leisleri 0.017 Pipistrellus nathusii 0.007 time_exp_fact 10 18 call(s) detected above the threshold. species name probablity present Nyctalus leisleri 0.541 Eptesicus serotinus 0.226 Nyctalus noctula 0.225

Therefore one can not use the output without being able to connect the results with the file. Actually I collect the probability of the first species in my workflow (in a R script) from the console output to make a summary table. I guess it's not a big deal to put back this line in the output?

mbsantiago commented 1 year ago

Hey Jeff. Thanks again, for bringing up the issue with the missing first line in the output. Sorry for this, I've added it back in a new release. On another note, we recommend considering the use of output files instead of console output. Not only is this more complete, but it should also be more reliable in the long run. Using output files ensures that you don't need to rerun the detect command every time you want to retrieve the results.

Jeff37 commented 1 year ago

Thanks again @mbsantiago for the quick answer! I utterly agree that the output files are very useful. I use the json and call parameters csv in my R scripts to create a summary table. But I couldn't find where I can pick up the probability value that is printed in the output. I know it's probably very easy to recompute but I couldn't get to this through the python code (I'm still too clumsy with python), so this is my temporary workaround.