ladybug.location module

Ladybug location.

class ladybug.location.Location(city=None, state=None, country=None, latitude=0, longitude=0, time_zone=None, elevation=0, station_id=None, source=None)[source]

Bases: object

Ladybug Location.

Parameters:
  • city – Name of the city as a string.

  • state – Optional state in which the city is located.

  • country – Name of the country as a string.

  • latitude – Location latitude between -90 and 90 (Default: 0).

  • longitude – Location longitude between -180 (west) and 180 (east) (Default: 0).

  • time_zone – Time zone between -12 hours (west) and +14 hours (east). If None, the time zone will be an estimated integer value derived from the longitude in accordance with solar time (Default: None).

  • elevation – A number for elevation of the location in meters. (Default: 0).

  • station_id – ID of the location if the location is representing a weather station.

  • source – Source of data (e.g. TMY, TMY3).

Properties:
  • city

  • country

  • elevation

  • latitude

  • longitude

  • meridian

  • source

  • state

  • station_id

  • time_zone

  • is_default

ToString()[source]

Overwrite .NET ToString.

duplicate()[source]

Duplicate location.

classmethod from_dict(data)[source]

Create a location from a dictionary.

Parameters:

data – A python dictionary in the following format

{
"city": "-",
"latitude": 0,
"longitude": 0,
"time_zone": 0,
"elevation": 0
}
classmethod from_idf(idf_string)[source]

Create a Ladybug location from an EnergyPlus IDF string.

Parameters:

idf_string – A full IDF string representing a Site:Location.

classmethod from_location(location)[source]

Try to create a Ladybug location from a location string.

Parameters:

locationString – Location string

Usage:

l = Location.from_location(locationString)
to_dict()[source]

Get location as a a dictionary.

to_idf()[source]

Get the Location as an EnergyPlus IDF string.

city
country
property elevation

Get or set a number for the location elevation in meters.

property is_default

Get a boolean for whether the Location properties are defaulted.

property latitude

Get or set the location latitude in degrees.

property longitude

Get or set the location longitude in degrees.

property meridian

Get a number between -180 and +180 for the meridian west of Greenwich.

source
state
station_id
property time_zone

Get or set the location time zone as a number between -12 and +14.