> ## Documentation Index
> Fetch the complete documentation index at: https://docs.plantpredict.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get horizon elevation profile for a location

> Returns the horizon elevation profile (azimuth → elevation angle) for a given latitude/longitude. Used to construct shade scenes that account for terrain or distant obstructions surrounding a site.



## OpenAPI

````yaml /api-docs/api-reference/plantpredict-api.yaml get /Weather/GetHorizonScene
openapi: 3.1.0
info:
  title: PlantPredict API
  version: 12.13.0
  description: >
    ## What is PlantPredict?


    PlantPredict is an industry-leading performance modeling platform for
    utility-scale

    solar power plants. It predicts energy yield across the full project
    lifecycle —

    from early-stage site prospecting through detailed engineering and
    operational

    monitoring. The same engine that powers the PlantPredict web UI is fully
    exposed

    via this REST API, enabling automation of complex, high-time-resolution
    energy

    predictions without any UI interaction.


    ## Domain Model — read this first


    Understanding the object hierarchy is essential before calling the API:


    - **Weather** — A weather file (hourly irradiance, temperature, wind, etc.)
    for a
      geographic location. Imported from a provider (e.g. SolarAnywhere, Meteonorm) or
      uploaded manually. Weather files live in a company-wide library and are referenced
      by Predictions.

    - **Module** — A PV module definition parameterized with electrical
    characteristics
      (STC power, temperature coefficients, single-diode model parameters, IAM curves,
      etc.). Modules live in a company-wide library.

    - **Inverter** — An inverter definition with efficiency curves,
    voltage/power ratings,
      and optional kVA derating curves. Inverters live in a company-wide library.

    - **Project** — A named location (lat/lon) that acts as a container for one
    or more
      Predictions. Holds geographic metadata (country, elevation, UTC offset) and a status.

    - **Prediction** — The core simulation configuration nested under a Project.
    Defines
      the simulation period, model selections (transposition, air mass, degradation,
      soiling, shading, spectral shift models), uncertainty error terms, and references
      to a Weather file. A Prediction must be linked to a PowerPlant before it can be run.
      Status values: 0 = Draft, 1 = Active, 2 = Issued, 3 = Archived.

    - **PowerPlant** — The physical plant design attached to a Prediction.
    Describes the
      electrical topology: Blocks → Arrays → Inverters → DC Fields (strings of modules).
      Also includes transformers, transmission lines, energy storage (ESS), availability
      losses, and LGIA export limits.

    - **Shade Scene** — An optional 3D shading model (PVJ format) attached to a
      Prediction's DC Fields. Supports import from PVC or SHD files. Shade and TABT
      (Tracker Angle Back-Tracking) calculations are queued and run asynchronously.

    ## Typical workflow to run a prediction


    1. Ensure a **Weather** file exists (search, download, or import one).

    2. Ensure a **Module** and **Inverter** exist in the library.

    3. **POST /Project** — create a project at the site location.

    4. **POST /Project/{projectId}/Prediction** — create a prediction with model
    settings.

    5. **POST /Project/{projectId}/Prediction/{predictionId}/PowerPlant** —
    attach a plant
       design referencing your module and inverter.
    6. **POST /Project/{projectId}/Prediction/{predictionId}/Run** — queue the
    simulation.

    7. Poll **GET /Project/{projectId}/Prediction/{predictionId}/Overview**
    until
       `status` reaches 2 (complete), then retrieve results via `/ResultSummary`,
       `/ResultDetails`, or `/NodalJson`.

    ## Authentication


    OAuth 2.0 **Client Credentials** flow via AWS Cognito. The spec advertises

    a single `bearerAuth` scheme — fetch a token yourself with the snippet

    below, then either paste it into the in-browser playground or pass it on

    every request as `Authorization: Bearer <token>`.


    > **Why not advertise OAuth2 directly?** Most users have access to the

    > production tenant only, and we don't want to invite anyone to enter

    > long-lived `client_id` / `client_secret` credentials into a third-party

    > documentation site. Keep credentials in your own environment; ship

    > short-lived bearer tokens to wherever they are needed.


    - Token URL:
    `https://terabase-prd.auth.us-west-2.amazoncognito.com/oauth2/token`

    - Scopes: `transactions/get` (read), `transactions/post` (write) — request
      both to access the entire surface.
    - Send credentials as **Basic Auth** in the token request header.


    Example:


    ```bash

    curl -X POST
    'https://terabase-prd.auth.us-west-2.amazoncognito.com/oauth2/token' \
      -u "$PP_CLIENT_ID:$PP_CLIENT_SECRET" \
      -d 'grant_type=client_credentials&scope=transactions/get transactions/post'
    ```


    API credentials (Client ID + Secret) are generated per user by a company
    admin

    inside the PlantPredict UI (gear icon → user profile → Generate API
    Credentials).

    Store them securely — they are shown only once.


    ## Notes


    - All request/response bodies are JSON (`Content-Type: application/json`).

    - The API is stateless — every request must supply complete inputs; there is
    no session.

    - POST operations that create entities return `{"id": <integer>}`.

    - Many integer fields (model types, status codes) map to named enums — use
      `GET /Definitions` to retrieve the full enum catalog at runtime.
    - Long-running operations (Run, Shade calculations, TABT) are asynchronous;
    poll
      the corresponding `ProcessingStatus` endpoint to track progress.
    - Responses may include an `X-Message` header with non-blocking warnings
    (e.g.
      duplicate project name).
servers:
  - url: https://api.plantpredict.terabase.energy
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Definitions
    description: Enum and model type definitions
  - name: Projects
    description: Solar project management
  - name: Predictions
    description: Energy prediction configuration and execution
  - name: PowerPlant
    description: Power plant design (blocks, arrays, inverters, transformers)
  - name: TimeSeries
    description: Custom time series data inputs
  - name: Results
    description: Prediction results — summary, details, nodal, average energy
  - name: FinancialModel
    description: Financial model parameters and cashflow results
  - name: Reports
    description: Report generation and export
  - name: ShadeScene
    description: 3D shade scene management and calculations
  - name: Weather
    description: Weather file import, download, and management
  - name: Inverters
    description: Inverter library management
  - name: Modules
    description: PV module library and single-diode parameter generation
  - name: ASHRAE
    description: ASHRAE climate station lookup
  - name: System
    description: System version and maintenance status
  - name: Company
    description: Company settings and user management
  - name: Country
    description: Reference country data
paths:
  /Weather/GetHorizonScene:
    get:
      tags:
        - Weather
      summary: Get horizon elevation profile for a location
      description: >-
        Returns the horizon elevation profile (azimuth → elevation angle) for a
        given latitude/longitude. Used to construct shade scenes that account
        for terrain or distant obstructions surrounding a site.
      operationId: getHorizonScene
      parameters:
        - name: Latitude
          in: query
          required: true
          schema:
            type: number
        - name: Longitude
          in: query
          required: true
          schema:
            type: number
      responses:
        '200':
          description: Horizon points
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/HorizonPoint'
              examples:
                postman-get-horizon-details:
                  value:
                    - azimuth: 0
                      elevation: 24
                    - azimuth: 5
                      elevation: 25
                    - azimuth: 7
                      elevation: 24
                    - azimuth: 10
                      elevation: 23
                    - azimuth: 13
                      elevation: 21
                    - azimuth: 17
                      elevation: 20
                    - azimuth: 19
                      elevation: 19
                    - azimuth: 20
                      elevation: 18
                    - azimuth: 21
                      elevation: 17
                    - azimuth: 23
                      elevation: 16
                    - azimuth: 26
                      elevation: 15
                    - azimuth: 28
                      elevation: 14
                    - azimuth: 31
                      elevation: 13
                    - azimuth: 33
                      elevation: 12
                    - azimuth: 44
                      elevation: 11
                    - azimuth: 46
                      elevation: 10
                    - azimuth: 49
                      elevation: 9
                    - azimuth: 55
                      elevation: 8
                    - azimuth: 60
                      elevation: 7
                    - azimuth: 65
                      elevation: 6
                    - azimuth: 67
                      elevation: 5
                    - azimuth: 69
                      elevation: 4
                    - azimuth: 73
                      elevation: 5
                    - azimuth: 77
                      elevation: 6
                    - azimuth: 80
                      elevation: 7
                    - azimuth: 85
                      elevation: 8
                    - azimuth: 95
                      elevation: 9
                    - azimuth: 97
                      elevation: 8
                    - azimuth: 99
                      elevation: 9
                    - azimuth: 104
                      elevation: 10
                    - azimuth: 113
                      elevation: 9
                    - azimuth: 114
                      elevation: 10
                    - azimuth: 115
                      elevation: 9
                    - azimuth: 117
                      elevation: 11
                    - azimuth: 119
                      elevation: 12
                    - azimuth: 121
                      elevation: 13
                    - azimuth: 122
                      elevation: 14
                    - azimuth: 125
                      elevation: 15
                    - azimuth: 129
                      elevation: 16
                    - azimuth: 132
                      elevation: 17
                    - azimuth: 135
                      elevation: 18
                    - azimuth: 136
                      elevation: 17
                    - azimuth: 137
                      elevation: 18
                    - azimuth: 141
                      elevation: 19
                    - azimuth: 147
                      elevation: 20
                    - azimuth: 154
                      elevation: 19
                    - azimuth: 160
                      elevation: 18
                    - azimuth: 161
                      elevation: 17
                    - azimuth: 164
                      elevation: 16
                    - azimuth: 166
                      elevation: 17
                    - azimuth: 171
                      elevation: 18
                    - azimuth: 192
                      elevation: 17
                    - azimuth: 194
                      elevation: 18
                    - azimuth: 197
                      elevation: 17
                    - azimuth: 225
                      elevation: 16
                    - azimuth: 227
                      elevation: 15
                    - azimuth: 234
                      elevation: 14
                    - azimuth: 238
                      elevation: 13
                    - azimuth: 252
                      elevation: 14
                    - azimuth: 256
                      elevation: 15
                    - azimuth: 260
                      elevation: 16
                    - azimuth: 261
                      elevation: 17
                    - azimuth: 262
                      elevation: 18
                    - azimuth: 266
                      elevation: 19
                    - azimuth: 267
                      elevation: 20
                    - azimuth: 272
                      elevation: 21
                    - azimuth: 273
                      elevation: 22
                    - azimuth: 275
                      elevation: 23
                    - azimuth: 276
                      elevation: 24
                    - azimuth: 278
                      elevation: 26
                    - azimuth: 279
                      elevation: 28
                    - azimuth: 283
                      elevation: 29
                    - azimuth: 286
                      elevation: 28
                    - azimuth: 289
                      elevation: 27
                    - azimuth: 298
                      elevation: 28
                    - azimuth: 303
                      elevation: 29
                    - azimuth: 311
                      elevation: 30
                    - azimuth: 325
                      elevation: 31
                    - azimuth: 326
                      elevation: 32
                    - azimuth: 328
                      elevation: 31
                    - azimuth: 335
                      elevation: 30
                    - azimuth: 339
                      elevation: 29
                    - azimuth: 344
                      elevation: 28
                    - azimuth: 345
                      elevation: 29
                    - azimuth: 347
                      elevation: 28
                    - azimuth: 350
                      elevation: 27
                    - azimuth: 353
                      elevation: 26
                    - azimuth: 356
                      elevation: 24
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    HorizonPoint:
      type: object
      properties:
        azimuth:
          type: number
        elevation:
          type: number
    ModelStateError:
      type: object
      description: |
        ASP.NET Web API validation error. `modelState` maps the offending
        field name (or `request`) to a list of human-readable messages.
      properties:
        message:
          type: string
        modelState:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
      required:
        - message
  responses:
    BadRequest:
      description: |
        The request was rejected. PlantPredict returns one of two shapes:

        * `application/json` with `{message, modelState}` for input
          validation errors (ASP.NET Web API model-state). The `modelState`
          map keys field names to lists of human-readable error messages.
        * `text/plain` with a free-form message for runtime / database
          errors that bubble up before validation completes.

        Clients should branch on the `Content-Type` header.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ModelStateError'
          example:
            message: The request is invalid.
            modelState:
              latitude:
                - The field Latitude must be between -90 and 90.
        text/plain:
          schema:
            type: string
          example: A successfully completed prediction cannot be cancelled.
    Unauthorized:
      description: >-
        Missing or invalid bearer token. The response body is empty and no
        `Content-Type` header is set; the 401 status code is the only signal.
        Fetch a fresh token (see the **Authentication** section of the API
        description) and retry.
    ServerError:
      description: |
        Unexpected server-side error. The body is usually a plain-text message
        but its structure is not guaranteed — treat it as opaque diagnostic
        text. Common causes: database constraint violation, downstream
        service timeout, internal exception. Retry-safe for idempotent
        requests; for non-idempotent ones, verify state before retrying.
      content:
        text/plain:
          schema:
            type: string
          example: An error has occurred.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Pass `Authorization: Bearer <token>` on every request. See the
        **Authentication** section of the API description for how to fetch a
        token.

````