Day and night mission planning and data reliability
UAT 455 Sensor, Camera and Thermal Imaging Technology for UAS
Lesson
By the end of this module you will be able to
- Calculate sunrise, sunset, civil twilight and the time windows for detection from the Module 8 model, then rank the area sections by background and time
- Read weather data, calculate the dew point and the risk of condensation on the lens, and set go and no-go criteria for flying
- Tie the night mission plan to the general conditions of the Civil Aviation Authority of Thailand (CAAT), the permit to operate differently from those conditions, and the night-flight guidelines
- Convert camera counts to temperature with the camera constants, assess an error budget, and calibrate empirically with reference targets
- Check the consistency of metadata, preserve the original files with a hash value, and calculate the probability of a suspicious point after each confirmation step
Why this matters
At 05:05, point H6 under the palm tree on the canal bank passed the screening rules of Module 9. First light was at 05:55. The ground team was waiting on the canal bank, the village head was waiting for news about smoke from a straw pile, and the incident commander wanted the data package before 06:45 in order to decide which two points to send the walking teams to (an assumed case). Everything the Thung Sommuti team had done through the night is worth only as much as the data are reliable enough for other people to act on, and only as much as the plan got the timing and the backgrounds right. This module closes the course with two jobs. The first is planning when, where and with which camera to fly, by day and by night, using the temperature model of Module 8 together with real weather data. The second is proving how far the data we pass on can be trusted, from the temperature numbers, files and metadata through to the confirmation chain that uses RGB and the ground team.
All the numbers below use the same assumed case, at latitude 14.0° N, longitude 100.5° E, local time UTC+7, together with the model, the assumed values and the weather data of Module 8.
The Sun, the night and the time windows for detection
The general conditions for flying drones in Thailand are tied to the Sun. The CAAT-GM-UAS-003 guidelines (Civil Aviation Authority of Thailand, 2022) cite the Ministry of Transport notification of 2015 (B.E. 2558) (Ministry of Transport, 2015) as requiring flight between sunrise and sunset, and define “daytime” as the time from sunrise to sunset. The team therefore has to calculate the actual times for the day, instead of using a rough 06:00 to 18:00. Reading RGB images can begin once there is enough light, for which civil twilight (the Sun no more than 6° below the horizon) serves as a rough indicator.
The NOAA equations (NOAA Global Monitoring Laboratory, n.d.) give the hour angle of the Sun at the horizon, , with for sunrise and sunset (which accounts for atmospheric refraction and the size of the Sun’s disc) and for civil twilight. Here is the latitude and is the solar declination, and the time in minutes UTC is , where is the longitude and is the equation of time. Both are calculated from the day of the year with the series that NOAA provides. The next example calculates the times for 14 and 15 November and then finds the time windows in which the difference of a person exceeds 2 K and that of a hot spot on the ground exceeds 6 K, using the Module 8 model (the hourly table for a clear sky). The 6 K threshold for hot spots is 3 times the 2 K variation in ground temperature that Burke et al. (2019) used in their peat-fire model.
Example 1 Times of day and time windows
There are two levels of hot spot: a “warm peat spot” at 45 °C (below the 50 to 400 °C range of ground surface above a fire that Burke et al. (2019) cite from the literature, used here as an edge case) and a “hot peat spot” at 77 °C, which is the surface temperature measured in their experiment (both values are assumptions of this course). The difference of a hot spot is measured against dry stubble, which is the hottest background. The table uses the true difference in surface temperature, while the apparent difference the image reader sees is smaller by the factor ετ (about 0.95 × 0.946 = 0.90 at 80 m per Module 8). For example, a true difference of 2 K appears as about 1.8 K, which is marginal in Module 9, so the time windows below are slightly wider than the windows an image reader can actually use.
import math
import datetime
import numpy as np
LAT, LON, TZ = 14.0, 100.5, 7.0 # assumed location in the central plains, time zone UTC+7
def sun_times(day, zenith): # NOAA solar position equations (sunrise and sunset form)
n = day.timetuple().tm_yday
g = 2 * math.pi / 365 * (n - 1) # fractional year at noon (radians)
eq = 229.18 * (0.000075 + 0.001868 * math.cos(g) - 0.032077 * math.sin(g) - 0.014615 * math.cos(2 * g) - 0.040849 * math.sin(2 * g))
dec = (0.006918 - 0.399912 * math.cos(g) + 0.070257 * math.sin(g) - 0.006758 * math.cos(2 * g)
+ 0.000907 * math.sin(2 * g) - 0.002697 * math.cos(3 * g) + 0.00148 * math.sin(3 * g))
lat = math.radians(LAT)
ha = math.degrees(math.acos(math.cos(math.radians(zenith)) / (math.cos(lat) * math.cos(dec)) - math.tan(lat) * math.tan(dec)))
return 720 - 4 * (LON + ha) - eq + TZ * 60, 720 - 4 * (LON - ha) - eq + TZ * 60 # morning, evening (minutes after midnight)
hm = lambda m: f"{int(m // 60):02d}:{int(m % 60):02d}"
for d in (14, 15):
day = datetime.date(2026, 11, d)
(sr, ss), (cr, cs) = sun_times(day, 90.833), sun_times(day, 96.0)
print(f"{day}: first light {hm(cr)}, sunrise {hm(sr)}, sunset {hm(ss)}, end of civil twilight {hm(cs)}")
(sr15, _), (cr15, _) = sun_times(datetime.date(2026, 11, 15), 90.833), sun_times(datetime.date(2026, 11, 15), 96.0)
_, ss14 = sun_times(datetime.date(2026, 11, 14), 90.833)
print(f"legal night (outside sunrise-sunset): {hm(ss14)} to {hm(sr15)} = {(sr15 + 1440 - ss14) / 60:.1f} h")
HOURS = list(range(24)) # temperatures from Module 8 (clear sky, every hour)
PERSON = [27.4, 27.2, 27.1, 26.8, 26.4, 26.1, 26.3, 27.0, 27.6, 28.6, 29.5, 30.4, 30.7, 31.0, 31.4, 31.3, 30.9, 30.5, 30.1, 29.6, 29.0, 28.5, 27.9, 27.6]
BACK = {"dry stubble": [17.1, 16.8, 16.6, 16.1, 15.5, 15.0, 14.9, 20.0, 30.9, 41.0, 49.1, 55.0, 57.7, 57.9, 55.6, 50.9, 43.5, 34.2, 24.2, 21.3, 20.2, 19.2, 18.3, 17.6],
"wet soil": [21.9, 21.1, 20.4, 19.8, 19.3, 18.8, 18.4, 18.8, 21.6, 25.9, 31.0, 35.9, 40.0, 42.6, 43.7, 43.4, 41.5, 38.4, 34.2, 30.6, 27.9, 25.9, 24.3, 22.9],
"paddy water": [27.8, 27.3, 26.7, 26.2, 25.7, 25.3, 24.8, 24.5, 24.8, 25.5, 26.6, 28.0, 29.4, 30.7, 31.8, 32.6, 32.9, 32.7, 32.1, 31.3, 30.5, 29.8, 29.2, 28.5]}
SPOTS = {"warm peat spot 45 C": 45.0, "hot peat spot 77 C": 77.0} # surface above an underground fire (assumed)
def runs(ok): # runs of consecutive hours (wrapping around the day), e.g. 18-07 means 18:00 to 07:00
if all(ok): return "all day"
out = []
for i in range(24):
if ok[i] and not ok[i - 1]:
j = i
while ok[(j + 1) % 24]: j += 1
out.append(f"{i:02d}-{(j + 1) % 24:02d}")
return ", ".join(out) if out else "none"
print("hour " + " ".join(f"{h:3d}" for h in HOURS[::2]) + " (every 2 h shown)")
for n, b in BACK.items():
print(f"person - {n:13s} " + " ".join(f"{PERSON[h] - b[h]:+3.0f}" for h in HOURS[::2]))
for n, t in SPOTS.items():
print(f"{n:22s} " + " ".join(f"{t - BACK['dry stubble'][h]:+3.0f}" for h in HOURS[::2]))
for n, b in BACK.items():
print(f"person >= 2 K above {n:12s}: {runs([PERSON[h] - b[h] >= 2.0 for h in HOURS])}")
for n, t in SPOTS.items():
print(f"{n} >= 6 K above dry stubble: {runs([t - BACK['dry stubble'][h] >= 6.0 for h in HOURS])}")
2026-11-14: first light 05:55, sunrise 06:17, sunset 17:47, end of civil twilight 18:10
2026-11-15: first light 05:55, sunrise 06:18, sunset 17:47, end of civil twilight 18:09
legal night (outside sunrise-sunset): 17:47 to 06:18 = 12.5 h
hour 0 2 4 6 8 10 12 14 16 18 20 22 (every 2 h shown)
person - dry stubble +10 +10 +11 +11 -3 -20 -27 -24 -13 +6 +9 +10
person - wet soil +6 +7 +7 +8 +6 -2 -9 -12 -11 -4 +1 +4
person - paddy water -0 +0 +1 +2 +3 +3 +1 -0 -2 -2 -2 -1
warm peat spot 45 C +28 +28 +30 +30 +14 -4 -13 -11 +2 +21 +25 +27
hot peat spot 77 C +60 +60 +62 +62 +46 +28 +19 +21 +34 +53 +57 +59
person >= 2 K above dry stubble : 18-08
person >= 2 K above wet soil : 21-10
person >= 2 K above paddy water : 07-12
warm peat spot 45 C >= 6 K above dry stubble: 17-09
hot peat spot 77 C >= 6 K above dry stubble: all day
On 15 November, first light is at 05:55, sunrise at 06:18, sunset at 17:47 and civil twilight ends at 18:09. Night as defined by CAAT is 12.5 hours long (17:47 to 06:18). The table of time windows gives four conclusions for planning. First, the dry-stubble sections can be searched for people with heat from 18:00 to 08:00, which covers the whole night and about the first hour and a half after sunrise (06:18 to about 07:30 per Module 8). Second, the damp-soil sections work from 21:00 to 10:00, starting three hours later and ending two hours later because damp soil heats up and cools down more slowly. Third, water sections work well for finding people by heat only from 07:00 to 12:00, when people are warmer than the water that is still cool from the night. The model gives no time during the night when a person stands out from the water by 2 K, so the water surface should be searched with RGB when there is light, or with boats and the ground team. Fourth, the hot spots of a peat fire are visible almost all day. The 77 °C spot exceeds the ground by more than 6 K for all 24 hours (lowest +19 K at noon), but the warm 45 °C spot is visible only from 17:00 to 09:00. The model therefore recommends checking for smouldering fire in the early morning before the ground warms up, when the difference is greatest (+30 K for the 45 °C spot at 04:00). This table uses a one-hour resolution, so it differs slightly from the times that Module 8 gave at half-hour resolution. For example, stubble ends at 07:30 in Module 8 but at 08:00 in the hourly table.
The effect of the overcast sky from Module 8 changes this table. If the night is overcast, the stubble is warmer and the difference between a person and the stubble falls to 4.3 K at 02:00, but the water surface is cooler than a person all day, by 2.2 to 5.8 K. The order should therefore change: search the waterside with thermal imaging on overcast nights, and search the stubble sections on clear nights. The cloud forecast is thus an input to the plan, not only a safety matter.
Day plan. During the daytime (06:18 to 17:47), this model shows that thermal imaging for finding people on stubble does not work from about 08:00 to 18:00, and on damp soil from about 10:00 to 21:00, because the ground is hotter than a person or so close to a person’s temperature that the difference is under 2 K (in the middle of the day the difference goes as deep as −27 K at noon for stubble and −12 K in the afternoon for damp soil). The best data then come from an RGB camera with a much finer GSD (UAT 460). Daytime thermal images remain useful for high-temperature sources such as 77 °C peat-fire spots, motors, roofs and the canopy that people shelter under, where differences of the order of ten kelvin can still be seen in daytime, and for water areas in the morning (07:00 to 12:00). Witczuk et al. (2018), who trialled surveying hoofed animals in forest with thermal drones, report that the best thermal images were obtained around sunrise, in the evening and at night. They give the limits of the method as the regulations that restrict flight to visual line of sight and the heavy dependence on weather, which is consistent with the table above.
Weather data for planning
The Thai Meteorological Department (n.d.) provides five types of data that the team can use, following the menus of its website: daily and weekly forecasts, weather warnings, weather radar, automatic weather station (AWS) data, and agrometeorological data. For a night search, at least seven variables must be read: air temperature, relative humidity (to find the dew point), wind and gusts, rain and storm warnings, cloud (which changes which background is the problem, as we have just seen), visibility, and the times of twilight.
The dew point is the temperature at which air is saturated with its own water vapour. It is calculated from the actual vapour pressure , with the saturation vapour pressure taken from the FAO-56 equation (Allen et al., 1998) used in Module 8. When the temperature of an object falls below the dew point, water condenses on its surface. Burke et al. (2019) warn that condensation on the lens degrades data quality severely, because thermal infrared radiation cannot pass through condensed water, and that flying in cool, humid air can make the camera body colder than the air. The team therefore watches the spread between air temperature and dew point: below 2 K, stay alert, and below 1 K, treat the risk as high. The 1 and 2 K thresholds are a team convention (a camera body and lens that are already colder than the air need a larger spread), not standard values. What to do: keep the camera in a place where the temperature is close to the outside air before flying, wipe the lens, and do not let the camera cool unnecessarily.
Example 2 Dew point and spread by hour for tonight
The air follows the table of Module 8 (22 °C at 05:30 to 25.5 °C at 22:00), with the dew point held constant at 21.5 °C (assumed). Find the relative humidity and the spread between air and dew point at the key times.
def esat(t): return 0.6108 * math.exp(17.27 * t / (t + 237.3)) # kPa, Eq. 11 of FAO-56
def dew_point(t, rh):
ea = rh / 100 * esat(t); lo, hi = -20.0, t
for _ in range(60):
mid = (lo + hi) / 2
lo, hi = (mid, hi) if esat(mid) < ea else (lo, mid)
return (lo + hi) / 2
t, rh = 22.0, 97.0
print(f"{t} C, RH {rh:.0f} %: dew point {dew_point(t, rh):.1f} C, spread {t - dew_point(t, rh):.1f} K")
HRS = np.array([0, 2, 4, 5.5, 8, 11, 14.5, 18, 22, 24.0]); AIR = np.array([24.5, 24.0, 22.8, 22.0, 25.0, 30.0, 32.0, 29.5, 25.5, 24.5])
TD = 21.5 # dew point of the air mass (C, assumed constant)
print("hour air RH dew-point spread lens/housing condensation risk")
for h in (20, 22, 0, 2, 4, 5, 6, 7):
t = float(np.interp(h, HRS, AIR)); rh = min(100.0, 100 * esat(TD) / esat(t)); spread = t - min(TD, t)
risk = "HIGH (spread < 1 K)" if spread < 1 else ("watch (spread < 2 K)" if spread < 2 else "low")
print(f"{h:4d} {t:4.1f} {rh:3.0f} % {spread:4.1f} K {risk}")
22.0 C, RH 97 %: dew point 21.5 C, spread 0.5 K
hour air RH dew-point spread lens/housing condensation risk
20 27.5 70 % 6.0 K low
22 25.5 79 % 4.0 K low
0 24.5 83 % 3.0 K low
2 24.0 86 % 2.5 K low
4 22.8 92 % 1.3 K watch (spread < 2 K)
5 22.3 95 % 0.8 K HIGH (spread < 1 K)
6 22.6 94 % 1.1 K watch (spread < 2 K)
7 23.8 87 % 2.3 K low
The first line checks the function: air at 22.0 °C and 97% humidity has a dew point of 21.5 °C, a spread of only 0.5 K. At 22:00 the spread is still 4.0 K (79% humidity) and it falls to 2.5 K at 02:00 (86%). At 04:00, however, it is down to 1.3 K, and at 05:00 to 0.8 K (95%), which is high risk. At 06:00 it is still only 1.1 K, before it returns to 2.3 K at 07:00 as the Sun warms the air. The period from 04:00 to 07:00 is therefore the time when the lens and camera body are most likely to fog or collect droplets, and it is the same period in which the team plans to inspect the canal bank and smouldering fires. The team must therefore prepare the camera in advance (keep it in a box as warm as the air, carry a lens cloth and check the lens before every sortie), and treat a “sudden blurring of the image” as a signal to land and inspect, not to keep adjusting the image settings.
Regulations and the night mission plan
The general conditions for flying drones of up to 25 kg under the Ministry of Transport notification of 2015 (B.E. 2558) include flying within visual line of sight, between sunrise and sunset, and no higher than 90 m (CAAT-GM-UAS-002 and CAAT-GM-UAS-003). A night flight is therefore an operation that departs from those conditions. The CAAT notification of 2026 (B.E. 2569) (Civil Aviation Authority of Thailand, 2026), which takes effect thirty days after its announcement, classes it as an operation of medium risk (Specific category) that needs permission from the Director of the Authority before the operation. The team in the case study has obtained permission in advance (assumed). The CAAT-GM-UAS-003 guidelines (revision 00, dated 18 October 2022, in force from 1 January 2023) set out the night-flight requirements that are used as the framework for the plan. They were issued before the 2026 notification, so the team must check the latest documents and the application channel every time before applying. The next table summarises the requirements that bear on our plan.
| Category | Requirement in the guidelines | Effect on the plan |
|---|---|---|
| Equipment | Flight recording system and Geo-Awareness; position lights (red at the front and green at the rear, or red on the left wing and green on the right wing); an anti-collision light is recommended; a ground station showing the current position; an obstacle-avoidance system is recommended; reflective clothing, life jackets and safety shoes for personnel | Check the lights and the flight recording before every sortie |
| Personnel | The pilot knows the regulations and the system; a Visual Observer (VO) who has been trained and assessed; training records are kept | The plan needs a pilot, a Visual Observer, a camera operator, an image reader and a ground team leader |
| Visibility | The pilot or VO must be able to see the aircraft in the permitted airspace at all times, and they must be able to communicate at all times; a VO watches one aircraft and should not have other duties at the same time | Thermal images do not replace seeing the aircraft with the eyes, so the camera operator is a different person from the VO |
| Area and height | Survey the area first; avoid roads, railways, dams and power plants; stay within visual line of sight, no higher than 90 m (300 ft) | Use the 80 m calculated in the earlier modules, which is below the ceiling |
| Take-off and landing site | Enough light for take-off, landing and emergency landing; keep other people from reaching it | Set up lighting at the base and cordon off the area |
| Weather | Receive information on visibility, cloud, wind and rain; do not fly into cloud; wind within the manufacturer’s limit; do not fly when there is a storm warning | Use the dew-point table and the wind criterion (the manufacturer states a wind resistance of 12 m/s during take-off and landing) |
| Emergency | Procedures for loss of control, loss of the control link, or loss of the navigation lights | Rehearse before the mission and designate an emergency landing point |
Tonight’s mission schedule, tied to the time windows in Example 1, is therefore as follows (assumed times for the case study).
| Time | Task | Reason |
|---|---|---|
| 22:10 to 22:40 | Set up the base after the 22:10 alert, check the equipment and lights, brief the VO and the ground team, measure the reflected temperature with foil, set the parameters | Modules 6 and 7 |
| 22:40 to 03:30 | Thermal flights over the stubble and damp-soil sections, high gain, locked range 15–45 °C | Stubble works from 18:00 to 08:00, damp soil from 21:00 to 10:00 |
| 03:30 to 04:15 | Change batteries, compare results with the ground team, warm and wipe the lens | The dew-point spread falls to 1.3 K at 04:00 |
| 04:15 to 05:30 | Thermal flights along the damp-soil bank and under the trees by the canal; do not use thermal imaging to search the water surface | The water surface gives a difference below 2 K all night |
| 05:45 to 06:15 | Check for smouldering fire by thermal imaging before the ground heats up | Hot spots are visible until 09:00 |
| 05:55 to 06:30 | Check suspicious points with RGB once there is civil twilight | First light at 05:55 |
| From 06:18 | Enter the daytime conditions, use RGB mainly, and hand over the data | Sunrise |
From counts to a number you can trust: calibration and the error budget
A radiometric camera records raw counts, which relate to the radiation falling on the sensor, and converts them to temperature using constants that the manufacturer calibrated against a blackbody at the factory. The documentation of the Thermimage package (Tattersall, n.d.) explains that the raw values are what the sensor detects, related to the radiation that falls on the sensor, and gives the conversion formula for FLIR cameras , where the constants are stored in the camera’s file. The raw2temp function of the same package takes the measurement equation of Module 6 and solves it for the object temperature from the counts, ε, range, humidity, air temperature and reflected temperature. The next example uses the example constants of the FLIR SC660 camera from the manual of the package, which are not the values of a drone-mounted camera and are used only to show the procedure. In real work, use the software or SDK of the manufacturer of the camera in use, and check the documentation of that model.
Empirical calibration with reference targets is another route. Kelly et al. (2019) tested a FLIR Vue Pro 640, which is not a calibrated radiometric camera, and found that an empirical linear calibration with at least three ground reference points is enough to convert counts to temperature in images taken in flight. An accuracy of 0.5 °C in the laboratory degraded to 5 °C under environmental conditions that changed during the flight, because the relationship between the camera signal and the sensor temperature is not linear and is affected by wind and by temperature drift, which the camera’s automatic flat-field correction (NUC) does not fully remove.
Example 3 Raw counts, compensation, calibration and the error budget
Part one converts an array of raw counts to apparent temperature, then compensates with different values of ε. Part two simulates empirical calibration with targets at three temperatures, once spread widely and once close to the scene. Part three estimates the error budget of absolute temperature at 27 °C (each error term is an assumed value, except the camera accuracy, which uses the DJI high-gain specification of ±2 °C or ±2%) and compares it with the error of the difference between two pixels.
R1, R2, B, F, O = 21106.77, 0.012545258, 1501.0, 1.0, -7340.0 # example constants of the FLIR SC660 from the Thermimage manual, not a drone camera
planck = lambda t_c: R1 / (R2 * (np.exp(B / (np.asarray(t_c, dtype=float) + 273.15)) - F)) - O # blackbody temperature -> counts
inverse = lambda raw: B / np.log(R1 / (R2 * (np.asarray(raw, dtype=float) + O)) + F) - 273.15 # counts -> blackbody temperature
raw = np.array([[18109, 18400, 18650], [19000, 19500, 22000]], dtype=float)
print("apparent (blackbody) temperature of a raw array, C:")
print(np.round(inverse(raw), 1))
def compensate(raw, eps, tau, t_refl, t_atm): # the measurement equation solved for the object, in counts
return inverse((raw - (1 - eps) * tau * planck(t_refl) - (1 - tau) * planck(t_atm)) / (eps * tau))
for eps in (1.0, 0.95, 0.60):
print(f"eps {eps:.2f}, tau 0.95, T_refl 8 C, T_air 24 C: bottom row -> {np.round(compensate(raw, eps, 0.95, 8.0, 24.0)[1], 1)} C")
cpk = (planck(28.0) - planck(26.0)) / 2
print(f"sensitivity near 27 C: {cpk:.1f} counts per kelvin")
rng = np.random.default_rng(481)
def counts(t, drift=0.0): return 0.985 * planck(t) + drift + rng.normal(0, 3.0, np.shape(t)) # gain 0.985 and noise of 3 counts (assumed)
for label, refs in (("references 0.5, 27, 45 C (wide)", [0.5, 27.0, 45.0]), ("references 15, 27, 40 C (near the scene)", [15.0, 27.0, 40.0])):
refs = np.array(refs); c = counts(refs)
a, b = np.polyfit(c, refs, 1) # empirical line: temperature = a * counts + b
test = np.arange(15.0, 41.0, 5.0)
err = a * counts(test) + b - test
print(f"{label}: worst error over 15-40 C = {np.abs(err).max():.2f} K")
apparent (blackbody) temperature of a raw array, C:
[[23.6 25.2 26.5]
[28.3 30.9 42.7]]
eps 1.00, tau 0.95, T_refl 8 C, T_air 24 C: bottom row -> [28.6 31.2 43.6] C
eps 0.95, tau 0.95, T_refl 8 C, T_air 24 C: bottom row -> [29.5 32.3 45.2] C
eps 0.60, tau 0.95, T_refl 8 C, T_air 24 C: bottom row -> [40.2 44.1 62.2] C
sensitivity near 27 C: 191.3 counts per kelvin
references 0.5, 27, 45 C (wide): worst error over 15-40 C = 1.77 K
references 15, 27, 40 C (near the scene): worst error over 15-40 C = 0.51 K
The first result shows that the same raw counts give different temperatures depending on the parameters that are set. The bottom-left pixel reads 28.3 °C with no compensation, 28.6 °C with ε = 1.0, 29.5 °C with ε = 0.95 and 40.2 °C with ε = 0.60. An 8-bit image whose colours have been adjusted does not keep the raw counts, so its parameters cannot be corrected afterwards. The calibration shows that a line fitted to targets at 0.5, 27 and 45 °C gives a worst error of 1.77 K when used over 15 to 40 °C, whereas targets at 15, 27 and 40 °C, which lie close to the range of the scene, give only 0.51 K. This is because the relationship between radiance and temperature is curved: three targets spread wider than the working range make the straight line miss in the middle of the range. The sensitivity of the example camera near 27 °C is 191.3 counts per kelvin, so a drift of about two hundred counts equals an error of one kelvin, and the calibration must be repeated when the camera warms up or the weather changes.
EPS, TAU, TREFL, TATM, T_TRUE = 0.95, 0.95, 8.0, 24.0, 27.0
raw_obs = EPS * TAU * planck(T_TRUE) + (1 - EPS) * TAU * planck(TREFL) + (1 - TAU) * planck(TATM) # the counts the sensor would register
base = float(compensate(raw_obs, EPS, TAU, TREFL, TATM))
print(f"correct parameters give {base:.2f} C")
terms = {"camera accuracy (spec, high gain)": 2.0,
"emissivity set 0.03 too high": float(compensate(raw_obs, EPS + 0.03, TAU, TREFL, TATM)) - base,
"transmittance set 0.03 too high": float(compensate(raw_obs, EPS, TAU + 0.03, TREFL, TATM)) - base,
"reflected temperature 5 K too high": float(compensate(raw_obs, EPS, TAU, TREFL + 5.0, TATM)) - base,
"air temperature 2 K too high": float(compensate(raw_obs, EPS, TAU, TREFL, TATM + 2.0)) - base}
for k, v in terms.items():
print(f" {k:36s} {v:+5.2f} K")
print(f"combined (root of the sum of squares) +/- {math.sqrt(sum(v * v for v in terms.values())):.1f} K")
raw_g = EPS * TAU * planck(17.0) + (1 - EPS) * TAU * planck(TREFL) + (1 - TAU) * planck(TATM) # a ground pixel at 17 C
for k, args in (("emissivity 0.03 too high", (EPS + 0.03, TAU, TREFL, TATM)), ("reflected temperature 5 K too high", (EPS, TAU, TREFL + 5.0, TATM))):
tp, tg = float(compensate(raw_obs, *args)), float(compensate(raw_g, *args))
print(f"person and ground pixels both processed with {k}: absolute errors {tp - 27:+.2f} and {tg - 17:+.2f} K, contrast error {(tp - tg) - 10:+.2f} K")
correct parameters give 27.00 C
camera accuracy (spec, high gain) +2.00 K
emissivity set 0.03 too high -0.53 K
transmittance set 0.03 too high -0.07 K
reflected temperature 5 K too high -0.22 K
air temperature 2 K too high -0.11 K
combined (root of the sum of squares) +/- 2.1 K
person and ground pixels both processed with emissivity 0.03 too high: absolute errors -0.53 and -0.26 K, contrast error -0.27 K
person and ground pixels both processed with reflected temperature 5 K too high: absolute errors -0.22 and -0.24 K, contrast error +0.02 K
The error budget for absolute temperature at 27 °C is dominated by the accuracy of the camera itself (±2.0 K by specification), followed by ε set 0.03 too high (−0.53 K), reflected temperature set 5 K too high (−0.22 K), air temperature set 2 K too high (−0.11 K) and τ set 0.03 too high (−0.07 K). Combined by the root of the sum of squares, this gives ±2.1 K. Absolute temperature should therefore be reported with ±2 K, and numbers with decimal places should not be used as the basis of a decision. But differences within the same image are far more trustworthy. When the person and ground pixels are both processed with the same wrong parameters, the absolute errors are −0.53 and −0.26 K, but the error of the 10 K difference is only −0.27 K (and only +0.02 K when the reflected temperature is set wrong by the same amount). This agrees with Burke et al. (2019), who state that the absolute accuracy of a typical camera is about ±5 °C but the relative sensitivity between pixels is about 0.05 °C. The practical conclusion is that search decisions should rely on differences and on the screening rules of Module 9, with the parameter values recorded, and not rely on absolute temperature numbers.
R-JPEG files, metadata and preserving the originals
The DJI specification (DJI, n.d.) lists still-image recording by the thermal camera in both 8-bit JPEG and 16-bit R-JPEG. An R-JPEG is a JPEG file that stores the radiometric values and parameters in its metadata, so ε, reflected temperature and distance can be corrected afterwards. An 8-bit JPEG whose range has been adjusted cannot be corrected afterwards (Module 7). For FLIR cameras, the ExifTool utility (Harvey, n.d.) can read the relevant tags, such as Emissivity, ObjectDistance, ReflectedApparentTemperature, AtmosphericTemperature, RelativeHumidity, PlanckR1, PlanckB, CameraTemperatureRangeMax, CameraTemperatureMaxSaturated, DateTimeOriginal and PaletteName, as well as the raw thermal image (RawThermalImage). For DJI R-JPEG files, use DJI’s software or SDK according to the documentation of the model in use, because the tag names and the way to read them may differ from the FLIR format.
Data reliability starts with how the files are kept. The team should do three things. First, keep every original file read-only and work with copies, never saving over or recompressing the originals. Second, compute a SHA-256 hash of the originals immediately after the flight and record it in the package (NIST, 2015), so that the recipient can check that the files have not been altered. Third, check the consistency of the metadata, for example that times are in sequence, that parameters do not change in the middle of a flight without a record, and that heights do not exceed the permitted ceiling.
Example 4 Checking the metadata of an image set and hashing it
A table of six sample images has an image ID, the time after 03:00:00, the height, ε, reflected temperature, humidity, object distance and mean raw count (assumed values). Check that the times are in order, which parameters change, whether any height exceeds the permit’s 90 m ceiling, and whether any object distance fails to match the height in a straight-down (nadir) image, then hash the table.
import hashlib
# image ID, seconds after 03:00:00, height AGL (m), eps, reflected temperature (C), humidity (%), object distance (m), mean raw count
FRAMES = [("T0001", 0.0, 61.0, 0.95, 8.0, 86, 61.0, 18110), ("T0002", 2.0, 60.5, 0.95, 8.0, 86, 60.5, 18095),
("T0003", 4.0, 60.9, 0.95, 8.0, 86, 60.9, 18120), ("T0004", 3.5, 61.2, 0.95, 8.0, 86, 61.2, 18101),
("T0005", 8.0, 61.0, 1.00, 20.0, 50, 61.0, 18340), ("T0006", 10.0, 92.0, 1.00, 20.0, 50, 92.0, 18020)]
LIMIT_AGL = 90.0 # height ceiling of the permit (m)
flags = []
for prev, cur in zip(FRAMES, FRAMES[1:]):
if cur[1] <= prev[1]: flags.append(f"{cur[0]}: time {cur[1]} s is not after {prev[0]}")
if cur[3:6] != prev[3:6]: flags.append(f"{cur[0]}: object parameters changed (eps {prev[3]}->{cur[3]}, T_refl {prev[4]}->{cur[4]}, RH {prev[5]}->{cur[5]})")
for f in FRAMES:
if f[2] > LIMIT_AGL: flags.append(f"{f[0]}: height {f[2]} m is above the {LIMIT_AGL:.0f} m limit")
if abs(f[2] - f[6]) > 1.0: flags.append(f"{f[0]}: distance {f[6]} m differs from height {f[2]} m for a nadir shot")
for x in flags: print("FLAG", x)
digest = hashlib.sha256(",".join(str(f) for f in FRAMES).encode("utf-8")).hexdigest()
print("sha256 of the frame table:", digest[:16], "...")
print(f"{len(flags)} flags in {len(FRAMES)} frames reviewed")
FLAG T0004: time 3.5 s is not after T0003
FLAG T0005: object parameters changed (eps 0.95->1.0, T_refl 8.0->20.0, RH 86->50)
FLAG T0006: height 92.0 m is above the 90 m limit
sha256 of the frame table: 77c1c2d3001197d6 ...
3 flags in 6 frames reviewed
The check raises three flags. The first, T0004, has a time of 3.5 s that is not in sequence after T0003 (4.0 s), which shows that the camera clock or the file order is abnormal, and that image must not be used in a time sequence until this is fixed. The second, T0005, changed all three parameters at once (ε from 0.95 to 1.00, reflected temperature from 8 to 20 °C, humidity from 86 to 50%) in the middle of the flight. This changes the apparent temperature of every kind of surface without any record, and the operator may have pressed reset to the default values. The third, T0006, was flown at 92 m, above the permit’s ceiling of 90 m, and even 2 m over must be reported with the reason recorded. The hash of the table (starting with 77c1c2d3001197d6) lets the recipient check that the table received is the one the sender checked. If even a single number is changed, the whole hash changes. This check does not correct the data, but it tells the recipient which parts to be careful with, and that is the basis of trustworthiness.
The confirmation chain and the handover report
A thermal image does not say that a suspicious point is a person. It only raises the probability. Each step of confirmation (a thermal image that passes the screening rules, an RGB image when there is light, and the ground team) has a different sensitivity and specificity. Sensitivity is the proportion of real people that the step detects, and specificity is the proportion of non-people that the step correctly rejects. The positive likelihood ratio is and the negative one is . The posterior probability is found from the prior odds multiplied by the LR. Altman and Bland (1994) explain that the positive predictive value of a test depends on prevalence, the proportion of people in the group tested, and not on sensitivity and specificity alone. The same test with high sensitivity and specificity gives a low positive predictive value when what is sought is rare, which is the case for suspicious points, most of which are not people.
Example 5 Probability for point H6 after each confirmation step
In the past the team has found that one in forty suspicious points is a person (assumed value, pre-test prevalence 0.025). In step one, the thermal rules of Module 9 have a sensitivity of 0.90 and a specificity of 0.85. In step two, RGB at twilight has a sensitivity of 0.60 (because a person may be under the palm tree or in shadow) and a specificity of 0.925. In step three, the ground team reaches the spot, with a sensitivity of 0.97 and a specificity of 0.985 (all values assumed). Calculate the probability after each step, and for the case where RGB sees nothing.
def posterior(prior, sens, spec, positive=True): # Bayes' formula from sensitivity and specificity
lr = sens / (1 - spec) if positive else (1 - sens) / spec
odds = prior / (1 - prior) * lr
return odds / (1 + odds)
PRIOR = 1 / 40 # one in forty suspicious points has been a person (assumed)
STEPS = [("thermal screen passed (module 9 rules)", 0.90, 0.85), ("RGB at first light shows a person-like shape", 0.60, 0.925),
("ground team reaches the spot and confirms", 0.97, 0.985)]
p = PRIOR
print(f"prior probability {p:.3f}")
for name, sens, spec in STEPS:
p = posterior(p, sens, spec)
print(f"{name:46s} LR+ {sens / (1 - spec):5.1f} -> probability {p:.3f}")
p2 = posterior(posterior(PRIOR, 0.90, 0.85), 0.60, 0.925, positive=False)
print(f"thermal passed but RGB shows nothing (LR- {(1 - 0.60) / 0.925:.2f}): probability {p2:.3f}, not zero")
ppv = 0.90 * PRIOR / (0.90 * PRIOR + (1 - 0.85) * (1 - PRIOR))
print(f"positive predictive value of the thermal screen alone: {ppv:.2f}; with 10x more people among the flags (prior 0.25): {posterior(0.25, 0.90, 0.85):.2f}")
prior probability 0.025
thermal screen passed (module 9 rules) LR+ 6.0 -> probability 0.133
RGB at first light shows a person-like shape LR+ 8.0 -> probability 0.552
ground team reaches the spot and confirms LR+ 64.7 -> probability 0.988
thermal passed but RGB shows nothing (LR- 0.43): probability 0.062, not zero
positive predictive value of the thermal screen alone: 0.13; with 10x more people among the flags (prior 0.25): 0.67
Before any checking, the probability that a suspicious point is a person is 2.5%. When H6 passes the thermal rules () the probability rises to 13.3%, which matches the positive predictive value of thermal imaging alone (0.13). It is low because of the many false positives from points that are not people. If the prevalence rose to one in four, the same value would be 0.67. When dawn comes and RGB sees a human shape under the palm tree (), the probability rises to 55.2%, which is still not enough to conclude. When the ground team arrives and confirms (), it rises to 98.8% (at 06:20 the team found an elderly person sitting against the palm tree on the canal bank, safe but tired and dehydrated, according to the assumed case). An important observation goes the other way. If RGB sees nothing (), the probability falls to 6.2%, not zero, because RGB cannot see well under a palm tree. The ground team should therefore visit points that pass the thermal rules even when RGB sees nothing, when they have the capacity, and a point that is rejected must have its reason recorded, not deleted (UAT 460).
Handover report. The package sent to the incident commander should contain six things. One, identity and time: the image ID, the UTC+7 time, and a check that the camera clock matches the time of the navigation system. Two, the position with an uncertainty radius, by the method of UAT 460. Three, the measured values and the settings: apparent temperature, gain, ε, reflected temperature, distance, humidity and palette. Four, the confirmation status, meaning which step has been reached and the approximate probability. Five, what is still unknown, for example the true size of a heat source read from a single pixel. And six, a list of the files with their hash values. The recipient must be able to tell what is a measurement, what is an estimate, and what is a question that is still open.
Module lab
Lab: planning a 24-hour mission and checking the reliability of one data set
- Use the NOAA equations (Example 1) to calculate sunrise, sunset and twilight for the date and location of the department’s training area. Then use the Module 8 model, adjusted with field data, to find the time windows (a person warmer than the ground by 2 K) for the backgrounds present in the area. Then write a 24-hour mission schedule in the form of the tables in this module.
- Retrieve the forecast, warnings and weather station data of the Thai Meteorological Department for the training area. Record hourly temperature, humidity, wind, rain and cloud, calculate the dew point and the spread as in Example 2, and then set go and no-go criteria that the team accepts.
- Place three containers of water at different temperatures (ice-cold water, tap water and warm water, measured with a calibrated thermometer) in the image. Photograph them just after the camera is switched on, after a 10-minute warm-up and after 20 minutes. Build an empirical calibration line and compare the error and the drift with Example 3.
- Collect at least 30 R-JPEG images, compute the SHA-256 of every original file, read the metadata with ExifTool or the manufacturer’s software, then run a check like that of Example 4 and record every flag.
- Simulate a handover. One team sends the six-item package of this module, and another team checks the metadata and hashes and calculates the probability after each confirmation step as in Example 5, using the sensitivity and specificity measured in the Module 9 lab.
Safety: night work uses headlamps and reflective vests. Flying requires authorisation to operate and compliance with the conditions of the night-flight guidelines (with a VO, position lights and a height of no more than 90 m). If you do not yet have that authorisation, do the lab with images taken on a tripod or images supplied by the instructor. Never work alone near water, and never point the lens at the Sun or at a strong energy source.
Common mistakes
Watch out
- Using 06:00 to 18:00 instead of the real sunrise and sunset, and not separating the times when thermal imaging works from the times that the law allows
- Searching the water surface with thermal imaging at night: on a clear night water is almost the same as a person (±2 K), so use RGB, a boat or the ground team
- Checking for smouldering fire in the afternoon: a warm spot (45 °C) does not stand out when the ground reaches about 58 °C at noon. Check in the early morning
- Letting the lens fog up and adjusting the image instead of landing to wipe the lens: a dew-point spread below 2 K is a signal to be alert
- Reporting absolute temperature without stating the uncertainty: camera accuracy and parameters combined give about ±2 K. Report differences and record the settings
- Saving over or recompressing the original files, or sending 8-bit images instead of R-JPEG, so that parameters cannot be corrected afterwards and integrity cannot be proved
- Concluding that there is no person when RGB sees no shape: several percent probability remains, especially under the canopy
- Using the camera image from the drone in place of seeing the aircraft with the eyes: the guidelines require the pilot or VO to see the aircraft at all times
Summary
- Legal daytime is calculated from sunrise (06:18) to sunset (17:47) at the assumed location, not 06:00 to 18:00. Stubble works for finding people by heat from 18:00 to 08:00, damp soil from 21:00 to 10:00, water from 07:00 to 12:00, and the hot spots of a 77 °C peat fire are visible all day.
- An overcast sky changes the order: stubble warms up and the difference falls to 4.3 K, but water is cooler than a person, so the cloud forecast must be used to order the area sections. The dew point sets the risk of fog on the lens, and the spread falls below 1 K at 05:00 (0.8 K).
- A night flight is an operation that departs from the general conditions, needs permission, and needs position lights, a VO, a lit take-off and landing site, a height of no more than 90 m and weather data. The image from the drone’s camera is not a substitute for seeing the aircraft.
- Absolute temperature has a combined uncertainty of ±2.1 K (the camera accuracy of 2.0 K is the largest term), but a difference within the same image is off by only 0.27 K when the parameters are wrong in the same way. Calibration with reference targets close to the scene range (0.51 K) is better than with wide targets (1.77 K).
- Keep the original R-JPEG files read-only with a SHA-256 hash, check the metadata, and calculate the probability after each confirmation step (2.5% to 13.3% to 55.2% to 98.8%). A negative RGB result lowers it to 6.2%, not zero. The handover report must separate measurements, estimates and what is still unknown.
Check your understanding
- At latitude 14.0° N, on a day when the Sun’s declination is −18.5°, find the hour angle at the horizon (use ) and the length of the day.
- Air at 22.0 °C and 90% humidity: what are the dew point and the spread? What should be done according to the criteria of this module?
- Three independent error sources of 1.5 K, 0.8 K and 0.3 K combine by RSS to what value?
- The prior prevalence is 0.05 and the test has a sensitivity of 0.80 and a specificity of 0.90. If the result is positive, what is the posterior probability? And if the result is negative?
- Why can a camera operator watching the live thermal image not replace a VO on a night flight?
Answers
- , so . The length of the day is hours (11 hours 29 minutes)
- kPa. The dew point is about 20.3 °C and the spread is 1.7 K, which is below 2 K, so stay alert: check the lens on every sortie and keep the camera as warm as the air
- K
- . The prior odds are , the posterior odds are , and the probability is , or 29.6%. If the result is negative, , the posterior odds are and the probability is 1.2% (not zero)
- The CAAT-GM-UAS-003 guidelines require the pilot or VO to see the aircraft in the permitted airspace at all times, and a VO should not have other duties at the same time. The image from the drone’s camera shows the ground below, not the drone itself or the airspace around it, and it can lag or drop out. A camera operator staring at the screen therefore cannot see other aircraft or obstacles around the drone with their own eyes
Key formulas
| Hour angle and sunrise and sunset times of the Sun (NOAA) | |
| Temperature from counts with the camera constants | |
| Combined error of independent sources (RSS) | |
| Posterior probability from the likelihood ratio |
Key references
- NOAA Global Monitoring Laboratory. General solar position calculations. link
- Allen, R. G., Pereira, L. S., Raes, D., & Smith, M. (1998). Crop evapotranspiration: Guidelines for computing crop water requirements (FAO Irrigation and Drainage Paper 56). Food and Agriculture Organization of the United Nations. link
- กรมอุตุนิยมวิทยา. (n.d.). Thai Meteorological Department: Weather forecast, warnings, weather radar and automatic weather stations. link
- กระทรวงคมนาคม. (2558). ประกาศกระทรวงคมนาคม เรื่อง หลักเกณฑ์การขออนุญาตและเงื่อนไขในการบังคับหรือปล่อยอากาศยานซึ่งไม่มีนักบิน ประเภทอากาศยานที่ควบคุมการบินจากภายนอก พ.ศ. 2558. ราชกิจจานุเบกษา, 132(86 ง), 6–12. link
- สำนักงานการบินพลเรือนแห่งประเทศไทย. (2569). ประกาศ กพท. เรื่อง หลักเกณฑ์และวิธีการในการอนุญาตให้ผู้บังคับหรือปล่อยอากาศยานซึ่งไม่มีนักบิน ประเภทอากาศยานที่ควบคุมการบินจากภายนอก ที่มีน้ำหนักไม่เกิน 25 กิโลกรัม ปฏิบัติแตกต่างไปจากเงื่อนไขที่กำหนด พ.ศ. 2569 (มีผล 17 พฤษภาคม 2569). link
- สำนักงานการบินพลเรือนแห่งประเทศไทย. (2565). เอกสารแนวทาง CAAT-GM-UAS-002 (ปรับปรุงครั้งที่ 00). link
- สำนักงานการบินพลเรือนแห่งประเทศไทย. (2565). แนวปฏิบัติในการขอปฏิบัติการบินอากาศยานซึ่งไม่มีนักบิน กรณีแตกต่างจากเงื่อนไขที่กำหนด สำหรับปฏิบัติการบินในเวลากลางคืน (CAAT-GM-UAS-003, ปรับปรุงครั้งที่ 00). link
- Witczuk, J., Pagacz, S., Zmarz, A., & Cypel, M. (2018). Exploring the feasibility of unmanned aerial vehicles and thermal imaging for ungulate surveys in forests: Preliminary results. International Journal of Remote Sensing, 39(15–16), 5504–5521. link
- Burke, C., Rashman, M., Wich, S., Symons, A., Theron, C., & Longmore, S. (2019). Optimizing observing strategies for monitoring animals using drone-mounted thermal infrared cameras. International Journal of Remote Sensing, 40(2), 439–467. link
- Burke, C., Wich, S., Kusin, K., McAree, O., Harrison, M. E., Ripoll, B., Ermiasi, Y., Mulero-Pázmány, M., & Longmore, S. (2019). Thermal-drones as a safe and reliable method for detecting subterranean peat fires. Drones, 3(1), 23. link
- Kelly, J., Kljun, N., Olsson, P.-O., Mihai, L., Liljeblad, B., Weslien, P., Klemedtsson, L., & Eklundh, L. (2019). Challenges and best practices for deriving temperature data from an uncalibrated UAV thermal infrared camera. Remote Sensing, 11(5), 567. link
- Tattersall, G. J. (n.d.). Thermimage: Thermal image analysis (R package; raw2temp function). The Comprehensive R Archive Network. link
- Harvey, P. (n.d.). FLIR tags. In ExifTool tag names. link
- National Institute of Standards and Technology. (2015). Secure hash standard (SHS) (FIPS 180-4). link
- Altman, D. G., & Bland, J. M. (1994). Diagnostic tests 2: Predictive values. BMJ, 309(6947), 102. link
- DJI. Matrice 4 series specs (O4 Enterprise video transmission). link
Further reading
Study the assigned knowledge units in advance, review media and take the module quiz
Integrating weather into the mission plan
Time, metadata and the location of what is seen
Delivering data to command centres and protecting victims
In class / field
Lab or field practice from worksheets with a safety checklist
Learning evidence: Checked worksheets and quiz results