Project-OSmOSE / OSEkit

OSEkit is an open source suite of tools written in python and dedicated to the management and analysis of data in underwater passive acoustics.
https://osmose.ifremer.fr
Other
4 stars 2 forks source link

recompute welch timestamp , taking middle instead of start of spectro_duration or tuiles #208

Open cazaudo opened 1 month ago

cazaudo commented 1 month ago

in https://github.com/Project-OSmOSE/OSEkit/blob/main/src/OSmOSE/Spectrogram.py , we need to revise the definiton of list_timestamps , currently defined as

            list_timestamps.append(
                current_timestamp + timedelta(seconds=int(start))
            )

should be defined as the middle value of the wav (or the tuile if self.zoom_level>0) time boundaries

Gautzilla commented 1 week ago

I didn't see this issue, sorry!

If i'm not mistaken, it just centers the time values on the tuiles instead of marking their start?

image

We have the tile_duration in this scope, and thus could use it directly?

        for tile in range(nber_tiles_lowest_zoom_level):
            start = tile * tile_duration
            end = start + tile_duration

            if not adjust:
                list_timestamps.append(
                    current_timestamp + timedelta(seconds=int(start + tile_duration//2)),
                )
            )

I've not tested it yet, that just to clarify that I understand correctly the issue!