mirror of https://github.com/fenix-soft/fmeteo.git
add tools
add tools to transform wind degreese on wind cardinal name direction
This commit is contained in:
parent
dde456d948
commit
f6a73fad36
|
@ -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
|
|
@ -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
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
# V1.0
|
||||
|
||||
- initial stable relase
|
|
@ -0,0 +1 @@
|
|||
1.0
|
Loading…
Reference in New Issue