Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using mean_trimmed option for correct_images #91

Open
cappelletto opened this issue Feb 6, 2023 · 0 comments
Open

Error when using mean_trimmed option for correct_images #91

cappelletto opened this issue Feb 6, 2023 · 0 comments
Labels

Comments

@cappelletto
Copy link
Contributor

On develop branch, correct_images parse crashes when calculating the attenuation parameters with the mean_trimmed option

INFO ▸   Bin 44 ( 12.8 m < x < 12.9 m): 76 images
INFO ▸   Bin 45 ( 12.9 m < x < 13.0 m): 54 images
INFO ▸   Bin 46 ( 13.0 m < x < 13.1 m): 40 images
INFO ▸   Bin 47 ( 13.1 m < x < 13.2 m): 41 images
calculating mean and std of images 2023-02-06 14:40:36:   0%|                                                                                                                        | 0/1024 [00:00<?, ?it/s]
calculating mean and std of images 2023-02-06 14:40:37:   0%|                                                                                                                        | 0/1024 [00:00<?, ?it/s]
calculating mean and std of images 2023-02-06 14:40:37:   0%|                                                                                                                        | 0/1024 [00:00<?, ?it/s]
calculating mean and std of images 2023-02-06 14:40:37:   0%|                                                                                                                        | 0/1024 [00:00<?, ?it/s]
Computing altitude histogram:   0%|                                                                                                                                                    | 0/48 [00:00<?, ?it/s]
Traceback (most recent call last):
 File "/home/cappelletto/.local/bin/correct_images", line 33, in <module>
   sys.exit(load_entry_point('oplab-pipeline', 'console_scripts', 'correct_images')())
 File "/home/cappelletto/git/oplab_pipeline/src/correct_images/correct_images.py", line 141, in main
   args.func(args)
 File "/home/cappelletto/git/oplab_pipeline/src/correct_images/correct_images.py", line 238, in call_parse
   corrector.parse(path_list, correct_config_list)
 File "/home/cappelletto/git/oplab_pipeline/src/correct_images/corrector.py", line 305, in parse
   self.generate_attenuation_correction_parameters()
 File "/home/cappelletto/git/oplab_pipeline/src/correct_images/corrector.py", line 789, in generate_attenuation_correction_parameters
   joblib.Parallel(n_jobs=-2, verbose=0, prefer="threads")(
 File "/home/cappelletto/.local/lib/python3.10/site-packages/joblib/parallel.py", line 1098, in __call__
   self.retrieve()
 File "/home/cappelletto/.local/lib/python3.10/site-packages/joblib/parallel.py", line 975, in retrieve
   self._output.extend(job.get(timeout=self.timeout))
 File "/home/cappelletto/anaconda3/envs/oplab/lib/python3.10/multiprocessing/pool.py", line 774, in get
   raise self._value
 File "/home/cappelletto/anaconda3/envs/oplab/lib/python3.10/multiprocessing/pool.py", line 125, in worker
   result = (True, func(*args, **kwds))
 File "/home/cappelletto/.local/lib/python3.10/site-packages/joblib/_parallel_backends.py", line 620, in __call__
   return self.func(*args, **kwargs)
 File "/home/cappelletto/.local/lib/python3.10/site-packages/joblib/parallel.py", line 288, in __call__
   return [func(*args, **kwargs)
 File "/home/cappelletto/.local/lib/python3.10/site-packages/joblib/parallel.py", line 288, in <listcomp>
   return [func(*args, **kwargs)
 File "/home/cappelletto/git/oplab_pipeline/src/correct_images/corrector.py", line 1109, in compute_distance_bin
   bin_images_sample = image_mean_std_trimmed(memmap_handle)[0]
 File "/home/cappelletto/git/oplab_pipeline/src/correct_images/tools/numerical.py", line 321, in image_mean_std_trimmed
   data[effective_index, idx_a, idx_b, ch],
 File "/home/cappelletto/.local/lib/python3.10/site-packages/numpy/core/memmap.py", line 334, in __getitem__
   res = super().__getitem__(index)
IndexError: too many indices for array: array is 3-dimensional, but 4 were indexed

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant