LJMUAstroecology / flirpy

Python library to interact with FLIR camera cores
Other
193 stars 54 forks source link

Fix glob expansion when copying .txt files. #76

Closed PavaniVitor closed 1 year ago

PavaniVitor commented 1 year ago

When I run this script without --export_raw i get the following error:

$ ./split_seqs
INFO:__main__:Loading: 20221013_151339_IR.SEQ
INFO:flirpy.io.seq:Splitting 1 files
  0%|                                                                                                                                  | 0/1 [00:00<?, ?it/s]INFO:flirpy.io.seq:Splitting 20221013_151339_IR.SEQ into /home/vitor/flirpy-patch/scripts/20221013_151339_IR
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1800/1800 [00:20<00:00, 89.95it/s]
INFO:flirpy.io.seq:Extracting metadata█████████████████████████████████████████████████████████████████████████████████▉| 1799/1800 [00:20<00:00, 100.49it/s]
INFO:flirpy.io.seq:Copying tags to radiometric
INFO:flirpy.io.seq:Copying tags to preview
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [01:55<00:00, 115.98s/it]
INFO:__main__:Merging folders
  0%|                                                                                                                                  | 0/1 [00:00<?, ?it/s]INFO:__main__:Removing raw folder from /home/vitor/flirpy-patch/scripts/20221013_151339_IR
  0%|                                                                                                                                  | 0/1 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "./split_seqs", line 121, in <module>
    shutil.copy2(os.path.join(folder, "raw", "*.txt"), os.path.join(folder, "radiometric"))
  File "/usr/lib/python3.8/shutil.py", line 435, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.8/shutil.py", line 264, in copyfile
    with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: '/home/vitor/flirpy-patch/scripts/20221013_151339_IR/raw/*.txt'

I Added a glob expansion to fix this issue.

Tnecniv-Teikram commented 1 year ago

Thanks for sharing this. I had the same issue with merging folderes and including the --export_raw solved this step.

jveitchmichaelis commented 1 year ago

Thanks for this, I'll check it out and merge as soon as I can!

sulyak commented 1 year ago

is it soon already?

jveitchmichaelis commented 1 year ago

I suppose it is - merged!