jeff-luszcz / aistropoalert Goto Github PK
View Code? Open in Web Editor NEWuses AIS-Catcher and AIS signals to detect possible Tropospheric Ducting Events and post to Mastodon
License: Apache License 2.0
uses AIS-Catcher and AIS signals to detect possible Tropospheric Ducting Events and post to Mastodon
License: Apache License 2.0
Hi,
I modified the script to add:
-shipname if available
-bearing
and to have variables in uppercase.
Here are examples:
./AISTropoAlert.sh
Furthest ship MMSI:246436000 SHIPNAME:"DUTCH EMERALD" bearing:289 seen was 117.997429 miles away further than 30 miles away!
$ ./AISTropoAlert.sh
Furthest ship MMSI:310825000 bearing:12 seen was 92.069016 miles away further than 30 miles away!
Here the lines modifed:
MAXDIST=`curl -s $URL/ships.json | jq --arg dist $DIST '.ships[] | select(.distance>=($dist|tonumber)) | .distance' | sort -nr | head -1 `
#echo " maxdist $MAXDIST "
#curl -s $URL/ships.json | jq '.ships[] | select(.distance>=61.497009)| .mmsi'|sort -nr | head -1
MMSI=` curl -s $URL/ships.json | jq --arg maxdist $MAXDIST '.ships[] | select(.distance>=($maxdist|tonumber))| .mmsi'`
#echo " mmsi $MMSI"
SHIPNAME=` curl -s $URL/ships.json | jq --arg maxdist $MAXDIST '.ships[] | select(.distance>=($maxdist|tonumber))| .shipname'`
#echo " shipname <$SHIPNAME>"
BEARING=` curl -s $URL/ships.json | jq --arg maxdist $MAXDIST '.ships[] | select(.distance>=($maxdist|tonumber))| .bearing'`
if [ "$SHIPNAME" == '""' ]
then
echo Furthest ship MMSI:$MMSI bearing:$BEARING seen was $MAXDIST miles away further than $DIST miles away!
else
echo Furthest ship MMSI:$MMSI SHIPNAME:$SHIPNAME bearing:$BEARING seen was $MAXDIST miles away further than $DIST miles away!
fi
regards
Phil
Hi there,
I came across your short script/app via the AisCatcher website. Great idea! I’m considering to incorporate it into my vessel notification app/container called VesselAlert , of course with proper attributions under your GPL license. One of the improvements I’m thinking of is to keep a rolling (12-hour for example) max distance and only send a notification if the actual distance is > minimum distance and if it’s at least (say) 25 nm further than the last measured max distance. That way the notifications can be limited to only meaningful ones.
This would be a great add to VesselAlert and easy to implement as I already have Mastodon and Discord notifications. (See for example https://airwaves.social/@bostonharbor )
Thanks again; feel free to close this (non-) issue after you read it.
Ramon
Hi,
The SHIPS function won't work correctly with sort -r
, it needs to be sort -nr
for numeric sort or weird things can happen, like 9 miles coming before 10 miles.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.