mirror of
https://github.com/fenix-soft/fmeteo.git
synced 2025-02-12 01:10:36 +01:00
add tools
add tools to transform wind degreese on wind cardinal name direction
This commit is contained in:
parent
dde456d948
commit
f6a73fad36
49
tools/deg2card
Normal file
49
tools/deg2card
Normal 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
23
tools/deg2card_README.md
Normal 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
|
||||
|
||||
|
3
tools/deg2card_changelog.md
Normal file
3
tools/deg2card_changelog.md
Normal file
@ -0,0 +1,3 @@
|
||||
# V1.0
|
||||
|
||||
- initial stable relase
|
1
tools/deg2card_version.md
Normal file
1
tools/deg2card_version.md
Normal file
@ -0,0 +1 @@
|
||||
1.0
|
Loading…
x
Reference in New Issue
Block a user