@bradtech/sensor-air 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/HOWTO.md ADDED
@@ -0,0 +1,76 @@
1
+ # HOWTO: Using `@bradtech/sensor-air`
2
+
3
+ This guide explains how to convert air temperature and relative humidity into agronomic indices (Foliar VPD, ET0, Ground Frost Risk).
4
+
5
+ ---
6
+
7
+ ## 1. Computing Canopy Temperature, Dew Point & Foliar VPD
8
+
9
+ ```typescript
10
+ import { CanopyMicroclimateConverter } from '@bradtech/sensor-air'
11
+
12
+ const converter = new CanopyMicroclimateConverter()
13
+
14
+ // Convert SHT40 raw air readings
15
+ const outputs = converter.convert({
16
+ temperatureCelsius: 24.5,
17
+ relativeHumidityPercent: 62.0,
18
+ solarRadiationWattsPerMeter2: 650, // optional solar adjustment
19
+ })
20
+
21
+ for (const out of outputs) {
22
+ console.log(`${out.metric}: ${out.value} ${out.unit} (confidence: ${out.confidence})`)
23
+ }
24
+ // Outputs:
25
+ // okf:agronomy/microclimate/canopy_temperature: 24.5 °C
26
+ // okf:agronomy/microclimate/canopy_humidity: 62.0 %
27
+ // okf:agronomy/microclimate/dew_point: 16.7 °C
28
+ // okf:agronomy/microclimate/wet_bulb_temperature: 19.3 °C
29
+ // okf:agronomy/plant/foliar_vpd: 1.16 kPa
30
+ ```
31
+
32
+ ---
33
+
34
+ ## 2. Calculating Daily Evapotranspiration ($ET_0$)
35
+
36
+ ```typescript
37
+ import { EvapotranspirationConverter } from '@bradtech/sensor-air'
38
+
39
+ const etConverter = new EvapotranspirationConverter()
40
+
41
+ const results = etConverter.convert({
42
+ tempMin: 14.0,
43
+ tempMax: 29.5,
44
+ tempMean: 22.0,
45
+ solarRadiationWPerM2: 720,
46
+ latitudeDegrees: 44.8378, // Bordeaux vineyard latitude
47
+ dayOfYear: 195, // July 14
48
+ windSpeedKmh: 12.0,
49
+ })
50
+
51
+ console.log('Daily ET0:', results[0].value, results[0].unit) // ~4.8 mm/day
52
+ ```
53
+
54
+ ---
55
+
56
+ ## 3. Detecting Ground Frost Risk
57
+
58
+ ```typescript
59
+ import { GroundFrostRiskConverter } from '@bradtech/sensor-air'
60
+
61
+ const frostConverter = new GroundFrostRiskConverter()
62
+
63
+ const alerts = frostConverter.convert({
64
+ temperatureCelsius: 1.2,
65
+ relativeHumidityPercent: 88.0,
66
+ windSpeedKmh: 2.0, // Low wind = high radiative frost risk
67
+ })
68
+
69
+ console.log('Frost Index:', alerts[0].value) // Severity score between 0.0 (None) and 1.0 (Critical)
70
+ ```
71
+
72
+ ---
73
+
74
+ ## 📄 License & Copyright
75
+
76
+ GNU AGPL-v3 — Copyright (C) 2026 Olivier Lépine <olivier@lepine.fr>