https://github.com/botto/hadslp2
A lib to read hadslp2 files
https://github.com/botto/hadslp2
Last synced: over 1 year ago
JSON representation
A lib to read hadslp2 files
- Host: GitHub
- URL: https://github.com/botto/hadslp2
- Owner: botto
- License: isc
- Created: 2018-07-22T15:22:56.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-22T15:27:30.000Z (almost 8 years ago)
- Last Synced: 2025-01-15T07:18:40.486Z (over 1 year ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HadSLP2 Parser
This is a simple lib with no deps that will format HadSLP2 data from the met office in a way that can be used in JS.
The exposes one function that takes in a string and outputs a multi level object.
The object is formated
year.month.vertdeg.horzdeg
The vertdeg goes from -90 to 90 indicating 90N to 90S
The horzdeg goes from -180 to 175 indicating 180W to 175E
The format of the data can be found at https://www.metoffice.gov.uk/hadobs/hadslp2/data/Read_instructions_HADSLP2_5dg
Note: There are differences in the data after 2005 which have to be taken in to account.
Futher details are on the met office download page https://www.metoffice.gov.uk/hadobs/hadslp2/data/download.html
## To use
1. Download the near real time data https://www.metoffice.gov.uk/hadobs/hadslp2/data/hadslp2r.asc.gz
2. Gunzip the file
3. Read in the `hadslp2r.asc` file
## Example
```javascript
const fs = require('fs').promises;
const hadSLP2 = require('./lib/hadslp2');
(async() => {
const rawBuffer = await fs.readFile('./hadslp2r.asc');
const rawStrings = rawBuffer.toString()
const pressureData = hadSLP2(rawStrings);
})();
```