CityCAT I/O Documentation

citycatio module

class citycatio.Model(dem, rainfall, rainfall_polygons=None, buildings=None, green_areas=None, friction=None, open_boundaries=None, flow=None, flow_polygons=None, **kwargs)

Combines input data to create a complete CityCAT model

Parameters
  • dem (MemoryFile) – Digital Elevation Model

  • rainfall (DataFrame) – Rainfall time series

  • rainfall_polygons (Optional[GeoSeries]) – Areas corresponding to rainfall series

  • buildings (Optional[GeoDataFrame]) – Areas representing buildings which are extracted from the domain

  • green_areas (Optional[GeoDataFrame]) – Areas representing permeable land cover

  • friction (Optional[GeoDataFrame]) – Areas with custom friction coefficients

  • open_boundaries (Optional[GeoDataFrame]) – Areas where the domain boundary should be open

  • flow (Optional[Series]) – Flow time series

  • flow_polygons (Optional[GeoSeries]) – Areas corresponding to flow series

  • **kwargs – Options to pass to inputs.Configuration

dem
Type

inputs.Dem

rainfall
Type

inputs.Rainfall

configuration
Type

inputs.Configuration

rainfall_polygons
Type

inputs.RainfallPolygons

green_areas
Type

inputs.GreenAreas

friction
Type

inputs.Friction

open_boundaries
Type

inputs.OpenBoundaries

flow
Type

inputs.Flow

flow_polygons
Type

inputs.Flow

write(path)

Creates all input files in the directory given by path

Parameters

path (str) – Directory in which to create input files, will be created if it does not exists

citycatio.to_geotiff(in_path, out_path, srid=None, delimiter=',')

Converts single CityCAT results file to GeoTIFF

Parameters
  • in_path – path where CityCAT results file is located

  • out_path – path to create GeoTIFF file

  • srid (Optional[int]) – EPSG Spatial Reference System Identifier of results file

  • delimiter (str) – Delimiter to use when reading the results file

citycatio.to_netcdf(in_path, out_path=None, start_time=datetime.datetime(1, 1, 1, 0, 0), srid=None, attributes=None)

Converts CityCAT results to a netCDF file

Parameters
  • in_path – path where CityCAT results files are located

  • out_path – path to create netCDF file If not given then in_path will be used with an appended extension

  • start_time (datetime) – Start time to use when creating time steps

  • srid (Optional[int]) – EPSG Spatial Reference System Identifier of results files

  • attributes (Optional[dict]) – Dictionary of key-value pairs to store as netCDF attributes Keys must begin with an alphabetic character and be alphanumeric, underscore is allowed

citycatio.inputs module

class citycatio.inputs.Buildings(data)

Areas representing buildings which are extracted from the domain

Parameters

data (GeoDataFrame) – Table containing building polygons

class citycatio.inputs.Configuration(duration, rainfall_zones, permeable_areas_friction=0.035, impermeable_areas_friction=0.02, spatial_rainfall=False, output_interval=108000, initial_timestep=25, use_infiltration=False, hydraulic_conductivity=1.09, wetting_front_suction_head=11.01, effective_porosity=0.412, effective_saturation=0.3, roof_storage=0, create_max_depth_file=True, open_external_boundaries=True, buildings_algorithm=1, permeable_areas=0)

General configuration options and infiltration parameters

Parameters
  • duration (int) – Length of simulation in seconds

  • rainfall_zones (int) – Number of rainfall zones

  • permeable_areas_friction (float) – Friction coefficient for permeable areas

  • impermeable_areas_friction (float) – Friction coefficient for impermeable areas

  • spatial_rainfall (bool) – Whether or not rainfall is spatially variable

  • output_interval (int) – Time in seconds between output files

  • initial_timestep (int) – Time in seconds between first and second model time steps

  • use_infiltration (bool) – Whether or not to include infiltration

  • hydraulic_conductivity (float) – Hydraulic conductivity of green areas

  • wetting_front_suction_head (float) – Wetting front suction head of green areas

  • effective_porosity (float) – Effective porosity of green areas

  • effective_saturation (float) – Effective saturation of green areas

  • roof_storage (float) – Roof storage of buildings in metres

  • create_max_depth_file (bool) – Whether or not to create a CSV file containing maximum depths

  • open_external_boundaries (bool) – Whether or not to set external boundaries as open

  • buildings_algorithm (int) – The algorithm to use when extracting buildings from the domain

  • permeable_areas (int) – 0 means use the GreenAreas.txt file, 1 means all impermeable and 2 means all permeable

class citycatio.inputs.Dem(data)

Digital Elevation Model

Parameters

data (MemoryFile) – Rasterio memory file containing DEM data

class citycatio.inputs.Flow(data)

Flow time series

Parameters

data (Series) – Pandas DataFrame containing flow values

class citycatio.inputs.FlowPolygons(data)

Areas corresponding to flow series

Parameters

data (GeoSeries) – Table containing flow polygons

class citycatio.inputs.Friction(data)

Areas with custom friction coefficients

Parameters

data (GeoDataFrame) – Table containing friction polygons

class citycatio.inputs.GreenAreas(data)

Areas representing permeable land cover

Parameters

data (GeoDataFrame) – Table containing green areas polygons

class citycatio.inputs.OpenBoundaries(data)

Areas where the domain boundary should be open

Parameters

data (GeoDataFrame) – Table containing boundary polygons

class citycatio.inputs.Rainfall(data, spatial=False)

Rainfall time series

Parameters
  • data (DataFrame) – Pandas DataFrame containing rainfall values

  • spatial – Whether the rainfall is spatially distributed or not If more than one column is included in data then then spatial must be True

class citycatio.inputs.RainfallPolygons(data)

Areas corresponding to rainfall series

Parameters

data (GeoSeries) – Table containing rainfall polygons

citycatio.utils module

citycatio.utils.geoseries_to_string(geoseries, index=False, index_first=True)

GeoSeries to CityCAT string representation

Parameters
  • geoseries (GeoSeries) – Polygons to convert

  • index – Whether or not to include the index

  • index_first – Whether or not to place the index before the number of points

Returns

String representation readable by CityCAT

Return type

s (str)

Indices and tables