Metadata-Version: 2.4
Name: chloros-sdk
Version: 1.3.0
Summary: Official Python SDK for MAPIR Chloros image processing
Home-page: https://www.mapir.camera
Author: MAPIR Inc.
Author-email: "MAPIR Inc." <info@mapir.camera>
License: LicenseRef-Proprietary
Project-URL: Homepage, https://www.mapir.camera
Project-URL: Documentation, https://mapir.gitbook.io/chloros
Project-URL: Support, https://www.mapir.camera/pages/contact
Keywords: chloros,mapir,multispectral,ndvi,image-processing,agriculture,remote-sensing
Platform: Windows
Platform: Linux
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Image Processing
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.25.0
Requires-Dist: numpy>=1.19
Provides-Extra: progress
Requires-Dist: sseclient-py>=1.7.2; extra == "progress"
Provides-Extra: camera
Requires-Dist: bleak>=0.21.0; extra == "camera"
Provides-Extra: dev
Requires-Dist: pytest>=6.0; extra == "dev"
Requires-Dist: pytest-cov>=2.10; extra == "dev"
Requires-Dist: black>=20.8b1; extra == "dev"
Requires-Dist: mypy>=0.800; extra == "dev"
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: platform
Dynamic: requires-python

# Chloros Python SDK

Official Python SDK for MAPIR Chloros image processing software. Provides programmatic access to the Chloros API for automation, integration, and custom workflows.

## 🚀 Quick Start

```python
from chloros_sdk import ChlorosLocal
from pathlib import Path

# Initialize SDK (auto-starts backend)
chloros = ChlorosLocal()

# Create project and import images
chloros.create_project("MyProject", camera="Survey3N_RGN")
chloros.import_images(str(Path.home() / "DroneImages" / "Flight001"))

# Configure settings
chloros.configure(
    vignette_correction=True,
    reflectance_calibration=True,
    indices=["NDVI", "GNDVI", "OSAVI"]
)

# Process images
chloros.process(mode="parallel", wait=True)
```

### One-Line Processing

```python
from chloros_sdk import process_folder
from pathlib import Path

images_dir = Path.home() / "DroneImages" / "Flight001"
results = process_folder(str(images_dir), indices=["NDVI", "GNDVI"])
```

For LATTICE captures (no calibration panel — per-serial factory calibration is read from each image's XMP), use the LATTICE-tuned wrapper:

```python
from chloros_sdk import process_lattice_capture

results = process_lattice_capture("C:/Captures/2026-05-13_Field", indices=["NDVI"])
```

## 📋 Requirements

| Requirement          | Details                                                             |
|---------------------|---------------------------------------------------------------------|
| **Chloros Desktop** | Installed locally, or on another machine whose backend you reach through an SSH tunnel |
| **License**         | **Chloros+ required** ([paid plan](https://cloud.mapir.camera/pricing)) |
| **Operating System**| Windows 10/11 64-bit, Ubuntu 22.04 LTS or newer, or Jetson (JetPack 6) |
| **Python**          | Python 3.7 or higher                                                |
| **Memory**          | 8GB RAM minimum (16GB recommended)                                  |

> **⚠️ License Requirement**: The Chloros SDK requires an active Chloros+ subscription on any paid Chloros+ tier (Copper or higher). The free **Iron** tier has no SDK/CLI access. Upgrade at [https://cloud.mapir.camera/pricing](https://cloud.mapir.camera/pricing)
>
> The floor is enforced by the backend, not just the client: an SDK call from an account without a paid plan fails with `403 PLAN_UPGRADE_REQUIRED`, while a logged-out caller gets `401 AUTH_REQUIRED`. `ChlorosLocal` surfaces the 403 as `ChlorosLicenseError` and the 401 as `ChlorosAuthenticationError`; the `connect_*` session helpers raise `ChlorosConnectError` for both (note it derives from plain `Exception`, so `except ChlorosError` will not catch it). Logging in fixes the 401; it cannot fix the 403, where the account is authenticated but not entitled. Access keeps working offline for the plan's grace period (30 days on monthly plans, to expiry on yearly) and stops when that lapses until the machine reaches the server once.

## 📥 Installation

### With Chloros Desktop (matching version)

Every Chloros Desktop installer ships an SDK wheel that matches its backend version exactly:

- **Windows:** the installer runs `pip install` on the bundled wheel with your system Python, so `import chloros_sdk` works after install (skipped silently when no Python is found).
- **Linux (.deb, x86_64 and Jetson):** the package installs the SDK for the system `python3`, so `import chloros_sdk` works after install. `sudo apt install ./chloros_<version>_amd64.deb` (`…_arm64_jp6.deb` on a Jetson) also installs its requirements (`python3-numpy`, `python3-requests`; recommended, not required, so the package still installs without them). In a virtualenv, install the bundled wheel into it: `pip install /usr/lib/chloros/sdk/chloros_sdk-*.whl`.

### From PyPI

```bash
pip install chloros-sdk
```

PyPI carries the latest stable release. Keep the SDK and Chloros Desktop on the same version: a newer SDK against an older backend can hit endpoints that do not exist yet.

Progress monitoring (the `progress_callback` on `process()`) works with the base install — no extras required. The live-frame calls (`grab()`, `frame_stream()`) return numpy arrays; `numpy` is installed with the SDK. The direct (backend-free) LATTICE classes also need OpenCV in your Python (`pip install opencv-python`), and the DAQ-M helper `DLS` needs `bleak` (`pip install "chloros-sdk[camera]"`).

### Platform-Specific Notes

**Linux:**
- ExifTool is bundled with the .deb
- Data stored in `~/.local/share/chloros` (XDG compliant)
- Config stored in `~/.config/chloros`
- The .deb raises the kernel's socket receive buffers that LATTICE camera streams need (`/etc/sysctl.d/60-chloros-gige.conf`)
- Headless: `sudo systemctl enable --now chloros-backend@$USER.service` keeps a backend running as your user (`open_project().connect_all()` never starts one)

**Windows:**
- ExifTool bundled with Chloros Desktop
- Data stored in `%LOCALAPPDATA%\Chloros`

The login is cached in `~/.chloros/` on both (`%USERPROFILE%\.chloros\` on Windows).

## 🔌 Smart Connect

Drive live hardware straight from Python. The `connect_*` helpers are thin HTTP wrappers over the same local backend endpoints the Chloros GUI and CLI use, so connect/prep behavior is identical across all three surfaces. Each helper returns a session handle that works as a context manager, and each auto-starts the backend if it isn't already running (`list_*()`, `attach_array()` and `analyze_array_network()` never do). A device the session opened is released on leaving the `with` block; an explicit `disconnect()` raises `ChlorosConnectError` when the backend does not confirm the release.

### Single LATTICE camera

```python
import chloros_sdk

with chloros_sdk.connect_camera("213800234") as cam:
    cam.set_settings(exposure_time=10000)
    frames = cam.capture("output/", processing="all")
```

`connect_camera(serial, *, preset=None, settings=None, backend_url=..., timeout=60.0, auto_start_backend=True)` preserves the camera's current sticky GenICam state by default; pass `preset="default"` or `settings={...}` to seed specific values. The returned `CameraSession` exposes `set_settings(**kwargs)`, `read_nodes(names)`, `capture(output_dir, processing=..., levels=..., daq=..., daq_tolerance_ms=...)`, and `disconnect()`.

### Synchronized camera array

```python
# serials[0] is the MASTER; the smart prep flow runs network analysis, keeps
# the full sensor and lowers the frame rate to what this host and network
# carry (pass width/height or binning to trade resolution for fps), and
# enables PTP.
serials = ["214701288", "213800234", "214000533"]

with chloros_sdk.connect_array(serials) as arr:
    result = arr.capture("output/", processing="all", aligned=True)
    print(len(result), "frames saved;", result.skipped)
```

`ArraySession` also provides:

- `grab()` / `frame_stream()` — live numpy frames from every camera, **all from one trigger** (`.group_id`), with no files written; `frame_stream()` yields each trigger once.
- `continuous()` — the backend's own continuous capture: every synced group saved to disk with no HTTP round trip between groups; returns a `ContinuousHandle` with `status()` / `wait()` / `stop()`.
- `capture_fastest()` (raw + `.daq` sidecar for later reprocessing), `capture_repeated()` (bounded Single / Continuous / Interval loop), `record()` / `burst()` (returning a `RecorderHandle` with `stats()` / `stop()`). With no GUI view open, `record()` renders the array's NDVI, or `expr=`; `stop()` raises `ChlorosConnectError` for a recording that wrote no frame.
- `status()` (live fps, `stalled`, PTP and per-member exposure), `set_target_fps()`, `disconnect()` and `force_disconnect()`. Releasing the array leaves each camera free-running and otherwise as the connect found it (trigger wiring, PTP, exposure, white balance, format, ROI); `disconnect(keep_settings=True)` saves the session's settings into each camera's own memory instead (it powers up with them), `clear_settings=True` resets that memory to the factory settings. A project sets its cameras from its own saved settings when it connects them.

Capture calls return a `CaptureResult` — a plain list of saved-frame dicts with `.skipped` (per-camera skips and why), `.failed` (files that could not be written) and `.group_seq` (the synced group it came from; pass it back as `after_seq` for the next one — `capture_repeated()` does this for you). An array capture's result also carries `.alignment` (`requested`, `applied`, and a `warnings` entry for each reason the alignment warp — on by default, as in the Chloros app; `aligned=False` saves native files — could not be applied) and `.oriented`.

```python
# Synced live frames into your own code (ML, custom viewers)
with chloros_sdk.connect_array(serials) as arr:
    for frames in arr.frame_stream(processing="raw", fps=10, count=100):
        print(frames.group_id, {s: f.shape for s, f in frames.items()})
```

Live preview is MJPEG over HTTP, one URL per camera (`/api/camera/stream/<serial>`); RTSP is not supported.

To grab a handle to an array that the GUI, CLI, or a previous script already connected (without reconnecting it):

```python
arr = chloros_sdk.attach_array("array-1779862544497")   # or a list of member serials
```

An attached array is borrowed: leaving a `with` block and calling `disconnect()` both leave it running (the explicit call says so on stderr). Call `arr.force_disconnect()` when you do mean to end it, for example to reconnect it with different settings.

### DAQ spectral sensor

```python
# Smart-detect: opens whichever sensor is visible (ETH > BLE > USB)
with chloros_sdk.connect_daq_sensor() as daq:
    for frame in daq.latest(n=10):
        print(frame["spectrum"][:5])

# Or pin a transport / address:
daq = chloros_sdk.connect_daq_sensor(eth_host="daq-e-def330.local")  # DAQ-E
daq = chloros_sdk.connect_daq_sensor(mac="AA:BB:CC:DD:EE:FF")        # DAQ-M (BLE)
daq = chloros_sdk.connect_daq_sensor(transport="usb", port="COM3")   # DAQ-U

# Don't know the address? Scan for it. This is the only way to get a
# DAQ-M's BLE MAC -- it isn't printed on the device or listed by the OS.
for s in chloros_sdk.discover_daq_sensors(transports=["ble"]):
    print(s["transport"], s["address"], s["model"])   # ble C3:D8:.. DAQ-M
```

The sensor stays open in the backend pool, so SDK scripts and the CLI share one live handle instead of fighting over the serial port. The Chloros desktop app's DAQ panel is not part of the pool: close a sensor there before opening it from a script. `DAQSensorSession` exposes `status()`, `latest(n=...)`, `stream_start()` / `stream_stop()`, `record_start()` / `record_stop()` (calibrated `.daq` logging), and `disconnect()`. A DAQ-E session also reads and changes the unit's own settings: `device_info()`, `set_network()` (DHCP or a static address), `set_auto_stream()`, `reboot()` and `update_firmware()`.

### Backend auto-start

`ChlorosLocal` (with `process_folder()` / `process_lattice_capture()`), every `connect_*` helper and the `discover_*` calls probe the backend URL first; if nothing is listening on a local URL, they locate the installed Chloros backend executable, start it window-less, and wait for it to come up (60 s default — `backend_startup_timeout` on `ChlorosLocal`). On Windows the backend is in the `backend` folder of the Chloros install folder (`C:\Program Files\Chloros\backend\` by default; a custom install folder is read from the installer's own record); on Linux it is `/usr/lib/chloros/chloros-backend`. Pass `backend_exe=` to name it yourself. Set `auto_start_backend=False` to disable this, e.g. when pointing at a remote backend (remote URLs are never spawned). However it was started, the backend keeps running after your script ends — leaving a `with` block and `process_folder()` / `process_lattice_capture()` returning included — so the next script reuses it instead of starting it again. It stops when you sign out (`logout()`, unless the Chloros app is open or a run is in progress), when you call `shutdown_backend()` on the instance that started it, or by itself after 30 minutes with nothing using it: no script, no run, no connected camera or light sensor (a `ChlorosLocal` that still exists counts as using it). Set `CHLOROS_BACKEND_IDLE_MIN` in the environment the backend starts from to change the 30 minutes (`0`: never).

## 🔬 DAQ Spectral Sensors

MAPIR's three spectral sensors (DAQ-U USB, DAQ-M BLE, DAQ-E Ethernet) are driven through backend-pooled sessions: `chloros_sdk.connect_daq_sensor()` (shown above). It is pure HTTP, so your Python needs no transport libraries, but it does need a Chloros backend. That is the local Chloros Desktop install's backend (started for you if it isn't running), or one on another machine reached through an SSH tunnel (see Remote-Backend Mode in the SDK reference). A remote backend opens the sensor on its own machine. Either way, the backend must be logged in on a paid Chloros+ tier (Copper or higher).

DAQ-E and LATTICE cameras share a PTP time domain anchored by the Chloros host. A DAQ-E session's `status()["rx_ptp_enabled"]` shows whether the unit's PTP is on, and `enable_ptp()` switches it back on; `time_sync_status()` reports the grandmaster's own health. Name the sensor's cap with `connect_daq_sensor(cap_id=...)` (`"none"` for a bare sensor), bind a DAQ to a camera or array with `set_daq_bindings()`, and get reflectance and indices from two streaming sensors, one looking up and one down, with `light_sensor_reflectance()`. See [DAQ Light Sensors](https://mapir.gitbook.io/chloros/daq-light-sensors) in the Chloros manual.

## 🤖 AI Assistants (MCP)

The SDK includes `chloros-mcp`, a [Model Context Protocol](https://modelcontextprotocol.io) server that lets Claude Desktop, Claude Code, Cursor and other MCP clients drive Chloros: process imagery (create a project, import a folder of captures, choose settings, process, report what the run exported), and run LATTICE cameras, arrays and DAQ light sensors (connect, preview, set exposure and colour, capture, record, update firmware). Its tools cover what this SDK does. It installs with the SDK as the `chloros-mcp` command, the same as `python -m chloros_sdk.mcp_server` (the Linux .deb puts it in `/usr/bin`). Add it to your client, for example `claude mcp add chloros -- chloros-mcp` for Claude Code, or `{"mcpServers": {"chloros": {"command": "chloros-mcp"}}}` in Claude Desktop's `claude_desktop_config.json`. It needs Chloros installed on the same computer and a sign-in on any paid Chloros+ tier (Copper or higher); it cannot sign in for you. A device another client connected (the Chloros app, a script) is released only when the assistant is told to force it, and long work (a capture run, a recording) is a job the assistant follows and stops. Client setup, options, the tools and how they behave: [MCP Server (AI Assistants)](https://mapir.gitbook.io/chloros/reference/sdk-reference#mcp-server-ai-assistants) in the SDK reference.

## 📖 Documentation

Complete documentation available at: **https://mapir.gitbook.io/chloros/api-python-sdk** (full API detail: **https://mapir.gitbook.io/chloros/reference/sdk-reference**)

## 🎯 Use Cases

### Research & Academia
```python
# Integrate Chloros into analysis pipelines
from chloros_sdk import ChlorosLocal

chloros = ChlorosLocal()

for survey in field_surveys:
    chloros.create_project(survey.name)
    chloros.import_images(survey.folder)
    chloros.configure(indices=["NDVI"])
    results = chloros.process()
    # Exported index TIFFs land in the project's output folder,
    # ready for rasterio / numpy / pandas analysis
```

### Batch Processing
```python
# Process multiple flights automatically
from chloros_sdk import ChlorosLocal

chloros = ChlorosLocal()

for flight in flight_database:
    chloros.create_project(flight.name)
    chloros.import_images(flight.folder)
    chloros.configure(indices=flight.requested_indices)
    chloros.process()
```

### Custom Workflows
```python
# Advanced progress monitoring
from pathlib import Path
from chloros_sdk import ChlorosLocal

def progress_callback(progress, message):
    print(f"[{progress}%] {message}")

chloros = ChlorosLocal()
chloros.create_project("CustomWorkflow")
chloros.import_images(str(Path.home() / "Data"))
chloros.configure(indices=["NDVI", "GNDVI"])
chloros.process(progress_callback=progress_callback)
```

## 🔑 License Activation

The SDK uses the same license as Chloros Desktop:

1. Open Chloros Desktop GUI
2. Login with your Chloros+ credentials (one-time)
3. SDK automatically uses cached license
4. License persists across reboots (30-day offline support on monthly plans; yearly plans stay valid offline until subscription expiration)

## 🛠️ API Reference

### ChlorosLocal Class

Main SDK class for local Chloros processing.

```python
chloros = ChlorosLocal(
    backend_url="http://127.0.0.1:5000",  # Backend URL (canonical name;
                                          #   api_url is the legacy alias —
                                          #   backend_url wins if both given)
    auto_start_backend=True,              # Auto-start backend if not running
    backend_exe=None,                     # Auto-detect backend path
    timeout=30,                           # Per-request timeout (seconds)
    backend_startup_timeout=60,           # Wait for auto-started backend (seconds)
    processing_timeout=14400,             # Hard cap for a process() run (4 h)
    processing_stuck_timeout=1800,        # Abort if progress stalls (30 min;
                                          #   resets on any progress change)
)
```

### Methods

#### `create_project(project_name, camera=None)`
Create a new Chloros project.

#### `import_images(folder_path, recursive=False)`
Import images from a folder.

#### `configure(debayer=..., vignette_correction=..., reflectance_calibration=..., indices=..., export_format=..., ppk=..., daq_log_path=..., input_level=..., radiometric_output=..., array_alignment=..., array_alignment_crop=..., array_alignment_interpolation=..., custom_settings=None)`
Configure processing settings (keyword arguments only; an unknown one raises `TypeError`). Each name in `indices` is added to the project for its camera's bands; one it cannot add raises a `UserWarning` naming it.

#### `process(mode="parallel", wait=True, progress_callback=None, poll_interval=2.0)`
Start processing images. `progress_callback(progress, message)` is polled every `poll_interval` seconds. On newer backends the returned dict includes a `summary` of what the run produced, with actionable hints surfaced as Python warnings.

#### `get_config()`
Get current project configuration.

#### `get_status()`
Get backend status.

#### `export_light_sensor(daq=True, csv=True)`
Write the calibrated `.daq` + `.csv` for every light-sensor recording in the project.

#### `logout()` / `shutdown_backend()`
Log out (also releases this machine's device slot; the backend then stops, unless the Chloros app is open or a run is in progress) / stop a backend this instance started.

### Module-Level Functions

- **`process_folder(folder_path, ...)`** — create project + import + configure + process in one call.
- **`process_lattice_capture(folder_path, ...)`** — LATTICE-tuned `process_folder` wrapper (per-serial XMP calibration, standard debayer, mixed Survey3/LATTICE folders supported).
- **`read_image_audit_tags(image_path)`** — read the `Chloros:*` audit metadata (calibration source, vignette source, processing level, ...) from a processed image. Standard library only: no ExifTool, no desktop install.
- **`analyze_array_network(master_serial, slave_serials=None, width=2048, height=1536, pixel_format=None, binning=1, packed="auto", ...)`** — network capability check for a proposed LATTICE array. `pixel_format=None` projects what connect applies (Mono12 for mono cameras, BayerRG12 for colour), with the packed 12-bit decision connect would make on this host, so the fps quoted is the rate the array will run at. The returned `status` is `ok`, `auto_capped_fps` (the requested frame fits at a capped trigger rate: pass `recommended["recommended_target_fps"]` as `connect_array(target_fps=...)`), `auto_shrunk` (the requested frame cannot be delivered at any frame rate; apply the smaller one in `recommended` yourself, since connect never shrinks frames), `needs_force_slip`, or `error` (bad input, or a refused request: read `error_code`). Read it together with `host_load` / `wire_ceiling_load_qualified` / `load_warnings`: the wire ceiling behind the verdict is a headless measurement, so a `status: ok` on a busy host means "fits on an idle host", not "fits here right now".
- **`connect_camera` / `connect_array` / `attach_array` / `connect_daq_sensor`** — smart-connect sessions (see above), plus `list_cameras()`, `list_arrays()`, `list_daq_sensors()`, `discover_daq_sensors()`, and `discover_lattice_cameras()`.
- **Camera utilities** — the `chloros-cli lattice` commands as calls by camera serial: `set_camera_color_profile()`, `set_camera_color_adjust()`, `set_camera_highlights()`, `camera_white_balance_once()`, `set_camera_white_balance()`, `apply_camera_preset()`, `camera_filter_models()`, `camera_firmware_status()` / `update_camera_firmware()`, `camera_power_probe()` / `sleep_camera()` / `wake_camera()`, `calibrate_camera_with_target()`, `network_adapters()` / `fix_network_settings()`, `apply_vignette_correction()`, `read_dls()`, `probe_system()` and `system_info()` (with their readers). See [Camera Utilities](https://mapir.gitbook.io/chloros/reference/sdk-reference#camera-utilities).
- **Transient cameras, alignment profiles and indices** — the `chloros-cli lattice` commands that open cameras for one command: `start_camera_continuous()`, `start_multi_camera_stream()`, `capture_cameras_transient()`, `test_array_sync()`, `detect_array_master()`, `analyze_array_models()`, `calibrate_alignment_profile()`, `capture_aligned_multiband()`, `start_aligned_stream()`, `alignment_profile_info()`, `reorder_alignment_profile()`, `index_catalog()`, `compute_index()` and `capture_live_index()`. The streams return a `CliJob` (`stats()`, `stop()`, `wait()`). See [Transient Arrays, Alignment Profiles & Indices](https://mapir.gitbook.io/chloros/reference/sdk-reference#transient-arrays-alignment-profiles--indices).
- **Time sync, project folder, recipes** — `time_sync_status()`, `time_sync_peers()`, `time_sync_cameras()`, `restart_time_sync()`, `set_time_sync_priority()`; `project_folder()`, `set_project_folder()`, `reset_project_folder()`; and `run_project_recipe()`, which runs a `chloros-cli project run` recipe with the CLI's own runner.
- **`open_project(path, relink=None)`** — open a saved Chloros project; the returned `ChlorosProject` exposes `.cameras` / `.arrays` / `.sensors` from the saved manifests, with `connect_all()`, `capture_all()`, and `disconnect_all()`. Its cameras and arrays connect through a running Chloros backend (without one, through `lattice_sdk`, which needs the Arena SDK runtime and OpenCV), and its light sensors through a running backend only. When nothing can look for a saved device, it is listed under `errors` in the report, with the reason. A project whose folder moved has its file paths re-pointed at the folder it is in now when the backend loads it; `relink` names the folder its other missing files (a hub session, an Add Folder import) are in now. `ChlorosLocal.open_project(path, relink=None)` opens a saved project for processing the same way, and raises `ChlorosProjectFilesMissingError` (with `.missing_roots`) when none of its source files can be found.

### Availability Flags

Optional surfaces degrade gracefully — check these module constants instead of catching ImportError:

- **`chloros_sdk.CAMERA_AVAILABLE`** — in-process `lattice_sdk` camera control (requires the Arena SDK runtime and OpenCV `cv2` in your Python).
- **`chloros_sdk.PROJECT_AVAILABLE`** — the saved-project module imported (`open_project` / `ChlorosProject`); `open_project()` still raises `ImportError` if the project loaders are missing.

## 🔐 Security

- **Proprietary Software**: Licensed under MAPIR proprietary license
- **Local Processing**: All processing happens locally (localhost API)
- **License Enforcement**: Requires active Chloros+ subscription
- **No Data Transmission**: Images never leave your computer

## 💡 Examples

See complete examples in the [SDK reference](https://mapir.gitbook.io/chloros/reference/sdk-reference).

## 🐛 Support

- **Email**: info@mapir.camera
- **Website**: [https://www.mapir.camera](https://www.mapir.camera)
- **Documentation**: [https://mapir.gitbook.io/chloros](https://mapir.gitbook.io/chloros)
- **Pricing**: [https://cloud.mapir.camera/pricing](https://cloud.mapir.camera/pricing)

## 📄 License

Copyright (c) 2026 MAPIR Inc. All rights reserved.

This is proprietary software requiring an active Chloros+ subscription.
Unauthorized use, distribution, or modification is prohibited.

## 🔄 Version History

### v1.3.0 (2026)
- `chloros-mcp`: an MCP server that lets AI assistants (Claude Desktop, Claude Code, Cursor and other MCP clients) drive Chloros processing and LATTICE cameras, arrays and DAQ light sensors, covering what the SDK does; installed with the SDK, and in `/usr/bin` on the Linux .deb
- Camera utilities: colour profile, saturation / contrast, highlights, white balance, presets, filter models, firmware status and update, power, target calibration, network adapters, vignette correction on files, a DLS reading and the host probe, as SDK calls (the `chloros-cli lattice` commands)
- The rest of the CLI as SDK calls, so the CLI, the SDK and `chloros-mcp` offer the same features: transient cameras and arrays, alignment-profile files, indices, the PTP grandmaster, the project folder, recipes (`run_project_recipe()`), DAQ cap selection (`cap_id=`, `set_cap()`), DAQ bindings, Ambient + Object reflectance, `CameraSession.status()` / `capture_repeated()`, and `ArraySession.capability()` / `set_member_settings()`
- Improved LATTICE index products (NDVI and other indices) from `process()`, in every processing mode
- Texture Aware is refused for LATTICE captures: `configure()` / `process()` raise `ChlorosConfigurationError` (LATTICE always gets the standard demosaic), and a saved Texture Aware value is set to Standard with a warning
- `ChlorosLocal()`, `process_folder()` and `process_lattice_capture()` find the installed backend on Windows, and use one that is already running without looking for it
- Auto-start reports a backend that exits before it answers at once, with its exit code and last output, instead of waiting out the 60 s timeout; on Linux it never runs a `backend_server.py` from the current folder
- `read_image_audit_tags()` works from a pip install (it reads the image's metadata itself)
- `numpy` is now installed with the SDK (the live-frame calls return numpy arrays)
- `ArraySession.grab()` / `frame_stream()`: live numpy frames from one trigger, each trigger yielded once; `GrabResult` and `FrameFetchError` exported
- `ArraySession.continuous()` → `ContinuousHandle`: the backend's own continuous capture
- `ArraySession.set_target_fps()`, `force_disconnect()`; `capture(after_seq=..., orient=...)`; `connect_array(packed=...)`
- Every capture saves the DAQ reading it used (`.daq` + `.match.json`), a raw-only capture included: `daq=False` turns it off, `daq_tolerance_ms=` sets the match tolerance, and results carry `.daq_files` / `.daq_matches`; `CameraSession.capture()` now returns a `CaptureResult`
- A release the backend does not confirm raises `ChlorosConnectError` (`disconnect()`, `force_disconnect()`, `disconnect_all()`); a borrowed DAQ sensor is never released
- `capture()` with PNG/JPEG and a level they cannot hold raises `ValueError` before any request
- A `processing=` / `levels=` name that is not an export level is refused (HTTP 400 `UNKNOWN_LEVEL`) instead of saving `raw`
- `DAQSensorSession.enable_ptp()`, `force_disconnect()`, and for a DAQ-E `device_info()`, `set_network()`, `set_auto_stream()`, `reboot()`, `update_firmware()`; `record_stop()` returns `warning` and `gaps`, and a DAQ-E that stops delivering is reconnected by the backend
- `grab()` / `frame_stream()` take `band=`, `align=`, `bit_depth=` and `refl_max=`, and raise `FrameFetchError` instead of going silent
- `connect_array()` keeps the full sensor and lowers the frame rate instead of shrinking frames; `analyze_array_network()` projects the pixel formats and packing connect applies, and takes `calibrated_cpu_pct=`
- `with attach_array(...)` no longer disconnects the borrowed array
- Relative `output_dir` paths resolve against your script's working directory
- `status()` reports `stalled`, and `actual_fps` drops to 0 on a stall
- Arrays: auto exposure no longer lowers the frame rate (it fills the period, then raises gain); a manual exposure on a member longer than the period slows the trigger to fit it instead of being refused
- `open_project()` works from an installed SDK (the wheel now ships the project loaders); `connect_all()` connects cameras and arrays through a running backend, and when nothing can look for them lists each under `errors` with the reason; a backend that refuses the SDK (logged out, or a plan below Copper) is reported with its own reason, and each `connect_all()` checks the backend again
- `ArraySession.record()` records with no GUI open (the array's NDVI, or `expr=`); `RecorderHandle.stop()` raises for a recording that wrote no frame
- The Linux .deb installs the SDK for the system `python3` (before, it only placed the wheel on disk)
- LATTICE OCN cameras: more accurate radiance and reflectance in sunlight (a fleet correction after the band unmix); RGN cameras unchanged
- `DLS()` (direct DAQ-M over Bluetooth; needs `bleak`) needs the sensor's own `mac_address`: there is no default MAC, and `DLS()` without one raises `DLSError` (find it with `discover_daq_sensors(transports=["ble"])`)
- The backend keeps running between scripts: leaving a `with ChlorosLocal(...)` block or ending a script no longer stops it (`shutdown_backend()` stops one this instance started)
- `connect_daq_sensor(cap_id=...)` and `DAQSensorSession.set_cap()` name the fitted cap; DAQ-U, DAQ-M and DAQ-E ship with no cap, and a recording says whether its cap was chosen or assumed
- Live `.daq` recordings survive a power cut; keep a leftover `<name>.daq-journal` with its `.daq`
- `import_images(recursive=True)` no longer counts a project's `camera_cal/` files as images and recordings
- Auto exposure: steadier at constant light, settles within seconds of a change, ignores small highlights, and a camera that stops responding in bright sun is held at the level for its light; a manual exposure leaves gain on Auto
- Linux arm64: the Jetson package is `chloros_1.3.0_arm64_jp6.deb`, for JetPack 6, with JetPack's CUDA PyTorch

### v1.2.0 (2026)
- `discover_daq_sensors()` scans USB / BLE / Ethernet for DAQ sensors (the way to find a DAQ-M's BLE MAC)
- `connect_array(wire_ceiling_mbps=...)` sets the host's sustained wire budget

### v1.1.0 – v1.1.5 (2026)
- Smart-connect sessions: `connect_camera` / `connect_array` / `attach_array` / `connect_daq_sensor` with backend-pooled `CameraSession`, `ArraySession`, and `DAQSensorSession` handles
- LATTICE capture processing: `process_lattice_capture`, `read_image_audit_tags`
- Array network analysis: `analyze_array_network`
- `process()` post-run processing summary with actionable hints
- New `enhanced` color profile for RGB captures

### v1.0.4 (2025)
- Added Linux support
- Cross-platform path handling
- XDG-compliant directories on Linux

### v1.0.0 (2025)
- Initial release
- Full API coverage for local processing
- Auto-backend startup
- Progress monitoring support
- Context manager support
