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 74FLYSIGHT_FILE_ENCODING = 'utf-8' 75""" 76File encoding as it comes raw from the FlySight device. 77""" 78 79 80FT_IN_M = 3.2808 81""" 82Number of feet in a meter. 83""" 84 85 86IGNORE_LIST = [ '.ipynb_checkpoints', ] 87""" 88Internal use - list of files to be ignored during bulk file processing in the 89data lake (e.g. `./data`). 90""" 91 92 93KMH_AS_MS = 3.6 94""" 95km/h as m/s 96""" 97 98 99LAST_TIME_TRANCHE = 25.0 100""" 101Times > 25 s are irrelevant because it means that the speed skydiver flew at 102vSpeed < 400 km/h. 103""" 104 105 106MAX_VALID_ELEVATION = 4602.0 107""" 108Max valid elevation allowed in the FlySight or FlySsight 2 time series. Speed 109skydivers are known to jump from as high as `MAX_VALID_ELEVATION` without O2. 110The SSScoring algorithms eliminate all data entries where elevation AGL > `MAX_VALID_ELEVATION` 111before processing the jump for scoring. That's because occasional FlySight 112errors caused by intermittent GPS signal loss and invalid GPS readings when the 113skydiver sits under an airplane's wing during the climb to altitude and other 114factors. 115""" 116 117 118MAX_VALID_ELEVATION_FT = MAX_VALID_ELEVATION*3.28 119""" 120Same as `MAX_VALID_ELEVATION`, in ft. 121""" 122 123 124MAX_ALTITUDE_FT = 14000.0 125""" 126Maximum exit altitude AGL according to FAI Competition Rules Speed Skydiving 127section 5.3. 128""" 129 130MAX_ALTITUDE_METERS = MAX_ALTITUDE_FT/3.28 131""" 132See 133--- 134Maximum exit altitude AGL according to FAI Competition Rules Speed Skydiving 135section 5.3. 136""" 137 138 139MAX_HORIZONTAL_DISTANCE = 600.0 140""" 141Forward displacement at which the ground track is coloured fully 142UNSAFE_HORIZONTAL_COLOR. Displacements above this value are clamped to the 143same solid colour. 144""" 145 146 147SAFE_HORIZONTAL_COLOR = '#009E73' 148""" 149Okabe-Ito bluish green — colorblind-safe indicator used for forward 150displacements within the safe zone (≤ SAFE_HORIZONTAL_DISTANCE). 151Paired with UNSAFE_HORIZONTAL_COLOR. 152""" 153 154 155SAFE_HORIZONTAL_DISTANCE = 480.0 156""" 157Forward displacement below which the track is displayed in SAFE_HORIZONTAL_COLOR. 158Above this and up to MAX_HORIZONTAL_DISTANCE the colour transitions linearly 159to UNSAFE_HORIZONTAL_COLOR. 160""" 161 162 163UNSAFE_HORIZONTAL_COLOR = '#D55E00' 164""" 165Okabe-Ito vermillion — colorblind-safe indicator used for forward 166displacements at or beyond MAX_HORIZONTAL_DISTANCE. 167Paired with SAFE_HORIZONTAL_COLOR. 168""" 169 170 171M_2_FT = 3.28084 172""" 173Meters to feet conversion factor. 174""" 175 176 177MIN_JUMP_FILE_SIZE = 1024*512 178MIN_JUMP_FILE_SIZE = 1024*64 179""" 180FlySight v1 files smaller than `MIN_JUMP_FILE_SIZE` are ignored because they 181lack the minimum number of data points to contain a valid speed skydive. 182""" 183 184 185MPS_2_KMH = 3.6 186""" 187m/s to km/h conversion factor: 188 189```python 190s = mps * 60 * 60 / 1000 191 = mps * 3600 / 1000 192 = mps * 3.6 193``` 194""" 195 196 197PERFORMANCE_WINDOW_LENGTH = 2256.0 198""" 199Performance window length as defined by ISSA/IPC/USPA. 200""" 201 202 203RESOURCES = 'ssscoring.resources' 204""" 205The package resources in the manifest or package wheel resources. 206""" 207 208 209JUMP_RUN_SAMPLES = 15 210""" 211Number of post-exit samples (3 seconds at 5 Hz) used to estimate the jump run 212bearing. The aircraft's forward throw keeps the skydiver on the jump run 213heading for this window regardless of intended turn direction (ISC §5.1.3). 214""" 215 216 217SAMPLE_RATE = 0.2 218""" 219Expected interval, in seconds, for the FlySight sample rate. 220""" 221 222 223SCORING_INTERVAL = 3.0 224""" 225Scoring is based on the maximum speed the jumper attained within the `VALIDATION_WINDOW_LENGTH` 226as the average speed during a sliding window of SCORING_INTERVAL seconds. The 227value is set by governing bodies like ISC and USPA. 228""" 229 230 231SKYTRAX_1_HEADER = set([ 'time', 'lat', 'lon', 'hMSL', 'velN', 'velE', 'velD', 'hAcc', 'vAcc', 'sAcc', 'heading', 'cAcc', 'gpsFix', 'numSV', ]) 232""" 233SkyTraX GPS + barometric SMD v1 CSV file headers. 234""" 235 236 237SPEED_ACCURACY_THRESHOLD = 3.0 238""" 239Speed accuracy for the FlySight device. 240""" 241 242 243SSSCORE_DOWNLOAD_PNG = 'SSScore-download.png' 244""" 245SSScore app icon used in the instructions page download link. 246""" 247 248 249SSSCORE_INSTRUCTIONS_MD = 'instructions.md' 250""" 251Markdown representation of the end-user instructions on how to use SSScore. 252""" 253 254 255SSSCORE_MOVED_DOMAIN_MD = 'moved-2-new-domain.md' 256""" 257Markdown representation of the end-user instructions to go to the new SSScore 258domain. 259""" 260 261 262TABLE_INTERVAL = 5.0 263""" 264Speed run table interval. 265""" 266 267 268VALIDATION_WINDOW_LENGTH = 1006.0 269""" 270The validation window length as defined in the competition rules. 271"""
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.
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.