pvlib.location.Location#

class pvlib.location.Location(latitude, longitude, tz='UTC', altitude=None, name=None)[source]#

Location objects are convenient containers for latitude, longitude, time zone, and altitude data associated with a particular geographic location. You can also assign a name to a location object.

Location objects have two time-zone attributes:

  • tz is an IANA time-zone string.

  • pytz is a pytz-based time-zone object (read only).

The read-only pytz attribute will stay in sync with any changes made using tz.

Location objects support the print method.

Parameters:
  • latitude (float.) – Positive is north of the equator. Use decimal degrees notation.

  • longitude (float.) – Positive is east of the prime meridian. Use decimal degrees notation.

  • tz (time zone as str, int, float, or datetime.tzinfo, default 'UTC'.) –

    See http://en.wikipedia.org/wiki/List_of_tz_database_time_zones for a list of valid name strings. An int or float must be a whole-number hour offsets from UTC that can be converted to the IANA-supported ‘Etc/GMT-N’ format. (Note the limited range of the offset N and its sign-change convention.) Time zones from the pytz and zoneinfo packages may also be passed here, as they are subclasses of datetime.tzinfo.

    The tz attribute is represented as a valid IANA time zone name string.

  • altitude (float, optional) – Altitude from sea level in meters. If not specified, the altitude will be fetched from pvlib.location.lookup_altitude(). If no data is available for the location, the altitude is set to 0.

  • name (string, optional) – Sets the name attribute of the Location object.

Raises:
  • ValueError – when the time zone tz cannot be converted.

  • zoneinfo.ZoneInfoNotFoundError – when the time zone tz is not recognizable as an IANA time zone by the zoneinfo.ZoneInfo initializer used for internal time-zone representation.

Methods

__init__(latitude, longitude[, tz, ...])

from_epw(metadata[, data])

Create a Location object based on a metadata dictionary from epw data readers.

from_tmy(tmy_metadata[, tmy_data])

Create an object based on a metadata dictionary from tmy2 or tmy3 data readers.

get_airmass([times, solar_position, model])

Calculate the relative and absolute airmass.

get_clearsky(times[, model, solar_position, ...])

Calculate the clear sky estimates of GHI, DNI, and/or DHI at this location.

get_solarposition(times[, pressure, temperature])

Uses the pvlib.solarposition.get_solarposition() function to calculate the solar zenith, azimuth, etc.

get_sun_rise_set_transit(times[, method])

Calculate sunrise, sunset and transit times.

Attributes

pytz

The location's pytz time zone (read only).

tz

The location's IANA time-zone string.

Examples using pvlib.location.Location#

Simulating PV system DC output using the ADR module efficiency model

Simulating PV system DC output using the ADR module efficiency model

Fixed-Tilt Simulation with pvfactors

Fixed-Tilt Simulation with pvfactors

Bifacial Modeling - procedural

Bifacial Modeling - procedural

Bifacial Modeling - modelchain

Bifacial Modeling - modelchain

Mixed Orientation

Mixed Orientation

Reverse transposition using one year of hourly data

Reverse transposition using one year of hourly data

GHI to POA Transposition

GHI to POA Transposition

Seasonal Tilt

Seasonal Tilt

Use different Perez coefficients with the ModelChain

Use different Perez coefficients with the ModelChain

Modeling with interval averages

Modeling with interval averages

Modeling Transposition Gain

Modeling Transposition Gain

Simple irradiance adjustment for horizon shading

Simple irradiance adjustment for horizon shading

Modelling shading losses in modules with bypass diodes

Modelling shading losses in modules with bypass diodes

Dual-Axis Tracking

Dual-Axis Tracking

Discontinuous Tracking

Discontinuous Tracking

Spectral Mismatch Estimation

Spectral Mismatch Estimation

4.7 MW CdTe single-axis tracking (OEDI System 9068)

4.7 MW CdTe single-axis tracking (OEDI System 9068)