def load_targets(explanatory_rasters):
explanatory_raster_arrays = []<EOL>aff = None<EOL>shape = None<EOL>crs = None<EOL>for raster in explanatory_rasters:<EOL><INDENT>logger.debug(raster)<EOL>with rasterio.open(raster) as src:<EOL><INDENT>ar = src.read(<NUM_LIT:1>)  <EOL>if not aff:<EOL><INDENT>aff = src.affine<EOL><DEDENT>else:<EOL><INDENT>assert aff == src.affine<EOL><DEDENT>if not shape:<EOL><INDENT>shape = ar.shape<EOL><DEDENT>else:<EOL><INDENT>assert shape == ar.shape<EOL><DEDENT>if not crs:<EOL><INDENT>crs = src.crs<EOL><DEDENT>else:<EOL><INDENT>assert crs == src.crs<EOL><DEDENT><DEDENT>arf = ar.flatten()<EOL>explanatory_raster_arrays.append(arf)<EOL><DEDENT>expl = np.array(explanatory_raster_arrays).T<EOL>raster_info = {<EOL>'<STR_LIT>': aff,<EOL>'<STR_LIT>': shape,<EOL>'<STR_LIT>': crs<EOL>}<EOL>return expl, raster_info<EOL>
Parameters
----------
explanatory_rasters : List of Paths to GDAL rasters containing explanatory variables

Returns
-------
expl : Array of explanatory variables
raster_info : dict of raster info