UNPKG

dirtybomb

Version:
1,525 lines (1,524 loc) 156 kB
{ "type": "Program", "body": [ { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportDefaultSpecifier", "local": { "type": "Identifier", "name": "GaussianPlume", "range": [ 79, 92 ], "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 20 } } }, "range": [ 79, 92 ], "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 20 } } } ], "source": { "type": "Literal", "value": "./GaussianPlume", "raw": "'./GaussianPlume'", "range": [ 98, 115 ], "loc": { "start": { "line": 6, "column": 26 }, "end": { "line": 6, "column": 43 } } }, "range": [ 72, 116 ], "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 44 } }, "leadingComments": [ { "type": "Block", "value": "*\n * Created by austin on 6/6/16.\n * @file GaussianDecayPlume.js\n ", "range": [ 0, 70 ], "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 4, "column": 3 } } } ], "trailingComments": [ { "type": "Block", "value": "\n* Understanding Radioactive Aerosols and Their Measurement\n* https://books.google.com/books?id=bCjRtBX0MYkC&pg=PA280&lpg=PA280&dq=gaussian+decay+plume&source=bl&ots=oJbqk8OmIe&sig=GqzwcwVfbk_XUR6RztjSeVI0J20&hl=en&sa=X&ved=0ahUKEwih4OS7zpTNAhWq5oMKHeM_DyIQ6AEINjAF#v=onepage&q=gaussian%20decay%20plume&f=false\n* \n* ", "range": [ 118, 438 ], "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 12, "column": 4 } } }, { "type": "Block", "value": "*\n * An extension (surprise surprise) on the Gaussian Plume to account for radioactive materials\n ", "range": [ 440, 542 ], "loc": { "start": { "line": 14, "column": 0 }, "end": { "line": 16, "column": 3 } } } ] }, { "type": "Identifier", "id": { "type": "Identifier", "name": "GaussianDecayPlume", "range": [ 549, 567 ], "loc": { "start": { "line": 17, "column": 6 }, "end": { "line": 17, "column": 24 } } }, "superClass": { "type": "Identifier", "name": "GaussianPlume", "range": [ 576, 589 ], "loc": { "start": { "line": 17, "column": 33 }, "end": { "line": 17, "column": 46 } } }, "body": { "type": "ClassBody", "body": [ { "type": "MethodDefinition", "key": { "type": "Identifier", "name": "constructor", "range": [ 740, 751 ], "loc": { "start": { "line": 25, "column": 4 }, "end": { "line": 25, "column": 15 } } }, "value": { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "atmosphere", "range": [ 752, 762 ], "loc": { "start": { "line": 25, "column": 16 }, "end": { "line": 25, "column": 26 } } }, { "type": "Identifier", "name": "source", "range": [ 764, 770 ], "loc": { "start": { "line": 25, "column": 28 }, "end": { "line": 25, "column": 34 } } }, { "type": "Identifier", "name": "halfLife", "range": [ 772, 780 ], "loc": { "start": { "line": 25, "column": 36 }, "end": { "line": 25, "column": 44 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Super", "range": [ 792, 797 ], "loc": { "start": { "line": 26, "column": 8 }, "end": { "line": 26, "column": 13 } } }, "arguments": [ { "type": "Identifier", "name": "atmosphere", "range": [ 798, 808 ], "loc": { "start": { "line": 26, "column": 14 }, "end": { "line": 26, "column": 24 } } }, { "type": "Identifier", "name": "source", "range": [ 810, 816 ], "loc": { "start": { "line": 26, "column": 26 }, "end": { "line": 26, "column": 32 } } } ], "range": [ 792, 817 ], "loc": { "start": { "line": 26, "column": 8 }, "end": { "line": 26, "column": 33 } } }, "range": [ 792, 818 ], "loc": { "start": { "line": 26, "column": 8 }, "end": { "line": 26, "column": 34 } }, "trailingComments": [ { "type": "Block", "value": "*\n * \n * @type {number}\n * @private\n ", "range": [ 827, 900 ], "loc": { "start": { "line": 27, "column": 8 }, "end": { "line": 31, "column": 11 } } } ] }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 909, 913 ], "loc": { "start": { "line": 32, "column": 8 }, "end": { "line": 32, "column": 12 } } }, "property": { "type": "Identifier", "name": "_halfLife", "range": [ 914, 923 ], "loc": { "start": { "line": 32, "column": 13 }, "end": { "line": 32, "column": 22 } } }, "range": [ 909, 923 ], "loc": { "start": { "line": 32, "column": 8 }, "end": { "line": 32, "column": 22 } } }, "right": { "type": "Identifier", "name": "halfLife", "range": [ 926, 934 ], "loc": { "start": { "line": 32, "column": 25 }, "end": { "line": 32, "column": 33 } } }, "range": [ 909, 934 ], "loc": { "start": { "line": 32, "column": 8 }, "end": { "line": 32, "column": 33 } } }, "range": [ 909, 935 ], "loc": { "start": { "line": 32, "column": 8 }, "end": { "line": 32, "column": 34 } }, "leadingComments": [ { "type": "Block", "value": "*\n * \n * @type {number}\n * @private\n ", "range": [ 827, 900 ], "loc": { "start": { "line": 27, "column": 8 }, "end": { "line": 31, "column": 11 } } } ], "trailingComments": [ { "type": "Line", "value": " Usually the half-life of the pollutant", "range": [ 936, 977 ], "loc": { "start": { "line": 32, "column": 35 }, "end": { "line": 32, "column": 76 } } }, { "type": "Block", "value": "*\n * \n * @type {number}\n * @private\n ", "range": [ 986, 1059 ], "loc": { "start": { "line": 33, "column": 8 }, "end": { "line": 37, "column": 11 } } } ] }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1068, 1072 ], "loc": { "start": { "line": 38, "column": 8 }, "end": { "line": 38, "column": 12 } } }, "property": { "type": "Identifier", "name": "_decayCoeff", "range": [ 1073, 1084 ], "loc": { "start": { "line": 38, "column": 13 }, "end": { "line": 38, "column": 24 } } }, "range": [ 1068, 1084 ], "loc": { "start": { "line": 38, "column": 8 }, "end": { "line": 38, "column": 24 } } }, "right": { "type": "BinaryExpression", "operator": "/", "left": { "type": "Literal", "value": 0.693, "raw": "0.693", "range": [ 1087, 1092 ], "loc": { "start": { "line": 38, "column": 27 }, "end": { "line": 38, "column": 32 } } }, "right": { "type": "Identifier", "name": "halfLife", "range": [ 1095, 1103 ], "loc": { "start": { "line": 38, "column": 35 }, "end": { "line": 38, "column": 43 } } }, "range": [ 1087, 1103 ], "loc": { "start": { "line": 38, "column": 27 }, "end": { "line": 38, "column": 43 } } }, "range": [ 1068, 1103 ], "loc": { "start": { "line": 38, "column": 8 }, "end": { "line": 38, "column": 43 } } }, "range": [ 1068, 1104 ], "loc": { "start": { "line": 38, "column": 8 }, "end": { "line": 38, "column": 44 } }, "leadingComments": [ { "type": "Line", "value": " Usually the half-life of the pollutant", "range": [ 936, 977 ], "loc": { "start": { "line": 32, "column": 35 }, "end": { "line": 32, "column": 76 } } }, { "type": "Block", "value": "*\n * \n * @type {number}\n * @private\n ", "range": [ 986, 1059 ], "loc": { "start": { "line": 33, "column": 8 }, "end": { "line": 37, "column": 11 } } } ] } ], "range": [ 782, 1110 ], "loc": { "start": { "line": 25, "column": 46 }, "end": { "line": 39, "column": 5 } } }, "generator": false, "expression": false, "range": [ 751, 1110 ], "loc": { "start": { "line": 25, "column": 15 }, "end": { "line": 39, "column": 5 } } }, "kind": "constructor", "computed": false, "range": [ 740, 1110 ], "loc": { "start": { "line": 25, "column": 4 }, "end": { "line": 39, "column": 5 } }, "leadingComments": [ { "type": "Block", "value": "*\n * @override\n * @param {Atmosphere} atmosphere\n * @param {Source} source\n * @param {number} halfLife - seconds\n ", "range": [ 597, 735 ], "loc": { "start": { "line": 19, "column": 4 }, "end": { "line": 24, "column": 7 } } } ], "trailingComments": [ { "type": "Block", "value": "*\n * \n * @returns {number}\n ", "range": [ 1116, 1160 ], "loc": { "start": { "line": 41, "column": 4 }, "end": { "line": 44, "column": 7 } } } ], "static": false }, { "type": "MethodDefinition", "key": { "type": "Identifier", "name": "getHalfLife", "range": [ 1165, 1176 ], "loc": { "start": { "line": 45, "column": 4 }, "end": { "line": 45, "column": 15 } } }, "value": { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1196, 1200 ], "loc": { "start": { "line": 46, "column": 15 }, "end": { "line": 46, "column": 19 } } }, "property": { "type": "Identifier", "name": "_halfLife", "range": [ 1201, 1210 ], "loc": { "start": { "line": 46, "column": 20 }, "end": { "line": 46, "column": 29 } } }, "range": [ 1196, 1210 ], "loc": { "start": { "line": 46, "column": 15 }, "end": { "line": 46, "column": 29 } } }, "range": [ 1189, 1211 ], "loc": { "start": { "line": 46, "column": 8 }, "end": { "line": 46, "column": 30 } } } ], "range": [ 1179, 1217 ], "loc": { "start": { "line": 45, "column": 18 }, "end": { "line": 47, "column": 5 } } }, "generator": false, "expression": false, "range": [ 1176, 1217 ], "loc": { "start": { "line": 45, "column": 15 }, "end": { "line": 47, "column": 5 } } }, "kind": "method", "computed": false, "range": [ 1165, 1217 ], "loc": { "start": { "line": 45, "column": 4 }, "end": { "line": 47, "column": 5 } }, "leadingComments": [ { "type": "Block", "value": "*\n * \n * @returns {number}\n ", "range": [ 1116, 1160 ], "loc": { "start": { "line": 41, "column": 4 }, "end": { "line": 44, "column": 7 } } } ], "trailingComments": [ { "type": "Block", "value": "*\n * Read URAaTM pg 281 - 285\n * @see https://books.google.com/books?id=bCjRtBX0MYkC&pg=PA280&lpg=PA280&dq=gaussian+decay+plume&source=bl&ots=oJbqk8OmIe&sig=GqzwcwVfbk_XUR6RztjSeVI0J20&hl=en&sa=X&ved=0ahUKEwih4OS7zpTNAhWq5oMKHeM_DyIQ6AEINjAF#v=onepage&q=gaussian%20decay%20plume&f=false\n * @param {number} x - downwind distance (m)\n * @param {number} windSpeed - at source height (m/s)\n * @returns {number} Decay term\n ", "range": [ 1227, 1674 ], "loc": { "start": { "line": 49, "column": 4 }, "end": { "line": 55, "column": 7 } } } ], "static": false }, { "type": "MethodDefinition", "key": { "type": "Identifier", "name": "getDecayTerm", "range": [ 1679, 1691 ], "loc": { "start": { "line": 56, "column": 4 }, "end": { "line": 56, "column": 16 } } }, "value": { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "x", "range": [ 1692, 1693 ], "loc": { "start": { "line": 56, "column": 17 }, "end": { "line": 56, "column": 18 } } }, { "type": "Identifier", "name": "windSpeed", "range": [ 1695, 1704 ], "loc": { "start": { "line": 56, "column": 20 }, "end": { "line": 56, "column": 29 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "IfStatement", "test": { "type": "BinaryExpression", "operator": "==", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1720, 1724 ], "loc": { "start": { "line": 57, "column": 12 }, "end": { "line": 57, "column": 16 } } }, "property": { "type": "Identifier", "name": "_decayCoeff", "range": [ 1725, 1736 ], "loc": { "start": { "line": 57, "column": 17 }, "end": { "line": 57, "column": 28 } } }, "range": [ 1720, 1736 ], "loc": { "start": { "line": 57, "column": 12 }, "end": { "line": 57, "column": 28 } } }, "right": { "type": "Literal", "value": 0, "raw": "0", "range": [ 1740, 1741 ], "loc": { "start": { "line": 57, "column": 32 }, "end": { "line": 57, "column": 33 } } }, "range": [ 1720, 1741 ], "loc": { "start": { "line": 57, "column": 12 }, "end": { "line": 57, "column": 33 } } }, "consequent": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "Literal", "value": 1, "raw": "1", "range": [ 1764, 1765 ], "loc": { "start": { "line": 58, "column": 19 }, "end": { "line": 58, "column": 20 } } }, "range": [ 1757, 1766 ], "loc": { "start": { "line": 58, "column": 12 }, "end": { "line": 58, "column": 21 } } } ], "range": [ 1743, 1776 ], "loc": { "start": { "line": 57, "column": 35 }, "end": { "line": 59, "column": 9 } } }, "alternate": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Math", "range": [ 1803, 1807 ], "loc": { "start": { "line": 60, "column": 19 }, "end": { "line": 60, "column": 23 } } }, "property": { "type": "Identifier", "name": "exp", "range": [ 1808, 1811 ], "loc": { "start": { "line": 60, "column": 24 }, "end": { "line": 60, "column": 27 } } }, "range": [ 1803, 1811 ], "loc": { "start": { "line": 60, "column": 19 }, "end": { "line": 60, "column": 27 } } }, "arguments": [ { "type": "BinaryExpression", "operator": "*", "left": { "type": "UnaryExpression", "operator": "-", "argument": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1814, 1818 ], "loc": { "start": { "line": 60, "column": 30 }, "end": { "line": 60, "column": 34 } } }, "property": { "type": "Identifier", "name": "_decayCoeff", "range": [ 1819, 1830 ], "loc": { "start": { "line": 60, "column": 35 }, "end": { "line": 60, "column": 46 } } }, "range": [ 1814, 1830 ], "loc": { "start": { "line": 60, "column": 30 }, "end": { "line": 60, "column": 46 } } }, "prefix": true, "range": [ 1812, 1830 ], "loc": { "start": { "line": 60, "column": 28 }, "end": { "line": 60, "column": 46 } } }, "right": { "type": "BinaryExpression", "operator": "/", "left": { "type": "Identifier", "name": "x", "range": [ 1834, 1835 ], "loc": { "start": { "line": 60, "column": 50 }, "end": { "line": 60, "column": 51 } } }, "right": { "type": "Identifier", "name": "windSpeed", "range": [ 1838, 1847 ], "loc": { "start": { "line": 60, "column": 54 }, "end": { "line": 60, "column": 63 } } }, "range": [ 1834, 1847 ], "loc": { "start": { "line": 60, "column": 50 }, "end": { "line": 60, "column": 63 } } }, "range": [ 1812, 1848 ], "loc": { "start": { "line": 60, "column": 28 }, "end": { "line": 60, "column": 64 } } } ], "range": [ 1803, 1849 ], "loc": { "start": { "line": 60, "column": 19 }, "end": { "line": 60, "column": 65 } } }, "range": [ 1796, 1850 ], "loc": { "start": { "line": 60, "column": 12 }, "end": { "line": 60, "column": 66 } } } ], "range": [ 1782, 1860 ], "loc": { "start": { "line": 59, "column": 15 }, "end": { "line": 61, "column": 9 } } }, "range": [ 1716, 1860 ], "loc": { "start": { "line": 57, "column": 8 }, "end": { "line": 61, "column": 9 } } } ], "range": [ 1706, 1866 ], "loc": { "start": { "line": 56, "column": 31 }, "end": { "line": 62, "column": 5 } } }, "generator": false, "expression": false, "range": [ 1691, 1866 ], "loc": { "start": { "line": 56, "column": 16 }, "end": { "line": 62, "column": 5 } } }, "kind": "method", "computed": false, "range": [ 1679, 1866 ], "loc": { "start": { "line": 56, "column": 4 }, "end": { "line": 62, "column": 5 } }, "leadingComments": [ { "type": "Block", "value": "*\n * Read URAaTM pg 281 - 285\n * @see https://books.google.com/books?id=bCjRtBX0MYkC&pg=PA280&lpg=PA280&dq=gaussian+decay+plume&source=bl&ots=oJbqk8OmIe&sig=GqzwcwVfbk_XUR6RztjSeVI0J20&hl=en&sa=X&ved=0ahUKEwih4OS7zpTNAhWq5oMKHeM_DyIQ6AEINjAF#v=onepage&q=gaussian%20decay%20plume&f=false\n * @param {number} x - downwind distance (m)\n * @param {number} windSpeed - at source height (m/s)\n * @returns {number} Decay term\n ", "range": [ 1227,