Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • arosics arosics
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 14
    • Issues 14
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 3
    • Merge requests 3
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Daniel Scheffler
  • arosicsarosics
  • Issues
  • #60
Closed
Open
Created Jul 03, 2021 by Nathan Thomas@nmt28

invalid array lengths

I have a clean env with arosics installed via anaconda as suggested in the installation instructions. When trying to run:

CR=arosics.CoReg_local.COREG_LOCAL(reference, floating, 1, max_points=None, window_size=(256, 256), path_out='/Users/nmthoma1/Desktop/', fmt_out='ENVI', out_crea_options=None, projectDir=None, r_b4match=1, s_b4match=1, max_iter=10, max_shift=5, tieP_filter_level=3, min_reliability=60, rs_max_outlier=10, rs_tolerance=2.5, align_grids=True, match_gsd=False, out_gsd=None, target_xyGrid=None, resamp_alg_deshift='cubic', resamp_alg_calc='cubic', footprint_poly_ref=None, footprint_poly_tgt=None, data_corners_tgt=None, outFillVal=- 9999, nodata=(None, None), calc_corners=True, binary_ws=True, force_quadratic_win=True, mask_baddata_ref=None, mask_baddata_tgt=None, CPUs=None, progress=True, v=False, q=False, ignore_errors=True)

I get the error:

Bounding box of calculated footprint for image to be shifted:
	(-80.91772066549947, 24.6867009806255, -80.20022745920632, 25.30573337447406)
Matching window position (X,Y): -80.5732775900965/24.987543556889076
/Users/nmthoma1/miniconda/envs/arosics/lib/python3.9/site-packages/arosics/CoReg.py:1400: UserWarning: SSIM input array shapes are not equal! This issue seemed to be already fixed.. 
  warnings.warn('SSIM input array shapes are not equal! This issue seemed to be already fixed.. ')
Traceback (most recent call last):
  File "/Users/nmthoma1/OneDrive - NASA/Developer/TimeSeries_Mangroves/code/1.TOA_Cal/registration.py", line 8, in <module>
    CR=arosics.CoReg_local.COREG_LOCAL(reference, floating, 1, max_points=None, window_size=(256, 256), path_out='/Users/nmthoma1/Desktop/', fmt_out='ENVI', out_crea_options=None, projectDir=None, r_b4match=1, s_b4match=1, max_iter=10, max_shift=5, tieP_filter_level=3, min_reliability=60, rs_max_outlier=10, rs_tolerance=2.5, align_grids=True, match_gsd=False, out_gsd=None, target_xyGrid=None, resamp_alg_deshift='cubic', resamp_alg_calc='cubic', footprint_poly_ref=None, footprint_poly_tgt=None, data_corners_tgt=None, outFillVal=- 9999, nodata=(None, None), calc_corners=True, binary_ws=True, force_quadratic_win=True, mask_baddata_ref=None, mask_baddata_tgt=None, CPUs=None, progress=True, v=False, q=False, ignore_errors=True)
  File "/Users/nmthoma1/miniconda/envs/arosics/lib/python3.9/site-packages/arosics/CoReg_local.py", line 348, in __init__
    self.check_if_fftw_works()
  File "/Users/nmthoma1/miniconda/envs/arosics/lib/python3.9/site-packages/arosics/CoReg_local.py", line 369, in check_if_fftw_works
    self.COREG_obj.calculate_spatial_shifts()
  File "/Users/nmthoma1/miniconda/envs/arosics/lib/python3.9/site-packages/arosics/CoReg.py", line 1588, in calculate_spatial_shifts
    self._validate_ssim_improvement()  # FIXME uses the not updated matchWin size
  File "/Users/nmthoma1/miniconda/envs/arosics/lib/python3.9/site-packages/arosics/CoReg.py", line 1408, in _validate_ssim_improvement
    self.matchWin.clip_to_poly(self.matchBox.mapPoly)
  File "/Users/nmthoma1/miniconda/envs/arosics/lib/python3.9/site-packages/geoarray/baseclasses.py", line 1480, in clip_to_poly
    self.arr, self.gt, self.projection = self.get_mapPos(mapBounds=poly.bounds, mapBounds_prj=self.prj)
  File "/Users/nmthoma1/miniconda/envs/arosics/lib/python3.9/site-packages/geoarray/baseclasses.py", line 1565, in get_mapPos
    sub_arr, sub_gt, sub_prj = get_array_at_mapPos(self, arr_gt, arr_prj,
  File "/Users/nmthoma1/miniconda/envs/arosics/lib/python3.9/site-packages/geoarray/subsetting.py", line 236, in get_array_at_mapPos
    out_arr, out_gt = _clip_array_at_mapPos(arr, mapBounds, arr_gt, band2clip=band2get, fillVal=fillVal)
  File "/Users/nmthoma1/miniconda/envs/arosics/lib/python3.9/site-packages/geoarray/subsetting.py", line 121, in _clip_array_at_mapPos
    out_arr[rS_out:rE_out + 1, cS_out:cE_out + 1] = data if data.ndim == 2 else data[:, :, 0]
ValueError: could not broadcast input array from shape (256,196) into shape (299,197)

This occurs immediately after the initial polygonizing has completed. I am using Spot 5 and spot 1 data. The images are different sizes and resolutions and have different bounding boxes. A very similar issue occurs when using the global algorithm

Edited Jul 12, 2021 by Daniel Scheffler
Assignee
Assign to
Time tracking