API Reference

General

Settings

General model environment and simulation settings.

class sitka.general.settings.Settings(working_directory)[source]

Store general simulation settings.

Parameters:working_directory (str) – A valid directory used for working files.
working_directory

Input/Output

Time

Time constructs.

class sitka.io.time.Time(year=2018, start_hour=0, end_hour=8760, time_steps_per_hour=4)[source]

Object to store solar angles for a site.

Parameters:
  • year (int) – The year to use in starting the date-time.
  • start_hour (int) – The hour to start simulations.
  • end_hour (int) – The ending hour for simulations.
  • time_steps_per_hour (int) – The number of time steps per hour for a simulation.
time_range
datetime_range
time_step
_year
_start_hour
_end_hour
_time_steps_per_hour
update_calculated_values()[source]
calculate_time_step()[source]
calculate_time_range()[source]
calculate_datetime_range()[source]
calculate_julian_day()[source]
calculate_datetime_range()[source]

Create a date time array for the given range.

Parameters:
  • year
  • start_hour
  • end_hour
  • time_steps_per_hour
Yields:

date_time_range (array of date-time objects)

calculate_time_range()[source]

Deterine the time range.

Parameters:
  • start_hour
  • end_hour
  • time_step
Yields:

time_range (array of floats)

calculate_time_step()[source]

Deterine the number of time steps to use per hour.

Parameters:time_steps_per_hour
Yields:time_step (float)
update_calculated_values()[source]

Update all calculated values.

Weather

Weather files and weather data imports.

Calculations

Solar

Solar geometry, angles and shading.

class sitka.calculations.solar.SolarAngles(time, site)[source]

Store solar angles for a site.

Parameters:
  • time
  • site
gamma

Series – Gamma angle.

equation_of_time

Series – Equation of time.

apparent_solar_time

Series – Apparent solar time.

declination

Series – Solar declination angle.

hour_angle

Series – Hour angle of the sun.

number_of_sunlight_hours

Series – Number of sunlight hours per day.

sun_up

Series – Flag to define when the sun is above the horizon (1 = sun up, 0 = sun is down).

solar_zenith

Series – Solar zenith angle.

solar_altitude

Series – Solar altitude angle.

solar_azimuth

Series – Solar azimuth angle.

calculate_apparent_solar_time()[source]

Calculate the apparent solar time for each item in the series.

Parameters:
  • hour (Series) –
  • equation_of_time (Series) –
  • longitude (float) –
  • local_standard_meridian (float) –
Yields:

apparent_solar_time (Series)

References

calculate_declination()[source]

Calculate the solar declination angle for each item in the series.

Parameters:julian_day (Series) –
Yields:declination (Series)

References

calculate_equation_of_time()[source]

Calculate equation of time from Gamma.

Parameters:gamma (Series) –
Yields:equation_of_time (Series)

References

calculate_gamma()[source]

Calculate Gamma from the julian_day.

Parameters:julian_day (Series) – Julian day number [1-365]
Yields:gamma (Series)

References

calculate_hour_angle()[source]

Calculate the solar hour angle for each item in the series.

Parameters:apparent_solar_time (Series) –
Yields:hour_angle (Series)

References

calculate_number_of_sunlight_hours()[source]

Calculate the number of sunlight hours per day for each item in the series.

Parameters:
  • latitude (float) –
  • declination (Series) –
Yields:

number_of_sunlight_hours (Series)

References

calculate_solar_altitude()[source]

Calculate the solar altitude angle for each item in the series.

Parameters:
  • calculate_sun_up (Series) –
  • solar_zenith (Series) –
Yields:

solar_altitude (Series)

References

calculate_solar_azimuth()[source]

Calculate the solar azimuth angle for each item in the series.

Parameters:
  • latitude (float) –
  • declination (Series) –
  • hour_angle (Series) –
  • solar_altitude (Series) –
Yields:

solar_azimuth (Series)

References

calculate_solar_zenith()[source]

Calculate the solar zenith angle for each item in the series.

Parameters:
  • latitude (float) –
  • sun_up (Series) –
  • declination (Series) –
  • hour_angle (Series) –
Yields:

solar_zenith (Series)

References

calculate_sun_up()[source]

Set a flag for whether the sun is above the horizon for each item in the series.

Parameters:
  • hour_angle (Series) –
  • sunrise_hour_angle (Series) –
  • sunset_hour_angle (Series) –
Yields:

sun_up (Series)

References

calculate_sunrise_hour_angle()[source]

Calculate the sunrise hour angle for each item in the series.

Parameters:
  • latitude (float) –
  • declination (Series) –
Yields:

sunrise_hour_angle (Series)

References

calculate_sunset_hour_angle()[source]

Calculate the sunset hour angle for each item in the series.

Parameters:
  • latitude (float) –
  • declination (Series) –
Yields:

sunset_hour_angle (Series)

References

update_calculated_values()[source]

Update all calculated values.

Components

Site

Site and building information.

class sitka.components.site.Site(latitude=0, longitude=0, elevation=0)[source]

Represent the building site location and properties.

Parameters:
  • latitude (float) – Site latitude in degrees.
  • longitude (float) – Site longitude in degrees.
  • elevation (float) – Site elevation above sea-level in meters.
local_standard_meridian
latitude
longitude
elevation
update_calculated_values()[source]
calculate_local_standard_meridian()[source]
calculate_local_standard_meridian()[source]

Calculate the local standard meridian based on the site longitude.

Parameters:longitude
Yields:local_standard_meridian (float)