---
type: Attested Computation
title: daylight
identifier: astro/daylight
description: 'How light it is outside right now at a latitude and longitude, as one number from 0 (night) to 1 (the sun overhead): the sine of the sun''s altitude, computed with ephem (no network). A body can grow by it.'
pack: astro
tags:
- world
runtime: fragletc
image: ofthemachine/python3@sha256:59784cff1945b7d6093a591b5e5292b8c989f0691af0494fbbe1c6b8083a16cb
network: none
stdin: none
execution_class: hermetic
procedure_hash: sha256:e160efd0182c255cd3f8a211e284dc4a3447cd951fc222959766c70c7699fdc1
parameters:
- name: lat
  type: string
  required: true
  description: Latitude in decimal degrees, e.g. 43.65
- name: lon
  type: string
  required: true
  description: Longitude in decimal degrees, east positive, e.g. -79.38
computation: https://tools.ofthemachine.com/astro/daylight.py
executor:
  resource: https://github.com/ofthemachine/fraglet
  receipt:
  - schema
  - fragletc
  - procedure
  - procedure_hash
  - image
  - image_digest
  - network
  - stdin_mode
  - params
  - inputs
  - argv
  - env
  - memo_key
  - started
  - finished
  - exit_code
  - stdout
  - outputs
  format: fraglet-receipt/2 (fragletc --receipt <path>, or FRAGLETC_RECEIPT_DIR)
attester:
  resource: https://tools.ofthemachine.com/receipt/attest.py
  method: 'deterministic, no re-execution: procedure_hash equals sha256 of computation; memo_key recomputes from the receipt''s own fields; claimed params and any artifact hash match the receipt'
generated:
  by: process:tools/catalog/compile.py
  at: '2026-11-13T18:27:40Z'
outputs:
- light.txt
---

# daylight

How light it is outside right now at a latitude and longitude, as one number from 0 (night) to 1 (the sun overhead): the sine of the sun's altitude, computed with ephem (no network). A body can grow by it.

Use when an agent's body or a card wants daylight now as a single number, e.g. a plant that opens in the sun.

# Schema

## Parameters
- `lat` (string, required) — Latitude in decimal degrees, e.g. 43.65
- `lon` (string, required) — Longitude in decimal degrees, east positive, e.g. -79.38

## Outputs
- `light.txt` (declared file under /output)

# Execution

The computation is [`astro/daylight.py`](https://tools.ofthemachine.com/astro/daylight.py) (frontmatter `computation`; in `tools.tar.gz` the same file sits at `astro/daylight.py` beside this bundle), run by `fragletc` in `ofthemachine/python3@sha256:59784cff1945b7d6093a591b5e5292b8c989f0691af0494fbbe1c6b8083a16cb` with network `none`. Its identity is `procedure_hash` = sha256 of that file, shebang included — the same value every receipt records. Parameters are passed as `-p name=value`; `--receipt run.json` (or `FRAGLETC_RECEIPT_DIR`) writes the receipt, a `fraglet-receipt/2` JSON document with the fields listed under `executor.receipt`.

# Attestation

A run's receipt is attested with [`receipt/attest.py`](https://tools.ofthemachine.com/receipt/attest.py): the computation that ran is this script (`procedure_hash`), the receipt is internally consistent (`memo_key` recomputes from its own fields), the claimed parameters are the ones that ran, and an artifact claimed as an output hashes to what the receipt recorded. No re-execution: attestation is provenance fidelity, not reproduction.

Hermetic: no network, so `memo_key` also fully determines the outputs — a re-run with the same inputs must reproduce them, which makes results from this tool safely memoizable.

Skill: [SKILL.md](https://tools.ofthemachine.com/astro/SKILL.md)
