Skip to content

Commit 137840b

Browse files
committed
correct divide by zero check
1 parent db948e5 commit 137840b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# nexrad-level-3-data
22

3-
### v0.3.2
3+
### v0.3.3
44
A javascript implementation for decoding Nexrad Level III radar files.
55

66
You can find more information on how radar data is encoded at [NOAA](https://www.roc.noaa.gov/WSR88D/BuildInfo/Files.aspx). The work in this project is based mainly on the document [2620001 ICD FOR THE RPG TO CLASS 1 USER - Build 19.0](https://www.roc.noaa.gov/wsr88d/PublicDocs/ICDs/2620001Y.pdf).

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nexrad-level-3-data",
3-
"version": "0.3.2",
3+
"version": "0.3.3",
44
"description": "Parsing of NEXRAD level 3 data files",
55
"main": "src/index.js",
66
"scripts": {

src/packets/utilities/ij.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const ijToAzDeg = (i, j, rawMax = 4096, range = 248, conversion = 1.15078) => {
88
const nm = ((Math.sqrt(i ** 2 + j ** 2) / rawMax) * range) * conversion;
99
let deg = 0;
1010
// short circuit potential divide by zero
11-
if (i !== j) {
11+
if (i === 0) {
1212
// calculate degrees, then rotate due to north = up = 0 deg convention
1313
deg = (Math.atan(-j / i) * 180) / Math.PI + 90;
1414
// coerce to 0<=deg<360

0 commit comments

Comments
 (0)