add tools

add tools to transform wind degreese on wind cardinal name direction
This commit is contained in:
fenix-soft 2018-09-12 16:19:40 +02:00 committed by GitHub
parent dde456d948
commit f6a73fad36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 76 additions and 0 deletions

49
tools/deg2card Normal file
View File

@ -0,0 +1,49 @@
#!/bin/bash
# simple script to convert degreese to cardinal direction wind
# V1.0
#
n=$1
if (($(echo "$n>= 0" | bc))); then W_nc="N"; fi
if (($(echo "$n>= 22.5" | bc))); then W_nc="N-NE"; fi
if (($(echo "$n>= 45" | bc))); then W_nc="NE"; fi;
if (($(echo "$n>= 67.5" | bc))); then W_nc="E-NE"; fi;
if (($(echo "$n>= 90" | bc))); then W_nc="E"; fi;
if (($(echo "$n>= 112.5" | bc))); then W_nc="E-SE"; fi;
if (($(echo "$n>= 135" | bc))); then W_nc="SE"; fi;
if (($(echo "$n>= 157.5" | bc))); then W_nc="S-SE"; fi;
if (($(echo "$n>= 180" | bc))); then W_nc="S"; fi;
if (($(echo "$n>= 202.5" | bc))); then W_nc="S-SW"; fi;
if (($(echo "$n>= 225" | bc))); then W_nc="SW"; fi;
if (($(echo "$n>= 247.5" | bc))); then W_nc="W-SW"; fi;
if (($(echo "$n>= 270" | bc))); then W_nc="W"; fi;
if (($(echo "$n>= 292.5" | bc))); then W_nc="W-NW"; fi;
if (($(echo "$n>= 315" | bc))); then W_nc="NW"; fi;
if (($(echo "$n>= 337.5" | bc))); then W_nc="N-NW"; fi;
if (($(echo "$n== 360" | bc))); then W_nc="N"; fi;
if (($(echo "$n> 360" | bc))); then W_nc="-?-"; fi;
if (($(echo "$n< 0" | bc))); then W_nc="-?-"; fi
echo $W_nc

23
tools/deg2card_README.md Normal file
View File

@ -0,0 +1,23 @@
# deg2card
simple script to convert degreese to cardinal direction wind
## use:
deg2card [number]
### example:
deg2card 90
E
deg2card 360
N
## Dipend:
bc

View File

@ -0,0 +1,3 @@
# V1.0
- initial stable relase

View File

@ -0,0 +1 @@
1.0