Skip to content

Commit

Permalink
#200 Expose more Helios parameters to config (5)
Browse files Browse the repository at this point in the history
Update API reference
  • Loading branch information
dostuffthatmatters committed Nov 8, 2023
1 parent 623eefc commit 6919604
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
21 changes: 11 additions & 10 deletions packages/docs/docs/api-reference/core/threads/helios_thread.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,23 @@ __init__(logger: Logger, camera_id: int, initialization_tries: int = 5) → None

---

<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/threads/helios_thread.py#L140" className="SourceCodeLinkBadge">source code</a>
<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/threads/helios_thread.py#L141" className="SourceCodeLinkBadge">source code</a>

### <kbd>method</kbd> `adjust_exposure`

```python
adjust_exposure() → None
```

This function will loop over all available exposures and take one image for each exposure. Then it sets exposure to the value where the overall mean pixel value color is closest to 50.
This function will loop over all available exposures and take one image for each exposure. Then it sets exposure to the value where the overall mean pixel value color is closest to `self.target_pixel_brightness`.

**For every exposure:**

1. set new exposure 2. 0.3s sleep 3. image 1 -> 0.1s sleep -> image 2 -> 0.1s sleep -> image 3 8. calculate mean color of all 3 images 9. save images to disk

---

<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/threads/helios_thread.py#L67" className="SourceCodeLinkBadge">source code</a>
<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/threads/helios_thread.py#L68" className="SourceCodeLinkBadge">source code</a>

### <kbd>method</kbd> `get_available_exposures`

Expand All @@ -80,14 +80,15 @@ Loop over every integer in [-20, ..., +20] and try to set the camera exposure to

---

<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/threads/helios_thread.py#L215" className="SourceCodeLinkBadge">source code</a>
<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/threads/helios_thread.py#L216" className="SourceCodeLinkBadge">source code</a>

### <kbd>method</kbd> `run`

```python
run(
station_id: str,
edge_color_threshold: int,
target_pixel_brightness: int,
save_images_to_archive: bool,
save_current_image: bool
) → float
Expand All @@ -97,7 +98,7 @@ Take an image and evaluate the sun conditions. Run autoexposure function every 5

---

<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/threads/helios_thread.py#L117" className="SourceCodeLinkBadge">source code</a>
<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/threads/helios_thread.py#L118" className="SourceCodeLinkBadge">source code</a>

### <kbd>method</kbd> `take_image`

Expand All @@ -114,7 +115,7 @@ Retries up to n times (camera can say "not possible") and throws away all mostly

---

<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/threads/helios_thread.py#L80" className="SourceCodeLinkBadge">source code</a>
<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/threads/helios_thread.py#L81" className="SourceCodeLinkBadge">source code</a>

### <kbd>method</kbd> `update_camera_settings`

Expand All @@ -135,7 +136,7 @@ Update the settings of the connected camera. Which settings are available depend

---

<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/threads/helios_thread.py#L245" className="SourceCodeLinkBadge">source code</a>
<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/threads/helios_thread.py#L259" className="SourceCodeLinkBadge">source code</a>

## <kbd>class</kbd> `HeliosThread`
Thread for determining the current sun conditions in a parallel mainloop.
Expand All @@ -151,7 +152,7 @@ The result of this constant sunlight evaluation is written to the StateInterface

---

<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/threads/helios_thread.py#L271" className="SourceCodeLinkBadge">source code</a>
<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/threads/helios_thread.py#L285" className="SourceCodeLinkBadge">source code</a>

### <kbd>method</kbd> `get_new_thread_object`

Expand All @@ -163,7 +164,7 @@ Return a new thread object that is to be started.

---

<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/threads/helios_thread.py#L276" className="SourceCodeLinkBadge">source code</a>
<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/threads/helios_thread.py#L290" className="SourceCodeLinkBadge">source code</a>

### <kbd>method</kbd> `main`

Expand All @@ -175,7 +176,7 @@ Main entrypoint of the thread. In headless mode, don't write to log files but p

---

<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/threads/helios_thread.py#L263" className="SourceCodeLinkBadge">source code</a>
<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/threads/helios_thread.py#L277" className="SourceCodeLinkBadge">source code</a>

### <kbd>method</kbd> `should_be_running`

Expand Down
18 changes: 9 additions & 9 deletions packages/docs/docs/api-reference/core/types/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ Returns the set of fields that have been set on this model instance.

---

<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/types/config.py#L212" className="SourceCodeLinkBadge">source code</a>
<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/types/config.py#L213" className="SourceCodeLinkBadge">source code</a>

## <kbd>class</kbd> `PartialHeliosConfig`
Like `HeliosConfig`, but all fields are optional.
Expand Down Expand Up @@ -1053,7 +1053,7 @@ Returns the set of fields that have been set on this model instance.

---

<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/types/config.py#L227" className="SourceCodeLinkBadge">source code</a>
<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/types/config.py#L229" className="SourceCodeLinkBadge">source code</a>

## <kbd>class</kbd> `UploadStreamConfig`

Expand Down Expand Up @@ -1099,7 +1099,7 @@ Returns the set of fields that have been set on this model instance.

---

<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/types/config.py#L237" className="SourceCodeLinkBadge">source code</a>
<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/types/config.py#L239" className="SourceCodeLinkBadge">source code</a>

## <kbd>class</kbd> `UploadConfig`

Expand Down Expand Up @@ -1145,7 +1145,7 @@ Returns the set of fields that have been set on this model instance.

---

<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/types/config.py#L244" className="SourceCodeLinkBadge">source code</a>
<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/types/config.py#L246" className="SourceCodeLinkBadge">source code</a>

## <kbd>class</kbd> `PartialUploadConfig`
Like `UploadConfig`, but all fields are optional.
Expand Down Expand Up @@ -1189,7 +1189,7 @@ Returns the set of fields that have been set on this model instance.

---

<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/types/config.py#L253" className="SourceCodeLinkBadge">source code</a>
<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/types/config.py#L255" className="SourceCodeLinkBadge">source code</a>

## <kbd>class</kbd> `Config`

Expand Down Expand Up @@ -1234,7 +1234,7 @@ Returns the set of fields that have been set on this model instance.

---

<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/types/config.py#L335" className="SourceCodeLinkBadge">source code</a>
<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/types/config.py#L337" className="SourceCodeLinkBadge">source code</a>

### <kbd>method</kbd> `dump`

Expand All @@ -1248,7 +1248,7 @@ dump(with_filelock: 'bool' = True) → None

---

<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/types/config.py#L264" className="SourceCodeLinkBadge">source code</a>
<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/types/config.py#L266" className="SourceCodeLinkBadge">source code</a>

### <kbd>method</kbd> `load`

Expand Down Expand Up @@ -1281,7 +1281,7 @@ Returns: The loaded config object.

---

<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/types/config.py#L346" className="SourceCodeLinkBadge">source code</a>
<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/types/config.py#L348" className="SourceCodeLinkBadge">source code</a>

## <kbd>class</kbd> `PartialConfig`
Like `Config`, but all fields are optional.
Expand Down Expand Up @@ -1324,7 +1324,7 @@ Returns the set of fields that have been set on this model instance.

---

<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/types/config.py#L359" className="SourceCodeLinkBadge">source code</a>
<a href="https://github.com/tum-esm/pyra/tree/main/packages/core/types/config.py#L361" className="SourceCodeLinkBadge">source code</a>

### <kbd>method</kbd> `load`

Expand Down

0 comments on commit 6919604

Please sign in to comment.