Fangwu spectrum resolver API container
107
A containerized HTTP API for TI DLP NIR spectroscopy workflows.
This image exposes two core endpoints:
/reference-calibration to parse a reference calibration scan and return the reference intensity array/absorbance-spectrum to compute an absorbance spectrum from one or more sample scan packetslinux/amd64docker pull insentek/fangwu-spectrum-resolver:1.0
Replace 1.0 with the release version you want to run.
docker run --rm -p 3000:3000 \
-e API_KEY=replace-with-your-api-key \
insentek/fangwu-spectrum-resolver:1.0
If API_KEY is not set, the service still starts and business endpoints accept unauthenticated requests. GET /health is always public.
| Variable | Required | Default | Description |
|---|---|---|---|
PORT | No | 3000 | HTTP service port inside the container |
API_KEY | No | unset | Optional API key expected in the x-api-key request header |
curl http://127.0.0.1:3000/health
Response:
{
"ok": true
}
When API_KEY is configured, send:
x-api-key: <your-api-key>
curl -X POST http://127.0.0.1:3000/reference-calibration \
-H 'Content-Type: application/json' \
-H 'x-api-key: your-api-key' \
-d '{
"referenceScanHex": "74706c00750e00005328..."
}'
Response:
{
"ok": true,
"data": {
"referencePga": 64,
"length": 228,
"wavelength": [901.7373613582381, 905.7653917562943],
"referenceIntensity": [5833, 6798]
}
}
curl -X POST http://127.0.0.1:3000/absorbance-spectrum \
-H 'Content-Type: application/json' \
-H 'x-api-key: your-api-key' \
-d '{
"sampleScanHex": [
"74706c00750e00005328...",
"74706c00750e00005328..."
],
"referenceIntensity": [5833, 6798, 6094],
"referencePga": 64
}'
Response:
{
"ok": true,
"data": {
"length": 228,
"wavelength": [901.7373613582381, 905.7653917562943],
"absorbance": [-0.035718, 0.00806],
"spectrum": {
"901.7373613582381": [-0.036101, -0.035335],
"905.7653917562943": [0.007412, 0.008708]
}
}
}
When multiple sampleScanHex packets are submitted, data.absorbance is the mean absorbance at each wavelength. data.spectrum preserves the raw multi-packet absorbance values keyed by wavelength.
Content type
Image
Digest
sha256:ab95dd7ae…
Size
90 MB
Last updated
7 months ago
docker pull insentek/fangwu-spectrum-resolver:1.0