mirror of
https://github.com/sbrl/research-rainfallradar
synced 2024-12-22 06:05:01 +00:00
Fix remaining(?) crashes= in our code
This commit is contained in:
parent
3cb7e42505
commit
e030e6c2d5
2 changed files with 9 additions and 5 deletions
4
rainfallwrangler/package-lock.json
generated
4
rainfallwrangler/package-lock.json
generated
|
@ -506,7 +506,7 @@
|
|||
"node_modules/browserify-zlib": {
|
||||
"version": "0.1.4",
|
||||
"resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz",
|
||||
"integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=",
|
||||
"integrity": "sha512-19OEpq7vWgsH6WkvkBJQDFvJS1uPcbFOQ4v9CU839dO+ZZXUZO6XpE6hNCqvlIIj+4fZvRiJ6DsAQ382GwiyTQ==",
|
||||
"dependencies": {
|
||||
"pako": "~0.2.0"
|
||||
}
|
||||
|
@ -2068,7 +2068,7 @@
|
|||
"browserify-zlib": {
|
||||
"version": "0.1.4",
|
||||
"resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz",
|
||||
"integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=",
|
||||
"integrity": "sha512-19OEpq7vWgsH6WkvkBJQDFvJS1uPcbFOQ4v9CU839dO+ZZXUZO6XpE6hNCqvlIIj+4fZvRiJ6DsAQ382GwiyTQ==",
|
||||
"requires": {
|
||||
"pako": "~0.2.0"
|
||||
}
|
||||
|
|
|
@ -20,14 +20,18 @@ class Terrain50StreamReader {
|
|||
|
||||
async *iterate(filepath) {
|
||||
const reader = fs.createReadStream(filepath);
|
||||
const extractor = gunzip();
|
||||
reader.pipe(extractor);
|
||||
|
||||
const stream = Terrain50.ParseStream(new Readable(extractor), this.tolerant ? /\s+/ : " ");
|
||||
const stream = Terrain50.ParseStream(
|
||||
new Readable().wrap(reader.pipe(gunzip())),
|
||||
this.tolerant ? /\s+/ : " "
|
||||
);
|
||||
|
||||
let i = -1;
|
||||
for await (const next of stream) {
|
||||
i++;
|
||||
|
||||
console.log(`Terrain50 STEP ${i}`);
|
||||
|
||||
// Skip the first few items, because we want to predict the water
|
||||
// depth after the rainfall radar data
|
||||
if(i < this.offset)
|
||||
|
|
Loading…
Reference in a new issue