skydivejkl / metar.js Goto Github PK
View Code? Open in Web Editor NEWJavascript parser for METAR weather reports
Home Page: http://skydivejkl.github.io/metar.js
License: MIT License
Javascript parser for METAR weather reports
Home Page: http://skydivejkl.github.io/metar.js
License: MIT License
from EFJY 082120Z AUTO 00000KT 9999 R30/1300U BKN083 BKN101 15/12 Q1013
EFUT 160750Z AUTO 25011KT 9999 ////// 15/14 Q1006
EFVA 171520Z AUTO 31010KT 270V340 9999 ////// 09/03 Q1009
METAR COR EFUT 060620Z 01008KT CAVOK M10/M12 Q1021=
If you pass the exact sam METAR a couple of time, the resulting object will have a different "time" attribute each time:
https://skydivejkl.github.io/metar.js/#SBSP%20210000Z%2014006KT%209999%20-RA%20BKN007%20OVC013%2017/16%20Q1023
SBSP 210000Z 14006KT 9999 -RA BKN007 OVC013 17/16 Q1023
1st call: 2022-03-21T00:00:01.762Z
2ns call: 2022-03-21T00:00:34.040Z
3rd call: 2022-03-21T00:00:50.418Z
The problem seem to be here:
METAR.prototype.parseDate = function() {
this.next();
var d = new Date();
d.setUTCDate(asInt(this.current.slice(0, 2)));
d.setUTCHours(asInt(this.current.slice(2, 4)));
d.setUTCMinutes(asInt(this.current.slice(4, 6)));
this.result.time = d;
};
Also, I'm not sure if the METAR timezone is being taken into account. In this example SBSP is the São Paulo–Congonhas Airport which is in GMT-3.
Hello.
Give this METAR:
METAR ZGSZ 210500Z 06003MPS 020V100 9999 SCT033 28/19 Q1016 NOSIG
Obtained from here with a local datetime of Nov 21 2015 1PM, metar.js
returns time
of Sun Dec 20 2015 21:00:30 GMT-0800 (PST)
. Is there something special we have to do when dealing with METAR datetime?
Are there plans to support TAFs as well?
This is a META for ENGM retrieved from https://www.ippc.no/ippc/aerodromes.jsp
METAR 300450Z 29004KT 260V340 CAVOK M02/M03 Q1018 NOSIG
My understanding is that here the dew point is -3 yet the parsed dew point is null
{
"station": "METAR",
"time": "2014-10-30T04:50:24.460Z",
"auto": false,
"wind": {
"speed": 4,
"gust": null,
"direction": 290,
"variation": {
"min": 260,
"max": 340
},
"unit": "KT"
},
"cavok": true,
"visibility": null,
"weather": null,
"clouds": null,
"temperature": -2,
"dewpoint": null,
"altimeter_hpa": 1018
}
Metars can no longer be gotten from the source, as it has been discontinued.
Any work around? Looking for a metar source for a site I'm trying to make: https://github.com/GiacomoLaw/QuickMETAR
Is that right?
METAR EFJY 181850Z AUTO VRB00KT 0250 R12/1000D FZFG VV001 M03/M03 Q0992=
Now only one array is generated which loses information.
EFJY 092120Z AUTO 05003KT 9999 -SHRA VCSH SCT006 OVC028CB 13/13 Q1014
should parse to
{
weather: [
{ <obj for -SHRA> },
{ <obj for VCSH> }
]
}
fails to parse clouds from this EFJY 092120Z AUTO 05003KT 9999 -SHRA VCSH SCT006 OVC028CB 13/13 Q1014
EFVA 171650Z AUTO 30007KT 260V320 9999 -SHRA FEW022/// SCT031/// OVC037/// 09/04 Q1009 REUP
The parser can parse XX% of metars, but any metar with a little bit different sequence of infos will confuse it. For instance any corrected metars.
PAOM 302353Z COR 32005KT 10SM CLR M03/M09 A2993
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.