Skip to content

Commit

Permalink
sr: Update test data to match change in sulfate
Browse files Browse the repository at this point in the history
  • Loading branch information
ctessum committed Apr 1, 2021
1 parent 3dbafdc commit 560a82e
Showing 1 changed file with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions sr/srreader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,44 +269,44 @@ func TestConcentrations(t *testing.T) {

want := []result{
{ // PM25
d: []float64{2.29174747801153e-06, 1.0526232472329866e-06, 2.935857708052936e-07,
7.094353691172728e-07, 5.076742581877625e-07, 3.374343648943068e-08, 1.4487866906165436e-07,
1.2993052678211825e-07, 2.987471603432823e-08, 1.0531014282832984e-08},
d: []float64{2.291749524374609e-06, 1.0526249525355524e-06, 2.9358676556512364e-07, 7.0943650598565e-07,
5.076755087429774e-07, 3.374364254682405e-08, 1.4487922328498826e-07, 1.2993119469228986e-07,
2.987489722272585e-08, 1.0531102212496535e-08},
},
{ // SOx
d: []float64{3.6036743034095764e-11, 3.181685123698763e-11, 2.0886658722019114e-11,
2.2876445529562695e-11, 2.5688359425735108e-11, 4.303799070598524e-12, 1.219046391609524e-11,
1.5088473873103858e-11, 4.591254893632213e-12, 2.135475390269148e-12},
d: []float64{8.102691434475062e-11, 7.153899000966746e-11, 4.6963259670018687e-11, 5.1436865183829283e-11,
5.775954714515308e-11, 9.677107205841029e-12, 2.7410114109005512e-11, 3.392639641441875e-11,
1.0323465172989987e-11, 4.801651264096929e-12},
},
{ // NH3
d: []float64{5.051080051998724e-07, 2.3203187993203755e-07, 6.474105873621738e-08, 1.56385070226861e-07,
1.1192953053296151e-07, 8.871197998416847e-09, 3.195164310909604e-08, 2.866438997273235e-08,
4.022338462306152e-09, 1.7839962840326962e-09},
d: []float64{5.051084031038044e-07, 2.320321925708413e-07, 6.47412576881834e-08, 1.5638531181139115e-07,
1.1192977922291902e-07, 8.87124596005151e-09, 3.195175324322008e-08, 2.8664521423138467e-08,
4.022360222677435e-09, 1.7840074972852449e-09},
},
{ // NOx
d: []float64{1.160867242333552e-07, 5.334764097142397e-08, 1.490167989004476e-08,
3.595706843384505e-08, 2.574873825267332e-08, 1.3573092649821206e-09, 7.356089959387191e-09,
6.6044112401186794e-09, 3.6174571671487854e-10, 2.959957001724689e-10},
d: []float64{1.1608678818220142e-07, 5.3347690709415474e-08, 1.490171186446787e-08, 3.595710396098184e-08,
2.5748777332523787e-08, 1.3573143720080338e-09, 7.356107278866375e-09, 6.604432556400752e-09,
3.617471044936593e-10, 2.9599717121797653e-10},
},
{ // VOC
d: []float64{1.338964050745517e-08, 6.081382952771719e-09, 1.6413496117806403e-09,
4.092734595673164e-09, 2.8854207911876983e-09, 9.16747094903414e-11, 8.040578203249993e-10,
7.03697711212925e-10, 1.4490984800996642e-10, 1.6441238995246188e-11},
d: []float64{1.3390037523208775e-08, 6.081683601166787e-09, 1.6415258041746483e-09, 4.092947314404682e-09,
2.885646832595512e-09, 9.169261877550738e-11, 8.041544652392929e-10, 7.038127303182762e-10,
1.4493828359718464e-10, 1.6445405801035484e-11},
},
{ // PM25 100m
d: []float64{1.0384010211692146e-06, 4.806783900520519e-07, 1.3779393223094143e-07,
3.255835884765454e-07, 2.3568499479334203e-07, 1.6861865123153858e-08, 6.997017131502968e-08,
6.392452770298667e-08, 1.537270302735229e-08, 5.577751434206565e-09},
d: []float64{1.0384019515664409e-06, 4.806791708367362e-07, 1.3779439660174915e-07, 3.255841114416068e-07,
2.3568557381549462e-07, 1.6861964589935698e-08, 6.997043397091758e-08, 6.392484788112892e-08,
1.5372791544187306e-08, 5.5777951037364604e-09},
},
{ // PM25 200m
d: []float64{1.2420383832534299e-08, 1.2488333034355037e-08, 1.0263823568834596e-08,
1.1365207441826897e-08, 1.3036487445106104e-08, 3.0427289576806515e-09,
8.650599347959087e-09, 9.892478836093233e-09, 3.5014566801550018e-09, 1.5230451344550033e-09},
d: []float64{1.2420400707924273e-08, 1.2488357015172369e-08, 1.0263853766900866e-08, 1.136522786993055e-08,
1.3036516754993954e-08, 3.0427411701339224e-09, 8.650623328776419e-09, 9.89251436323002e-09,
3.5014693366974825e-09, 1.5230525729492683e-09},
},
{ // PM25 800m
d: []float64{3.835866693724377e-11, 6.099889343635923e-11, 8.292484754424123e-11,
5.750595138964698e-11, 8.120485534002242e-11, 4.1053837412929894e-11, 7.843142801888803e-11,
1.0826346763526118e-10, 4.48883083481455e-11, 2.5135810099996547e-11},
d: []float64{3.835875714286452e-11, 6.099905996981292e-11, 8.292511816110348e-11, 5.7506100575865915e-11,
8.120508432352125e-11, 4.1053983129701876e-11, 7.843166394128076e-11, 1.0826384233553199e-10,
4.4888457534364434e-11, 2.513591244868163e-11},
err: AboveTopErr{PlumeHeight: 800},
},
}
Expand All @@ -320,7 +320,7 @@ func TestConcentrations(t *testing.T) {
t.Errorf("test %d error: want %v, have %v", i, want[i].err, err)
}
}
if !reflect.DeepEqual(want[i].d, c) {
if !reflect.DeepEqual(want[i].d, c.TotalPM25()) {
for j, v := range c.TotalPM25() {
w := want[i].d[j]
if math.Abs(w-v)*2/(w+v) > 1.e-8 {
Expand Down Expand Up @@ -396,9 +396,9 @@ func TestOutput(t *testing.T) {
},
}

want := []float64{2.9263678846952468e-06, 1.3441159679404568e-06, 3.748907457020584e-07,
9.058931188191816e-07, 6.482636361240107e-07, 4.4067922261390585e-08, 1.850026504143787e-07,
1.659181141800553e-07, 3.440830131625286e-08, 1.2629582981423665e-08}
want := []float64{2.9264157800981683e-06, 1.3441580584069857e-06, 3.749182241816196e-07, 9.059233059376115e-07,
6.482974716781609e-07, 4.407357260486494e-08, 1.85018648386423e-07, 1.6593788779856178e-07,
3.441426629866712e-08, 1.2632353938064889e-08}

c, err := sr.Concentrations(e...)
if err != nil {
Expand Down Expand Up @@ -474,16 +474,16 @@ func TestOutput(t *testing.T) {
}

shpWant := []outData{
outData{BasePM25: 4.90770054, TotalPM25: 2.9263678847e-06, PrimPM25: 2.291747478e-06, PNH4: 5.051080052e-07, PSO4: 3.603674303e-11, PNO3: 1.16086724233e-07, SOA: 1.33896405075e-08, TotalPop: 100000, WhiteNoLat: 50000, NPctWNoLat: 0.5, NPctOther: 0.5, NPctRatio: 1, Deaths: 1.75833678e-05, WindSpeed: 2.16334701},
outData{BasePM25: 4.90770054, TotalPM25: 1.3441159679e-06, PrimPM25: 1.0526232472e-06, PNH4: 2.3203187993e-07, PSO4: 3.181685124e-11, PNO3: 5.3347640971e-08, SOA: 6.0813829528e-09, TotalPop: 0, WhiteNoLat: 0, NPctWNoLat: 0.5, NPctOther: 0.5, NPctRatio: 1, Deaths: 0, WindSpeed: 2.16334701},
outData{BasePM25: 4.90770054, TotalPM25: 3.748907457e-07, PrimPM25: 2.935857708e-07, PNH4: 6.474105874e-08, PSO4: 2.088665872e-11, PNO3: 1.490167989e-08, SOA: 1.6413496118e-09, TotalPop: 0, WhiteNoLat: 0, NPctWNoLat: 0.5, NPctOther: 0.5, NPctRatio: 1, Deaths: 0, WindSpeed: 2.16334701},
outData{BasePM25: 4.90770054, TotalPM25: 9.058931188e-07, PrimPM25: 7.094353691e-07, PNH4: 1.5638507023e-07, PSO4: 2.287644553e-11, PNO3: 3.5957068434e-08, SOA: 4.0927345957e-09, TotalPop: 0, WhiteNoLat: 0, NPctWNoLat: 0.5, NPctOther: 0.5, NPctRatio: 1, Deaths: 0, WindSpeed: 2.16334701},
outData{BasePM25: 4.90770054, TotalPM25: 6.482636361e-07, PrimPM25: 5.076742582e-07, PNH4: 1.1192953053e-07, PSO4: 2.568835943e-11, PNO3: 2.5748738253e-08, SOA: 2.8854207912e-09, TotalPop: 0, WhiteNoLat: 0, NPctWNoLat: 0.5, NPctOther: 0.5, NPctRatio: 1, Deaths: 0, WindSpeed: 2.16334701},
outData{BasePM25: 10.34742928, TotalPM25: 4.40679223e-08, PrimPM25: 3.37434365e-08, PNH4: 8.871198e-09, PSO4: 4.30379907e-12, PNO3: 1.357309265e-09, SOA: 9.16747095e-11, TotalPop: 0, WhiteNoLat: 0, NPctWNoLat: 0.5, NPctOther: 0.5, NPctRatio: 1, Deaths: 0, WindSpeed: 1.88434911},
outData{BasePM25: 4.90770054, TotalPM25: 1.850026504e-07, PrimPM25: 1.448786691e-07, PNH4: 3.195164311e-08, PSO4: 1.219046392e-11, PNO3: 7.356089959e-09, SOA: 8.040578203e-10, TotalPop: 0, WhiteNoLat: 0, NPctWNoLat: 0.5, NPctOther: 0.5, NPctRatio: 1, Deaths: 0, WindSpeed: 2.16334701},
outData{BasePM25: 4.90770054, TotalPM25: 1.659181142e-07, PrimPM25: 1.299305268e-07, PNH4: 2.866438997e-08, PSO4: 1.508847387e-11, PNO3: 6.60441124e-09, SOA: 7.036977112e-10, TotalPop: 0, WhiteNoLat: 0, NPctWNoLat: 0.5, NPctOther: 0.5, NPctRatio: 1, Deaths: 0, WindSpeed: 2.16334701},
outData{BasePM25: 4.2574172, TotalPM25: 3.44083013e-08, PrimPM25: 2.9874716e-08, PNH4: 4.02233846e-09, PSO4: 4.59125489e-12, PNO3: 3.61745717e-10, SOA: 1.44909848e-10, TotalPop: 0, WhiteNoLat: 0, NPctWNoLat: 0.5, NPctOther: 0.5, NPctRatio: 1, Deaths: 0, WindSpeed: 2.7272017},
outData{BasePM25: 5.36232233, TotalPM25: 1.2629583e-08, PrimPM25: 1.05310143e-08, PNH4: 1.78399628e-09, PSO4: 2.13547539e-12, PNO3: 2.959957e-10, SOA: 1.6441239e-11, TotalPop: 0, WhiteNoLat: 0, NPctWNoLat: 0.5, NPctOther: 0.5, NPctRatio: 1, Deaths: 0, WindSpeed: 2.56135321},
{BasePM25: 4.90770054, TotalPM25: 2.9264157801e-06, PrimPM25: 2.2917495244e-06, PNH4: 5.051084031e-07, PSO4: 8.102691434e-11, PNO3: 1.16086788182e-07, SOA: 1.33900375232e-08, TotalPop: 100000, WhiteNoLat: 50000, NPctWNoLat: 0.5, NPctOther: 0.5, NPctRatio: 1, Deaths: 1.75836556e-05, WindSpeed: 2.16334701},
{BasePM25: 4.90770054, TotalPM25: 1.3441580584e-06, PrimPM25: 1.0526249525e-06, PNH4: 2.3203219257e-07, PSO4: 7.153899001e-11, PNO3: 5.3347690709e-08, SOA: 6.0816836012e-09, TotalPop: 0, WhiteNoLat: 0, NPctWNoLat: 0.5, NPctOther: 0.5, NPctRatio: 1, Deaths: 0, WindSpeed: 2.16334701},
{BasePM25: 4.90770054, TotalPM25: 3.749182242e-07, PrimPM25: 2.935867656e-07, PNH4: 6.474125769e-08, PSO4: 4.696325967e-11, PNO3: 1.4901711864e-08, SOA: 1.6415258042e-09, TotalPop: 0, WhiteNoLat: 0, NPctWNoLat: 0.5, NPctOther: 0.5, NPctRatio: 1, Deaths: 0, WindSpeed: 2.16334701},
{BasePM25: 4.90770054, TotalPM25: 9.059233059e-07, PrimPM25: 7.09436506e-07, PNH4: 1.5638531181e-07, PSO4: 5.143686518e-11, PNO3: 3.5957103961e-08, SOA: 4.0929473144e-09, TotalPop: 0, WhiteNoLat: 0, NPctWNoLat: 0.5, NPctOther: 0.5, NPctRatio: 1, Deaths: 0, WindSpeed: 2.16334701},
{BasePM25: 4.90770054, TotalPM25: 6.482974717e-07, PrimPM25: 5.076755087e-07, PNH4: 1.1192977922e-07, PSO4: 5.775954715e-11, PNO3: 2.5748777333e-08, SOA: 2.8856468326e-09, TotalPop: 0, WhiteNoLat: 0, NPctWNoLat: 0.5, NPctOther: 0.5, NPctRatio: 1, Deaths: 0, WindSpeed: 2.16334701},
{BasePM25: 10.34742928, TotalPM25: 4.40735726e-08, PrimPM25: 3.37436425e-08, PNH4: 8.87124596e-09, PSO4: 9.67710721e-12, PNO3: 1.357314372e-09, SOA: 9.16926188e-11, TotalPop: 0, WhiteNoLat: 0, NPctWNoLat: 0.5, NPctOther: 0.5, NPctRatio: 1, Deaths: 0, WindSpeed: 1.88434911},
{BasePM25: 4.90770054, TotalPM25: 1.850186484e-07, PrimPM25: 1.448792233e-07, PNH4: 3.195175324e-08, PSO4: 2.741011411e-11, PNO3: 7.356107279e-09, SOA: 8.041544652e-10, TotalPop: 0, WhiteNoLat: 0, NPctWNoLat: 0.5, NPctOther: 0.5, NPctRatio: 1, Deaths: 0, WindSpeed: 2.16334701},
{BasePM25: 4.90770054, TotalPM25: 1.659378878e-07, PrimPM25: 1.299311947e-07, PNH4: 2.866452142e-08, PSO4: 3.392639641e-11, PNO3: 6.604432556e-09, SOA: 7.038127303e-10, TotalPop: 0, WhiteNoLat: 0, NPctWNoLat: 0.5, NPctOther: 0.5, NPctRatio: 1, Deaths: 0, WindSpeed: 2.16334701},
{BasePM25: 4.2574172, TotalPM25: 3.44142663e-08, PrimPM25: 2.98748972e-08, PNH4: 4.02236022e-09, PSO4: 1.032346517e-11, PNO3: 3.61747104e-10, SOA: 1.449382836e-10, TotalPop: 0, WhiteNoLat: 0, NPctWNoLat: 0.5, NPctOther: 0.5, NPctRatio: 1, Deaths: 0, WindSpeed: 2.7272017},
{BasePM25: 5.36232233, TotalPM25: 1.26323539e-08, PrimPM25: 1.05311022e-08, PNH4: 1.7840075e-09, PSO4: 4.80165126e-12, PNO3: 2.95997171e-10, SOA: 1.64454058e-11, TotalPop: 0, WhiteNoLat: 0, NPctWNoLat: 0.5, NPctOther: 0.5, NPctRatio: 1, Deaths: 0, WindSpeed: 2.56135321},
}

if len(recs) != len(shpWant) {
Expand Down

0 comments on commit 560a82e

Please sign in to comment.