eugecm / gometar Goto Github PK
View Code? Open in Web Editor NEWMETAR parser written in Go
METAR parser written in Go
Hi,
I wanted to use your library for a personal project. I am new in GO and these are my first steps.
Sadly it seems that the modules has a problem with the TCU (Towering cumulus) part of the cloud layer given the following METAR:
ELLX 021550Z 06008KT 9999 VCSH FEW051TCU 17/06 Q1015 NOSIG
panic: runtime error: index out of range [10] with length 10
goroutine 1 [running]:
github.com/eugecm/gometar/metar/parser.(*Parser).Parse(_, {_, _})
/Users/swagener/go/pkg/mod/github.com/eugecm/[email protected]/metar/parser/parser.go:124 +0xeee
main.main()
/Users/swagener/git/vatsim-companion/metar.go:45 +0x12b
exit status 2
If i remove TCU
part from the FEW051TCU
string it works.
First of all : Thank you for your work on that package.
Doing some testing on your package doday with a local METAR station, I get the following strings from the station :
2020/12/28 09:30
LFBO 280930Z AUTO 24014KT 9999 BKN018/// BKN027/// BKN034/// ///CB 06/03 Q0991 TEMPO 25020G32KT 4000 SHRA BKN014 SCT020TCU
This leads to an error in getCloudInfo()
while processing cloud string ///CB
.
I'm not very comfortable with METAR format (I'm very new to it), but the "wikipedia" page gives some informations on cloud where ///
seems to be "unable to measure" code and CB
is "Cumulonimbus". CB seems to be just after the height field but in the ///
case. So, maybe the cloudAmoutRegexp
may take this into acount : amount + height should be optional and (?P<cloud>TCU|CB)?
should be placed after (maybe) ///
?
Some other sources seems to describe the format you've implemented... Is ///(?P<cloud>TCU|CB)
a possible other format ? How to analyze it ?
From my POV, I cannot change the way METAR files are published.
If ///CB
is a format error, maybe parsing should not end-up with error but a warning or something else in the lib, allowing parsing the next section or item in the token ?
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.