Skip to content

Sky

frads.gen_perez_sky

gen_perez_sky(
    dt,
    latitude,
    longitude,
    timezone,
    year=None,
    dirnorm=None,
    diffhor=None,
    dirhor=None,
    dirnorm_illum=None,
    diffhor_illum=None,
    solar=False,
    grefl=None,
    rotate=None,
)

Generate a perez sky using gendaylit.

Parameters:

Name Type Description Default
dt datetime

A datetime object.

required
latitude float

A latitude value.

required
longitude float

A longitude value.

required
timezone int

A timezone value.

required
year Optional[int]

A year value.

None
dirnorm Optional[float]

A direct normal value.

None
diffhor Optional[float]

A diffuse horizontal value.

None
dirhor Optional[float]

A direct horizontal value.

None
dirnorm_illum Optional[float]

A direct normal illuminance value.

None
diffhor_illum Optional[float]

A diffuse horizontal illuminance value.

None
solar bool

If True, solar will be generated.

False
grefl Optional[float]

A ground reflectance value.

None
rotate Optional[float]

A rotation value.

None

Returns:

Name Type Description
bytes bytes

the sky primitive.

frads.genskymtx

genskymtx(
    data=None,
    meta=None,
    wpath=None,
    onesun=False,
    header=True,
    average=False,
    sun_only=False,
    sky_only=False,
    sun_file=None,
    sun_mods=None,
    daylight_hours_only=False,
    sky_color=None,
    ground_color=None,
    rotate=None,
    outform=None,
    solar_radiance=False,
    mfactor=1,
)

Call gendaymtx to generate a sky/sun matrix Write results to out. It takes either a .wea file path or wea data and metadata (defined in frads.types). If both are provided, .wea file path will be used.

Parameters:

Name Type Description Default
data Optional[Sequence[WeaData]]

A list of WeaData objects.

None
meta Optional[WeaMetaData]

A WeaMetaData object.

None
wpath Optional[Union[str, Path]]

A .wea file path.

None
onesun bool

If True, only one sun will be generated.

False
header bool

If True, a header will be included in the output.

True
average bool

If True, the output will be averaged.

False
sun_only bool

If True, only sun will be generated.

False
sky_only bool

If True, only sky will be generated.

False
sun_file Optional[str]

A sun file path.

None
sun_mods Optional[str]

A sun modifier.

None
daylight_hours_only bool

If True, only daylight hours will be generated.

False
sky_color Optional[List[float]]

A list of sky color values.

None
ground_color Optional[List[float]]

A list of ground color values.

None
rotate Optional[float]

A rotation value.

None
outform Optional[str]

An output format.

None
solar_radiance bool

If True, solar radiance will be generated.

False
mfactor int

An mfactor value.

1

Returns:

Type Description
bytes

A bytes object containing the output.

Raises:

Type Description
ValueError

An error occurs if neither a .wea path nor wea data is provided.