python tests/test_sicor.py TestSicor.test_ac_file_system_l1c_sentinel_2_products fails
When running the test, I get this error:
INFO:SICOR:coreg:/tmp/tmpqo0ej9du/S2A_OPER_PRD_MSIL2A_GFZ_20151207T180211_R108_V20151207T103733_20151207T103733.SAFE/GRANULE/S2A_OPER_MSI_L2A_TL_SGS__20151207T160946_A002393_T32UPV_N02.00.p_20180307_03:44:03/IMG_DATA/R10m/S2A_OPER_MSI_L2A_TL_SGS__20151207T160946_A002393_T32UPV_B08_10m_coreg.jp2
INFO:SICOR:Use local shift algorithm.
INFO:SICOR:Grid_res: 92, ref band used: 1, window size: (256, 256)
INFO:SICOR:Start correct shifts.
29 tie points flagged by level 1 filtering (reliability).
19 tie points flagged by level 2 filtering (SSIM).
9 tie points flagged by level 3 filtering (RANSAC)
Note: array has been downsampled to 1000 x 1000 for faster visualization.
INFO:SICOR:coreg:/tmp/tmpqo0ej9du/S2A_OPER_PRD_MSIL2A_GFZ_20151207T180211_R108_V20151207T103733_20151207T103733.SAFE/GRANULE/S2A_OPER_MSI_L2A_TL_SGS__20151207T160946_A002393_T32UPV_N02.00.p_20180307_03:44:03/IMG_DATA/R20m/S2A_OPER_MSI_L2A_TL_SGS__20151207T160946_A002393_T32UPV_B05_20m_coreg.jp2
INFO:SICOR:Use local shift algorithm.
INFO:SICOR:Grid_res: 46, ref band used: 1, window size: (256, 256)
INFO:SICOR:Start correct shifts.
ERROR:SICOR:ValueError('Must have equal len keys and value when setting with an iterable',)
Traceback (most recent call last):
File "/data/arcsi/andre/projekte/dfpoc-boa/sicor/sicor/sicor_ac.py", line 222, in coreg_s2
cr.correct_shifts()
File "/data/arcsi/andre/programme/anaconda_5.0.1/envs/sicor/lib/python3.6/site-packages/arosics/CoReg_local.py", line 589, in correct_shifts
coreg_info = self.coreg_info
File "/data/arcsi/andre/programme/anaconda_5.0.1/envs/sicor/lib/python3.6/site-packages/arosics/CoReg_local.py", line 561, in coreg_info
'GCPList': self.tiepoint_grid.GCPList,
File "/data/arcsi/andre/programme/anaconda_5.0.1/envs/sicor/lib/python3.6/site-packages/arosics/CoReg_local.py", line 310, in tiepoint_grid
self._tiepoint_grid.get_CoRegPoints_table()
File "/data/arcsi/andre/programme/anaconda_5.0.1/envs/sicor/lib/python3.6/site-packages/arosics/Tie_Point_Grid.py", line 369, in get_CoRegPoints_table
results[i, :] = self._get_spatial_shifts(coreg_kwargs)
File "/data/arcsi/andre/programme/anaconda_5.0.1/envs/sicor/lib/python3.6/site-packages/arosics/Tie_Point_Grid.py", line 239, in _get_spatial_shifts
CR = COREG(global_shared_imref, global_shared_im2shift, CPUs=1, **coreg_kwargs)
File "/data/arcsi/andre/programme/anaconda_5.0.1/envs/sicor/lib/python3.6/site-packages/arosics/CoReg.py", line 284, in __init__
self._get_image_params()
File "/data/arcsi/andre/programme/anaconda_5.0.1/envs/sicor/lib/python3.6/site-packages/arosics/CoReg.py", line 405, in _get_image_params
self.ref = GeoArray_CoReg(self.params, 'ref')
File "/data/arcsi/andre/programme/anaconda_5.0.1/envs/sicor/lib/python3.6/site-packages/arosics/CoReg.py", line 56, in __init__
super(GeoArray_CoReg, self).__init__(path_or_geoArr, nodata=nodata, progress=progress, q=q)
File "/data/arcsi/andre/programme/anaconda_5.0.1/envs/sicor/lib/python3.6/site-packages/geoarray/baseclasses.py", line 94, in __init__
self.bandnames = bandnames or list(self.bandnames.values())
File "/data/arcsi/andre/programme/anaconda_5.0.1/envs/sicor/lib/python3.6/site-packages/geoarray/baseclasses.py", line 152, in bandnames
del self.bandnames # runs deleter which sets it to default values
File "/data/arcsi/andre/programme/anaconda_5.0.1/envs/sicor/lib/python3.6/site-packages/geoarray/baseclasses.py", line 182, in bandnames
self.metadata.loc['band_name', :] = list(self._bandnames.keys())
File "/data/arcsi/andre/programme/anaconda_5.0.1/envs/sicor/lib/python3.6/site-packages/pandas/core/indexing.py", line 194, in __setitem__
self._setitem_with_indexer(indexer, value)
File "/data/arcsi/andre/programme/anaconda_5.0.1/envs/sicor/lib/python3.6/site-packages/pandas/core/indexing.py", line 599, in _setitem_with_indexer
raise ValueError('Must have equal len keys and value '
ValueError: Must have equal len keys and value when setting with an iterable
On debugging:
@bandnames.deleter
def bandnames(self):
self._bandnames = OrderedDict(('B%s' % band, i) for i, band in enumerate(range(1, self.bands + 1)))
if self._metadata is not None:
self.metadata.loc['band_name', :] = list(self._bandnames.keys())
self.metadata.loc['band_name', :]
Out[17]:
0 0
1 1
2 2
list(self._bandnames.keys())
Out[24]: ['B1']
Walking up the stack:
ref_image_fn
Out[27]: '/tmp/tmpqek5v_9k/S2A_OPER_PRD_MSIL1C_PDMC_20151207T180211_R108_V20151207T103733_20151207T103733.SAFE/GRANULE/S2A_OPER_MSI_L1C_TL_SGS__20151207T160946_A002393_T32UPV_N02.00/ref_image.tif'
image_fn
Out[28]: '/tmp/tmpqek5v_9k/S2A_OPER_PRD_MSIL2A_GFZ_20151207T180211_R108_V20151207T103733_20151207T103733.SAFE/GRANULE/S2A_OPER_MSI_L2A_TL_SGS__20151207T160946_A002393_T32UPV_N02.00.p_20180307_04:31:53/IMG_DATA/R20m/S2A_OPER_MSI_L2A_TL_SGS__20151207T160946_A002393_T32UPV_B05_20m.jp2'
CR = COREG(global_shared_imref, global_shared_im2shift, CPUs=1, **coreg_kwargs)
{'binary_ws': True,
'footprint_poly_ref': <shapely.geometry.polygon.Polygon at 0x7fd156088278>,
'footprint_poly_tgt': <shapely.geometry.polygon.Polygon at 0x7fd156088f98>,
'force_quadratic_win': True,
'ignore_errors': True,
'max_iter': 5,
'max_shift': 5,
'nodata': (0.0, 65535.0),
'q': True,
'r_b4match': 1,
'resamp_alg_calc': 'cubic',
's_b4match': 1,
'v': False,
'wp': array([ 600000., 5499105.]),
'ws': (256, 256)}
self.ref = GeoArray_CoReg(self.params, 'ref')
self.params
Out[32]:
{'CPUs': 1,
'align_grids': False,
'binary_ws': True,
'calc_corners': True,
'data_corners_ref': None,
'data_corners_tgt': None,
'fmt_out': 'ENVI',
'footprint_poly_ref': <shapely.geometry.polygon.Polygon at 0x7fd156088278>,
'footprint_poly_tgt': <shapely.geometry.polygon.Polygon at 0x7fd156088f98>,
'force_quadratic_win': True,
'ignore_errors': True,
'im_ref': <arosics.CoReg.GeoArray_CoReg at 0x7fd155faa470>,
'im_tgt': <arosics.CoReg.GeoArray_CoReg at 0x7fd1561a06d8>,
'mask_baddata_ref': None,
'mask_baddata_tgt': None,
'match_gsd': False,
'max_iter': 5,
'max_shift': 5,
'nodata': (0.0, 65535.0),
'out_crea_options': None,
'out_gsd': None,
'path_out': None,
'path_verbose_out': None,
'progress': True,
'q': True,
'r_b4match': 1,
'resamp_alg_calc': 'cubic',
'resamp_alg_deshift': 'cubic',
's_b4match': 1,
'target_xyGrid': None,
'v': False,
'wp': array([ 600000., 5499105.]),
'ws': (256, 256)}[scratch.txt](/uploads/a97bf13f6cb22c00c7a7adcd70e4c0a3/scratch.txt)