Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/maxiricalde/ProfeLedesma/llms.txt

Use this file to discover all available pages before exploring further.

The Site class (in helpers/Sites.py) is a simple lookup wrapper for a hardcoded registry of 16 solar irradiance measurement stations across South America. Instantiate it with a station code to immediately access that station’s geographic coordinates and altitude.

Constructor

Site(cod)

Parameters

cod
str
required
Station code string. Must be one of the 16 registered codes:'PAR', 'FLO', 'BSA', 'PIL', 'PTR', 'YU', 'BRB', 'SA', 'SCA', 'ERO', 'LQ', 'TG', 'ERI', 'CAU', 'CE', 'AP'Raises ValueError if the code is not found in the internal registry.

Instance Attributes

After construction, the following attributes are available:
AttributeTypeDescription
codstrStation code passed to the constructor
latfloatLatitude in decimal degrees (negative = Southern Hemisphere)
longfloatLongitude in decimal degrees (negative = west of Prime Meridian)
altfloatAltitude in metres above sea level
idxintZero-based index position of the station in the internal registry list

Methods

describe() → None

site.describe() -> None
Prints a human-readable summary of the station to stdout:
Site <cod>
lat <lat>, long <long>, alt <alt>
No parameters. No return value.

getNeighbors(order) → list[str]

site.getNeighbors(order: int) -> list[str]
Returns a list of grid-point identifiers at Manhattan distance order from the station’s reference grid position. Each identifier is formatted as '{lat}_{lon}' with coordinates rounded to 5 decimal places.
ParameterTypeDescription
orderintManhattan distance k from the station. k=1 returns immediate neighbours, k=2 the next ring, and so on.
Returns list[str] — grid-point strings in the form '{lat}_{lon}', using a 0.1° resolution grid.
getNeighbors relies on lats_init and lons_init reference coordinates that are commented out in the current version of helpers/Sites.py. Calling this method on any Site instance will raise a NameError. The method signature is documented here for completeness; enable it by uncommenting the reference arrays in the source.

Usage Example

from helpers.Sites import Site

site = Site('LQ')

print(site.lat)    # -22.103936
print(site.long)   # -65.599923
print(site.alt)    # 3500
print(site.idx)    # 10

site.describe()
# Site LQ
# lat -22.103936, long -65.599923, alt 3500
Pass the coordinates directly into Geo and other helpers:
import pandas as pd
from helpers.Sites import Site
from helpers.Geo import Geo

s = Site('SA')

ranges = pd.date_range(
    start='2022/01/01 00:00',
    end='2022/12/31 23:59',
    freq='1min'
)

dfGeo = Geo(
    range_dates=ranges,
    lat=s.lat,
    long=s.long,
    gmt=0,
    alt=s.alt,
    beta=0
).df

Station Registry

All 16 stations registered in helpers/Sites.py:
CodeLatitudeLongitudeAltitude (m)
PAR5.80600−55.214604
FLO−27.60470−48.5227011
BSA−34.60000−58.4800030
PIL−31.67000−63.88000335
PTR−9.06900−40.32000387
YU−23.58440−64.50660401
BRB−15.60100−47.713001023
SA−24.72880−65.409501233
SCA−25.89510−65.925001624
ERO−24.39278−65.768063355
LQ−22.103936−65.5999233500
TG−24.59000−67.400003560
ERI−23.97360−67.115603729
CAU−23.668466−66.7449953915
CE−24.89438−65.471051235
AP−22.80205−65.824363459
Stations are stored in module-level lists (sites, lats, lons, alts) indexed in the order shown above. The Site.idx attribute gives the zero-based position in these lists, which can be useful for vectorised operations across the full registry.

Build docs developers (and LLMs) love