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 Modelrainfall (
DataFrame) – Rainfall time seriesrainfall_polygons (
Optional[GeoSeries]) – Areas corresponding to rainfall seriesbuildings (
Optional[GeoDataFrame]) – Areas representing buildings which are extracted from the domaingreen_areas (
Optional[GeoDataFrame]) – Areas representing permeable land coverfriction (
Optional[GeoDataFrame]) – Areas with custom friction coefficientsopen_boundaries (
Optional[GeoDataFrame]) – Areas where the domain boundary should be openflow (
Optional[Series]) – Flow time seriesflow_polygons (
Optional[GeoSeries]) – Areas corresponding to flow series**kwargs – Options to pass to
inputs.Configuration
-
dem¶ - Type
-
rainfall¶ - Type
-
configuration¶ - Type
-
rainfall_polygons¶
-
green_areas¶ - Type
-
friction¶ - Type
-
open_boundaries¶
-
flow¶ - Type
-
flow_polygons¶ - Type
-
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 filedelimiter (
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 stepssrid (
Optional[int]) – EPSG Spatial Reference System Identifier of results filesattributes (
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 secondsrainfall_zones (
int) – Number of rainfall zonespermeable_areas_friction (
float) – Friction coefficient for permeable areasimpermeable_areas_friction (
float) – Friction coefficient for impermeable areasspatial_rainfall (
bool) – Whether or not rainfall is spatially variableoutput_interval (
int) – Time in seconds between output filesinitial_timestep (
int) – Time in seconds between first and second model time stepsuse_infiltration (
bool) – Whether or not to include infiltrationhydraulic_conductivity (
float) – Hydraulic conductivity of green areaswetting_front_suction_head (
float) – Wetting front suction head of green areaseffective_porosity (
float) – Effective porosity of green areaseffective_saturation (
float) – Effective saturation of green areasroof_storage (
float) – Roof storage of buildings in metrescreate_max_depth_file (
bool) – Whether or not to create a CSV file containing maximum depthsopen_external_boundaries (
bool) – Whether or not to set external boundaries as openbuildings_algorithm (
int) – The algorithm to use when extracting buildings from the domainpermeable_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 valuesspatial – 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 convertindex – 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)