dolphin-acoustics-vip / artwarp

MATLAB program for automated categorisation of tonal animal sounds
https://github.com/dolphin-acoustics-vip/artwarp/wiki
GNU Lesser General Public License v3.0
7 stars 10 forks source link

Fix path change issue when loading data into ARTwarp #16

Closed RohanK22 closed 2 years ago

RohanK22 commented 2 years ago

It is a very simple fix that just saves the current path in a global variable before loading the data, and after the data is loaded it restores the current working directory back to the ARTwarp code directory.

douggillespie commented 2 years ago

Why don't you leave the path as it is, and use full file path names to load the data ? My memory is that it switches the working directory to the data folder, but if you used full file paths, that wouldn't be necessary.

RohanK22 commented 2 years ago

I think the changes should load the ctr files by using their full path names instead of switching the current directory. I have removed the unnecessary cd(path) commands in the code.

douggillespie commented 2 years ago

Sorry for not getting to this earlier. this is the right approach, however Matlab has a nice 'fullfile' function which will join the bits of the path together, rather than using append like you have done: test=csvread(append(DATA(c1).folder, '/', DATA(c1).name)

RohanK22 commented 2 years ago

Ok. I've changed it to use the 'fullfile' function instead.

RohanK22 commented 2 years ago

@douggillespie , @vmjanik , can this be merged now?