6.3. copro.data.fill_XY

copro.data.fill_XY(XY, config, root_dir, conflict_data, polygon_gdf, out_dir)[source]

Fills the (XY-)dictionary with data for each variable and conflict for each polygon for each simulation year. The number of rows should therefore equal to number simulation years times number of polygons. At end of last simulation year, the dictionary is converted to a numpy-array.

Parameters
  • XY (dict) – initiated, i.e. empty, XY-dictionary

  • config (ConfigParser-object) – object containing the parsed configuration-settings of the model.

  • root_dir (str) – path to location of cfg-file.

  • conflict_data (geo-dataframe) – geo-dataframe containing the selected conflicts.

  • polygon_gdf (geo-dataframe) – geo-dataframe containing the selected polygons.

  • out_dir (path) – path to output folder.

Raises

Warning – raised if the datetime-format of the netCDF-file does not match conventions and/or supported formats.

Returns

filled array containing the variable values (X) and binary conflict data (Y) plus meta-data.

Return type

array