Skip to content

Pickup error after cropping #3

@fwimp

Description

@fwimp

From user:

My hemispherical images had a lot of 'ground' rather than 'sky' which was leading to errors in calculating the thresholds. So, I got the polar projections and cropped them to eliminate the non-sky parts. I then ran Cano.py in pick-up mode and got the following error:

Traceback (most recent call last):
  File "/Users/bonniewaring/Desktop/Cano.py", line 388, in main
    imgpath_out, lai_out = process_image_batch(
                           ^^^^^^^^^^^^^^^^^^^^
  File "/Users/bonniewaring/Desktop/Cano.py", line 237, in process_image_batch
    outlist = [process_image_single(x, threshold=threshold, slicepoint=slicepoint, save_files=save_files, mode=mode, outpath=outpath, fileext=fileext, quality=quality) for x in tqdm(imagepath_list, leave=False)]
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bonniewaring/Desktop/Cano.py", line 237, in <listcomp>
    outlist = [process_image_single(x, threshold=threshold, slicepoint=slicepoint, save_files=save_files, mode=mode, outpath=outpath, fileext=fileext, quality=quality) for x in tqdm(imagepath_list, leave=False)]
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bonniewaring/Desktop/Cano.py", line 217, in process_image_single
    thresh, lai = threshold_and_lai(polar, threshold)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bonniewaring/Desktop/Cano.py", line 171, in threshold_and_lai
    gap_fractions = calc_gap_fractions(thresh, (cx, cy, cr))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bonniewaring/Desktop/Cano.py", line 122, in calc_gap_fractions
    gap_fractions[i-1] = gap_fractions[i-1] + im_segment[int(y[j-1]) - 1, int(x[j-1]) - 1]
                                              ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: index 1130 is out of bounds for axis 1 with size 1129

I have attached an example of the original polar image and the cropped one. I also tried the no_slice option, wondering if it had to do with the dimensions of the image, but no dice!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions