ssscoring.constants
Constants module and definitions.
All measurements are expressed in meters unless noted otherwise.
1# See: https://github.com/pr3d4t0r/SSScoring/blob/master/LICENSE.txt 2 3""" 4Constants module and definitions. 5 6**All measurements are expressed in meters unless noted otherwise.** 7""" 8 9import math 10 11 12# +++ implementation +++ 13 14BREAKOFF_ALTITUDE = 1707.0 15""" 16Breakoff altitude or hard deck. 17""" 18 19DEFAULT_PLOT_INCREMENT = 75.0 20""" 21Used to adjust the plot's max scale to `score` + `DEFAULT_PLOT_INCREMENT` so 22that the whole jump progression is visible in the plot. 23""" 24 25 26DEFAULT_PLOT_MAX_V_SCALE = 550.0 27""" 28Default speed plot scale max is set to 550 km/h, but there is evidence it can 29be higher and adjusted on-the-fly based on jump results. 30""" 31 32 33DEFAULT_SPEED_ACCURACY_SCALE = 5.0 34""" 35Default speed accuracy scale set to 5, to make it visible in plots. This value 36was chosen because the valid threshold is accuracy < 3.0, and this makes most 37values visible without intefering with other curves in the same plot. 38 39See 40=== 41 ssscoring.notebook 42 ssscoring.appcommon 43""" 44 45DEG_IN_RADIANS = math.pi/180.0 46""" 47π/180º 48""" 49 50 51DZ_DIRECTORY = 'drop-zones-loc-elev.csv' 52""" 53The CSV file database dump of the drop zones directory. 54""" 55 56 57EXIT_SPEED = 10.0 58""" 59Guesstimate of the exit speed; ~g 60""" 61 62FLYSIGHT_1_HEADER = set([ 'time', 'lat', 'lon', 'hMSL', 'velN', 'velE', 'velD', 'hAcc', 'vAcc', 'sAcc', 'heading', 'cAcc', 'gpsFix', 'numSV', ]) 63""" 64FlySight v1 CSV file headers. 65""" 66 67FLYSIGHT_2_HEADER = ('GNSS', 'time', 'lat', 'lon', 'hMSL', 'velN', 'velE', 'velD', 'hAcc', 'vAcc', 'sAcc', 'numSV', ) 68""" 69FlySight v1 CSV file headers. Unlike other constants, this is a `tuple` instead 70of a `set` because the code manipulates the headers/columns during file ingress. 71""" 72 73 74INSIGHT_1_HEADER = set([ 'time', 'lat', 'lon', 'hMSL', 'velN', 'velE', 'velD', 'hAcc', 'vAcc', 'sAcc', 'gpsFix', 'numSV', 'heading', 'headAcc', ]) 75""" 76Deep & Steep Insight GPS altimeter CSV file headers. The Insight format is 77FlySight v1-like but differs: `headAcc` replaces `cAcc`, and `gpsFix`/`numSV` 78precede `heading`. The columns required by the SSScoring pipeline are identical 79in name; only `headAcc` is dropped on ingress. 80""" 81 82 83FLYSIGHT_FILE_ENCODING = 'utf-8' 84""" 85File encoding as it comes raw from the FlySight device. 86""" 87 88 89FT_IN_M = 3.2808 90""" 91Number of feet in a meter. 92""" 93 94 95IGNORE_LIST = [ '.ipynb_checkpoints', ] 96""" 97Internal use - list of files to be ignored during bulk file processing in the 98data lake (e.g. `./data`). 99""" 100 101 102KMH_AS_MS = 3.6 103""" 104km/h as m/s 105""" 106 107 108LAST_TIME_TRANCHE = 25.0 109""" 110Times > 25 s are irrelevant because it means that the speed skydiver flew at 111vSpeed < 400 km/h. 112""" 113 114 115MAX_VALID_ELEVATION = 4602.0 116""" 117Max valid elevation allowed in the FlySight or FlySsight 2 time series. Speed 118skydivers are known to jump from as high as `MAX_VALID_ELEVATION` without O2. 119The SSScoring algorithms eliminate all data entries where elevation AGL > `MAX_VALID_ELEVATION` 120before processing the jump for scoring. That's because occasional FlySight 121errors caused by intermittent GPS signal loss and invalid GPS readings when the 122skydiver sits under an airplane's wing during the climb to altitude and other 123factors. 124""" 125 126 127MAX_VALID_ELEVATION_FT = MAX_VALID_ELEVATION*3.28 128""" 129Same as `MAX_VALID_ELEVATION`, in ft. 130""" 131 132 133MAX_ALTITUDE_FT = 14000.0 134""" 135Maximum exit altitude AGL according to FAI Competition Rules Speed Skydiving 136section 5.3. 137""" 138 139MAX_ALTITUDE_METERS = MAX_ALTITUDE_FT/3.28 140""" 141See 142--- 143Maximum exit altitude AGL according to FAI Competition Rules Speed Skydiving 144section 5.3. 145""" 146 147 148MAX_HORIZONTAL_DISTANCE = 600.0 149""" 150Forward displacement at which the ground track is coloured fully 151UNSAFE_HORIZONTAL_COLOR. Displacements above this value are clamped to the 152same solid colour. 153""" 154 155 156SAFE_HORIZONTAL_COLOR = '#009E73' 157""" 158Okabe-Ito bluish green — colorblind-safe indicator used for forward 159displacements within the safe zone (≤ SAFE_HORIZONTAL_DISTANCE). 160Paired with UNSAFE_HORIZONTAL_COLOR. 161""" 162 163 164SAFE_HORIZONTAL_DISTANCE = 480.0 165""" 166Forward displacement below which the track is displayed in SAFE_HORIZONTAL_COLOR. 167Above this and up to MAX_HORIZONTAL_DISTANCE the colour transitions linearly 168to UNSAFE_HORIZONTAL_COLOR. 169""" 170 171 172UNSAFE_HORIZONTAL_COLOR = '#D55E00' 173""" 174Okabe-Ito vermillion — colorblind-safe indicator used for forward 175displacements at or beyond MAX_HORIZONTAL_DISTANCE. 176Paired with SAFE_HORIZONTAL_COLOR. 177""" 178 179 180M_2_FT = 3.28084 181""" 182Meters to feet conversion factor. 183""" 184 185 186MIN_JUMP_FILE_SIZE = 1024*512 187MIN_JUMP_FILE_SIZE = 1024*64 188""" 189FlySight v1 files smaller than `MIN_JUMP_FILE_SIZE` are ignored because they 190lack the minimum number of data points to contain a valid speed skydive. 191""" 192 193 194MPS_2_KMH = 3.6 195""" 196m/s to km/h conversion factor: 197 198```python 199s = mps * 60 * 60 / 1000 200 = mps * 3600 / 1000 201 = mps * 3.6 202``` 203""" 204 205 206PERFORMANCE_WINDOW_LENGTH = 2256.0 207""" 208Performance window length as defined by ISSA/IPC/USPA. 209""" 210 211 212RESOURCES = 'ssscoring.resources' 213""" 214The package resources in the manifest or package wheel resources. 215""" 216 217 218JUMP_RUN_SAMPLES = 15 219""" 220Number of post-exit samples (3 seconds at 5 Hz) used to estimate the jump run 221bearing. The aircraft's forward throw keeps the skydiver on the jump run 222heading for this window regardless of intended turn direction (ISC §5.1.3). 223""" 224 225 226SAMPLE_RATE = 0.2 227""" 228Expected interval, in seconds, for the FlySight sample rate. 229""" 230 231 232SCORING_INTERVAL = 3.0 233""" 234Scoring is based on the maximum speed the jumper attained within the `VALIDATION_WINDOW_LENGTH` 235as the average speed during a sliding window of SCORING_INTERVAL seconds. The 236value is set by governing bodies like ISC and USPA. 237""" 238 239 240SKYTRAX_1_HEADER = set([ 'time', 'lat', 'lon', 'hMSL', 'velN', 'velE', 'velD', 'hAcc', 'vAcc', 'sAcc', 'heading', 'cAcc', 'gpsFix', 'numSV', ]) 241""" 242SkyTraX GPS + barometric SMD v1 CSV file headers. 243""" 244 245 246SPEED_ACCURACY_THRESHOLD = 3.0 247""" 248Speed accuracy for the FlySight device. 249""" 250 251 252SSSCORE_DOWNLOAD_PNG = 'SSScore-download.png' 253""" 254SSScore app icon used in the instructions page download link. 255""" 256 257 258SSSCORE_INSTRUCTIONS_MD = 'instructions.md' 259""" 260Markdown representation of the end-user instructions on how to use SSScore. 261""" 262 263 264SSSCORE_MOVED_DOMAIN_MD = 'moved-2-new-domain.md' 265""" 266Markdown representation of the end-user instructions to go to the new SSScore 267domain. 268""" 269 270 271TABLE_INTERVAL = 5.0 272""" 273Speed run table interval. 274""" 275 276 277VALIDATION_WINDOW_LENGTH = 1006.0 278""" 279The validation window length as defined in the competition rules. 280"""
Breakoff altitude or hard deck.
Used to adjust the plot's max scale to score + DEFAULT_PLOT_INCREMENT so
that the whole jump progression is visible in the plot.
Default speed plot scale max is set to 550 km/h, but there is evidence it can be higher and adjusted on-the-fly based on jump results.
Default speed accuracy scale set to 5, to make it visible in plots. This value was chosen because the valid threshold is accuracy < 3.0, and this makes most values visible without intefering with other curves in the same plot.
See
ssscoring.notebook
ssscoring.appcommon
π/180º
The CSV file database dump of the drop zones directory.
Guesstimate of the exit speed; ~g
FlySight v1 CSV file headers.
FlySight v1 CSV file headers. Unlike other constants, this is a tuple instead
of a set because the code manipulates the headers/columns during file ingress.
Deep & Steep Insight GPS altimeter CSV file headers. The Insight format is
FlySight v1-like but differs: headAcc replaces cAcc, and gpsFix/numSV
precede heading. The columns required by the SSScoring pipeline are identical
in name; only headAcc is dropped on ingress.
File encoding as it comes raw from the FlySight device.
Number of feet in a meter.
Internal use - list of files to be ignored during bulk file processing in the
data lake (e.g. ./data).
km/h as m/s
Times > 25 s are irrelevant because it means that the speed skydiver flew at vSpeed < 400 km/h.
Max valid elevation allowed in the FlySight or FlySsight 2 time series. Speed
skydivers are known to jump from as high as MAX_VALID_ELEVATION without O2.
The SSScoring algorithms eliminate all data entries where elevation AGL > MAX_VALID_ELEVATION
before processing the jump for scoring. That's because occasional FlySight
errors caused by intermittent GPS signal loss and invalid GPS readings when the
skydiver sits under an airplane's wing during the climb to altitude and other
factors.
Same as MAX_VALID_ELEVATION, in ft.
Maximum exit altitude AGL according to FAI Competition Rules Speed Skydiving section 5.3.
See
Maximum exit altitude AGL according to FAI Competition Rules Speed Skydiving section 5.3.
Forward displacement at which the ground track is coloured fully UNSAFE_HORIZONTAL_COLOR. Displacements above this value are clamped to the same solid colour.
Okabe-Ito bluish green — colorblind-safe indicator used for forward displacements within the safe zone (≤ SAFE_HORIZONTAL_DISTANCE). Paired with UNSAFE_HORIZONTAL_COLOR.
Forward displacement below which the track is displayed in SAFE_HORIZONTAL_COLOR. Above this and up to MAX_HORIZONTAL_DISTANCE the colour transitions linearly to UNSAFE_HORIZONTAL_COLOR.
Okabe-Ito vermillion — colorblind-safe indicator used for forward displacements at or beyond MAX_HORIZONTAL_DISTANCE. Paired with SAFE_HORIZONTAL_COLOR.
Meters to feet conversion factor.
FlySight v1 files smaller than MIN_JUMP_FILE_SIZE are ignored because they
lack the minimum number of data points to contain a valid speed skydive.
m/s to km/h conversion factor:
s = mps * 60 * 60 / 1000
= mps * 3600 / 1000
= mps * 3.6
Performance window length as defined by ISSA/IPC/USPA.
The package resources in the manifest or package wheel resources.
Number of post-exit samples (3 seconds at 5 Hz) used to estimate the jump run bearing. The aircraft's forward throw keeps the skydiver on the jump run heading for this window regardless of intended turn direction (ISC §5.1.3).
Expected interval, in seconds, for the FlySight sample rate.
Scoring is based on the maximum speed the jumper attained within the VALIDATION_WINDOW_LENGTH
as the average speed during a sliding window of SCORING_INTERVAL seconds. The
value is set by governing bodies like ISC and USPA.
SkyTraX GPS + barometric SMD v1 CSV file headers.
Speed accuracy for the FlySight device.
SSScore app icon used in the instructions page download link.
Markdown representation of the end-user instructions on how to use SSScore.
Markdown representation of the end-user instructions to go to the new SSScore domain.
Speed run table interval.
The validation window length as defined in the competition rules.