Skip to content

Commit

Permalink
Don't generate surrogates if emis==0 (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
ctessum authored Jan 27, 2022
1 parent 97716d6 commit 70e27b1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ require (
github.com/lnashier/viper v0.0.0-20180730210402-cc7336125d12
github.com/magiconair/properties v1.7.3 // indirect
github.com/mattn/go-sqlite3 v1.11.0
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/pelletier/go-toml v1.0.1 // indirect
github.com/rs/cors v1.3.0 // indirect
github.com/russross/blackfriday v2.0.0+incompatible // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,8 @@ github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3I
github.com/opencontainers/image-spec v1.0.0/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI=
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM=
github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
github.com/opencontainers/runc v1.0.0-rc8.0.20190926000215-3e425f80a8c9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
Expand Down
7 changes: 7 additions & 0 deletions io.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,13 @@ func FromAEP(r []aep.RecordGridded, grids []*aep.GridDef, gi int, VOC, NOx, NH3,
groundERecs := make(map[int]*EmisRecord)

for _, rec := range r {
var totalEmis float64
for _, v := range rec.Totals() {
totalEmis += math.Abs(v.Value())
}
if totalEmis == 0 {
continue
}
gridSrg, _, inGrid, err := rec.GridFactors(gi)
if err != nil {
return nil, err
Expand Down

0 comments on commit 70e27b1

Please sign in to comment.