diff --git a/.travis.yml b/.travis.yml index 606309d0d..c7f73c677 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,12 +6,14 @@ services: language: go go: - - 1.7 + - 1.9 install: true script: + - test -z "$(gofmt -s -l `find . -name "*.go" | egrep -v vendor` | tee /dev/stderr)" + - go vet ./... - ./test.sh - ./build.sh @@ -53,4 +55,4 @@ deploy: after_script: - ./tools/sit/sit_build.sh -# vim: set ts=2 sw=2 tw=0 et: \ No newline at end of file +# vim: set ts=2 sw=2 tw=0 et: diff --git a/internal/metadb/channels.go b/internal/metadb/channels.go index 6471b7f71..6768f8107 100644 --- a/internal/metadb/channels.go +++ b/internal/metadb/channels.go @@ -60,7 +60,7 @@ func (m *MetaDB) Channels(sta string) ([]Channel, error) { } lookup := response.Channels(stream.Axial) - for pin, _ := range response.Components { + for pin := range response.Components { if !(pin < len(lookup)) { continue } diff --git a/resp/generate/filter.go b/resp/generate/filter.go index 802a8c9e1..b8f40a423 100644 --- a/resp/generate/filter.go +++ b/resp/generate/filter.go @@ -22,7 +22,7 @@ type filterMap map[string][]ResponseStage func (f filterMap) Keys() []string { var keys []string - for k, _ := range f { + for k := range f { keys = append(keys, k) } sort.Strings(keys) diff --git a/resp/generate/fir.go b/resp/generate/fir.go index 34e173328..a4612cea9 100644 --- a/resp/generate/fir.go +++ b/resp/generate/fir.go @@ -43,7 +43,7 @@ type firMap map[string]FIR func (f firMap) Keys() []string { var keys []string - for k, _ := range f { + for k := range f { keys = append(keys, k) } sort.Strings(keys) diff --git a/resp/generate/paz.go b/resp/generate/paz.go index 1cf3f5ac8..54274c04f 100644 --- a/resp/generate/paz.go +++ b/resp/generate/paz.go @@ -29,7 +29,7 @@ type pazMap map[string]PAZ func (p pazMap) Keys() []string { var keys []string - for k, _ := range p { + for k := range p { keys = append(keys, k) } sort.Strings(keys) diff --git a/resp/generate/polynomial.go b/resp/generate/polynomial.go index 7db2e1a90..9d6fecacf 100644 --- a/resp/generate/polynomial.go +++ b/resp/generate/polynomial.go @@ -30,7 +30,7 @@ type polynomialMap map[string]Polynomial func (p polynomialMap) Keys() []string { var keys []string - for k, _ := range p { + for k := range p { keys = append(keys, k) } sort.Strings(keys) diff --git a/resp/generate/response.go b/resp/generate/response.go index d27a1ce6c..396c6614a 100644 --- a/resp/generate/response.go +++ b/resp/generate/response.go @@ -32,7 +32,7 @@ type responseMap map[string]Response func (r responseMap) Keys() []string { var keys []string - for k, _ := range r { + for k := range r { keys = append(keys, k) } sort.Strings(keys) diff --git a/tools/altus/slates.go b/tools/altus/slates.go index 49f841238..0229c46b6 100644 --- a/tools/altus/slates.go +++ b/tools/altus/slates.go @@ -1,14 +1,14 @@ package main var slates = map[string][]Altus{ - "BKZ": []Altus{ - Altus{ + "BKZ": { + { Installed: "2013/10/09,00:00:01", DevCode: "Q33", InstId: "294", Removed: "2016/04/19,02:15:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -17,7 +17,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "BKZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -26,7 +26,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "BKZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -37,13 +37,13 @@ var slates = map[string][]Altus{ }, }, }, - Altus{ + { Installed: "2016/01/29,13:25:01", DevCode: "Q33", InstId: "285", Removed: "9999/01/01,00:00:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -52,7 +52,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "BKZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -61,7 +61,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "BKZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -73,14 +73,14 @@ var slates = map[string][]Altus{ }, }, }, - "CTZ": []Altus{ - Altus{ + "CTZ": { + { Installed: "2007/12/15,07:00:03", DevCode: "Q33", InstId: "294", Removed: "2008/11/25,01:30:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -89,7 +89,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "CTZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -98,7 +98,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "CTZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -109,13 +109,13 @@ var slates = map[string][]Altus{ }, }, }, - Altus{ + { Installed: "2008/11/25,02:01:00", DevCode: "Q33", InstId: "294", Removed: "2008/11/26,00:00:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -124,7 +124,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "CTZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -133,7 +133,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "CTZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -144,13 +144,13 @@ var slates = map[string][]Altus{ }, }, }, - Altus{ + { Installed: "2008/11/26,00:00:01", DevCode: "Q33", InstId: "299", Removed: "2013/01/14,00:00:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -159,7 +159,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "CTZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -168,7 +168,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "CTZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -180,14 +180,14 @@ var slates = map[string][]Altus{ }, }, }, - "DCZ": []Altus{ - Altus{ + "DCZ": { + { Installed: "2012/07/19,00:00:01", DevCode: "Q33", InstId: "330", Removed: "2015/10/22,00:00:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -196,7 +196,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "DCZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -205,7 +205,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "DCZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -218,14 +218,14 @@ var slates = map[string][]Altus{ }, }, - "DSZ": []Altus{ - Altus{ + "DSZ": { + { Installed: "2013/07/22,08:00:01", DevCode: "Q33", InstId: "382", Removed: "2016/02/26,11:10:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -234,7 +234,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "DSZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -243,7 +243,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "DSZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -254,13 +254,13 @@ var slates = map[string][]Altus{ }, }, }, - Altus{ + { Installed: "2015/12/11,13:00:01", DevCode: "Q33", InstId: "332", Removed: "2016/11/09,08:00:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -269,7 +269,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "DSZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -278,7 +278,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "DSZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -291,15 +291,15 @@ var slates = map[string][]Altus{ }, }, - "HAZ": []Altus{ - Altus{ + "HAZ": { + { Installed: "2010/01/14,10:05:00", DevCode: "Q33", InstId: "286", Removed: "2013/01/11,00:00:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -308,7 +308,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "HAZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -317,7 +317,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "HAZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -328,14 +328,14 @@ var slates = map[string][]Altus{ }, }, }, - Altus{ + { Installed: "2013/01/11,00:00:01", DevCode: "Q33", InstId: "391", Removed: "2016/01/14,09:20:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -344,7 +344,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "HAZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -353,7 +353,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "HAZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -366,15 +366,15 @@ var slates = map[string][]Altus{ }, }, - "HIZ": []Altus{ - Altus{ + "HIZ": { + { Installed: "2016/01/25,00:00:01", DevCode: "Q33", InstId: "330", Removed: "9999/01/01,00:00:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -383,7 +383,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "HIZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -392,7 +392,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "HIZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -405,15 +405,15 @@ var slates = map[string][]Altus{ }, }, - "KNZ": []Altus{ - Altus{ + "KNZ": { + { Installed: "2009/04/27,03:30:01", DevCode: "Q33", InstId: "146", Removed: "2015/12/07,21:00:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -422,7 +422,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "KNZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -431,7 +431,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "KNZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -442,14 +442,14 @@ var slates = map[string][]Altus{ }, }, }, - Altus{ + { Installed: "2015/12/07,21:00:01", DevCode: "Q33", InstId: "303", Removed: "9999/01/01,00:00:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -458,7 +458,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "KNZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -467,7 +467,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "KNZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -480,15 +480,15 @@ var slates = map[string][]Altus{ }, }, - "KHZ": []Altus{ - Altus{ + "KHZ": { + { Installed: "2011/02/23,04:00:01", DevCode: "Q33", InstId: "285", Removed: "2013/01/16,22:00:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -497,7 +497,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "KHZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -506,7 +506,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "KHZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -517,14 +517,14 @@ var slates = map[string][]Altus{ }, }, }, - Altus{ + { Installed: "2014/01/17,01:00:01", DevCode: "Q33", InstId: "285", Removed: "2016/01/29,13:25:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -533,7 +533,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "KHZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -542,7 +542,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "KHZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -553,14 +553,14 @@ var slates = map[string][]Altus{ }, }, }, - Altus{ + { Installed: "2016/02/26,11:10:01", DevCode: "Q33", InstId: "287", Removed: "9999/01/01,00:00:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -569,7 +569,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "KHZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -578,7 +578,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "KHZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -591,15 +591,15 @@ var slates = map[string][]Altus{ }, }, - "KUZ": []Altus{ - Altus{ + "KUZ": { + { Installed: "2016/02/26,11:10:01", DevCode: "Q33", InstId: "382", Removed: "9999/01/01,00:00:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -608,7 +608,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "KUZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -617,7 +617,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "KUZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -630,15 +630,15 @@ var slates = map[string][]Altus{ }, }, - "MSZ": []Altus{ - Altus{ + "MSZ": { + { Installed: "2013/03/26,00:00:01", DevCode: "Q33", InstId: "367", Removed: "2016/04/19,23:00:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -647,7 +647,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "MSZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -656,7 +656,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "MSZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -667,14 +667,14 @@ var slates = map[string][]Altus{ }, }, }, - Altus{ + { Installed: "2016/04/19,23:00:01", DevCode: "Q33", InstId: "299", Removed: "9999/01/01,00:00:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -683,7 +683,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "MSZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -692,7 +692,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "MSZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -705,15 +705,15 @@ var slates = map[string][]Altus{ }, }, - "ODZ": []Altus{ - Altus{ + "ODZ": { + { Installed: "2008/07/22,02:20:01", DevCode: "Q33", InstId: "287", Removed: "2015/10/21,14:25:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -722,7 +722,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "ODZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -731,7 +731,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "ODZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -742,14 +742,14 @@ var slates = map[string][]Altus{ }, }, }, - Altus{ + { Installed: "2015/10/21,14:25:01", DevCode: "Q33", InstId: "292", Removed: "9999/01/01,00:00:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -758,7 +758,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "ODZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -767,7 +767,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "ODZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -780,15 +780,15 @@ var slates = map[string][]Altus{ }, }, - "PYZ": []Altus{ - Altus{ + "PYZ": { + { Installed: "2009/07/25,00:30:01", DevCode: "Q33", InstId: "302", Removed: "2009/09/15,01:35:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -797,7 +797,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "PYZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -806,7 +806,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "PYZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -817,14 +817,14 @@ var slates = map[string][]Altus{ }, }, }, - Altus{ + { Installed: "2009/09/15,01:50:01", DevCode: "Q33", InstId: "303", Removed: "2014/11/25,00:00:10", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -833,7 +833,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "PYZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -842,7 +842,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "PYZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -853,14 +853,14 @@ var slates = map[string][]Altus{ }, }, }, - Altus{ + { Installed: "2014/11/25,00:00:11", DevCode: "Q33", InstId: "286", Removed: "2016/04/19,02:15:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -869,7 +869,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "PYZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -878,7 +878,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "PYZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -889,14 +889,14 @@ var slates = map[string][]Altus{ }, }, }, - Altus{ + { Installed: "2016/04/19,02:15:01", DevCode: "Q33", InstId: "294", Removed: "2017/01/19,21:30:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -905,7 +905,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "PYZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -914,7 +914,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "PYZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -926,15 +926,15 @@ var slates = map[string][]Altus{ }, }, }, - "RIZ": []Altus{ - Altus{ + "RIZ": { + { Installed: "2009/05/18,01:00:00", DevCode: "Q33", InstId: "300", Removed: "2015/12/18,00:00:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -943,7 +943,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "RIZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -952,7 +952,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "RIZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -963,14 +963,14 @@ var slates = map[string][]Altus{ }, }, }, - Altus{ + { Installed: "2015/12/18,00:00:01", DevCode: "Q33", InstId: "302", Removed: "2016/09/17,13:00:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -979,7 +979,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "RIZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -988,7 +988,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "RIZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -1001,15 +1001,15 @@ var slates = map[string][]Altus{ }, }, - "SYZ": []Altus{ - Altus{ + "SYZ": { + { Installed: "2012/08/02,00:00:01", DevCode: "Q33", InstId: "332", Removed: "2015/10/27,01:00:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -1018,7 +1018,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "SYZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -1027,7 +1027,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "SYZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -1038,14 +1038,14 @@ var slates = map[string][]Altus{ }, }, }, - Altus{ + { Installed: "2015/10/27,01:00:01", DevCode: "Q33", InstId: "304", Removed: "9999/01/01,00:00:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -1054,7 +1054,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "SYZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -1063,7 +1063,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "SYZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -1076,15 +1076,15 @@ var slates = map[string][]Altus{ }, }, - "OUZ": []Altus{ - Altus{ + "OUZ": { + { Installed: "2010/02/24,00:00:01", DevCode: "Q33", InstId: "284", Removed: "2016/03/14,01:15:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -1093,7 +1093,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "OUZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -1102,7 +1102,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "OUZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -1114,14 +1114,14 @@ var slates = map[string][]Altus{ }, }, }, - "WCZ": []Altus{ - Altus{ + "WCZ": { + { Installed: "2016/02/16,00:00:01", DevCode: "Q33", InstId: "297", Removed: "2017/02/22,03:00:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -1130,7 +1130,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "WCZ/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -1139,7 +1139,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "WCZ/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -1151,14 +1151,14 @@ var slates = map[string][]Altus{ }, }, }, - "WEL": []Altus{ - Altus{ + "WEL": { + { Installed: "2013/08/13,22:00:01", DevCode: "Q33", InstId: "299", Removed: "2016/03/14,01:15:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -1167,7 +1167,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "WEL/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -1176,7 +1176,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "WEL/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -1187,13 +1187,13 @@ var slates = map[string][]Altus{ }, }, }, - Altus{ + { Installed: "2014/11/03,02:05:01", DevCode: "Q33", InstId: "299", Removed: "2015/03/24,00:00:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -1202,7 +1202,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "WEL/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -1211,7 +1211,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "WEL/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", @@ -1222,13 +1222,13 @@ var slates = map[string][]Altus{ }, }, }, - Altus{ + { Installed: "2016/03/14,01:15:01", DevCode: "Q33", InstId: "284", Removed: "2016/12/19,21:00:00", Pins: []Pin{ - Pin{ + { PinNo: 0, Azimuth: "0.0", Dip: "-90.0", @@ -1237,7 +1237,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "WEL/20-HNZ/NZ", }, - Pin{ + { PinNo: 1, Azimuth: "0.0", Dip: "0.0", @@ -1246,7 +1246,7 @@ var slates = map[string][]Altus{ SeisCode: "EPI", StreamId: "WEL/20-HNN/NZ", }, - Pin{ + { PinNo: 2, Azimuth: "90.0", Dip: "0.0", diff --git a/tools/amplitude/build.go b/tools/amplitude/build.go index 117d330ff..16f58d1fb 100644 --- a/tools/amplitude/build.go +++ b/tools/amplitude/build.go @@ -90,7 +90,7 @@ func buildAmplitudes(cfgs map[string]Config, base, dir string) ([]Amplitude, err var amplitudes []Amplitude var keys []string - for key, _ := range cfgs { + for key := range cfgs { keys = append(keys, key) } sort.Strings(keys) @@ -177,7 +177,7 @@ func buildAmplitudes(cfgs map[string]Config, base, dir string) ([]Amplitude, err } lookup := response.Channels(stream.Axial) - for pin, _ := range response.Components { + for pin := range response.Components { if !(pin < len(lookup)) { continue } @@ -257,7 +257,7 @@ func buildAmplitudes(cfgs map[string]Config, base, dir string) ([]Amplitude, err Step: cfg.Step, Daemon: cfg.Daemon, Stations: []Station{ - Station{ + { StationId: station.Code, NetworkId: network.External, Name: station.Name, @@ -280,7 +280,7 @@ func buildAmplitudes(cfgs map[string]Config, base, dir string) ([]Amplitude, err Step: cfg.Step, Daemon: cfg.Daemon, Stations: []Station{ - Station{ + { StationId: extra.StationId, NetworkId: extra.NetworkId, Name: extra.Name, diff --git a/tools/chart/combined-medium.go b/tools/chart/combined-medium.go index 337094459..9c7c60540 100644 --- a/tools/chart/combined-medium.go +++ b/tools/chart/combined-medium.go @@ -72,7 +72,7 @@ func (cp ConfigPage) CombinedMedium(base string) ([]Page, error) { Width: "400", Png: cp.Png(StationChannel(s, c), "/volcano/drums/latest/m-%s-seismic-combined.png"), Plots: []Plot{ - Plot{ + { Id: "rsam", Clip: "1", Height: "125", @@ -82,7 +82,7 @@ func (cp ConfigPage) CombinedMedium(base string) ([]Page, error) { X: "4", Y: "14", Streams: []Stream{ - Stream{ + { Auto: "yes", Colour: "#000000a0", Format: "amplitude", @@ -121,7 +121,7 @@ func (cp ConfigPage) CombinedMedium(base string) ([]Page, error) { Pen: "2", }, }, - Plot{ + { Id: "ssam", Clip: "1", Height: "125", @@ -131,7 +131,7 @@ func (cp ConfigPage) CombinedMedium(base string) ([]Page, error) { X: "4", Y: "151", Streams: []Stream{ - Stream{ + { Auto: "yes", Colour: "#000000a0", Equalise: "no", @@ -160,7 +160,7 @@ func (cp ConfigPage) CombinedMedium(base string) ([]Page, error) { Width: "400", Png: cp.Png(s, "/volcano/drums/latest/m-%s-seismic-combined.png"), Plots: []Plot{ - Plot{ + { Id: "rsam", Clip: "1", Height: "125", @@ -170,7 +170,7 @@ func (cp ConfigPage) CombinedMedium(base string) ([]Page, error) { X: "4", Y: "14", Streams: []Stream{ - Stream{ + { Auto: "yes", Colour: "#000000a0", Format: "amplitude", @@ -209,7 +209,7 @@ func (cp ConfigPage) CombinedMedium(base string) ([]Page, error) { Pen: "2", }, }, - Plot{ + { Id: "ssam", Clip: "1", Height: "125", @@ -219,7 +219,7 @@ func (cp ConfigPage) CombinedMedium(base string) ([]Page, error) { X: "4", Y: "151", Streams: []Stream{ - Stream{ + { Auto: "yes", Colour: "#000000a0", Equalise: "no", diff --git a/tools/chart/combined.go b/tools/chart/combined.go index 8d6ad4cd3..186836fee 100644 --- a/tools/chart/combined.go +++ b/tools/chart/combined.go @@ -72,7 +72,7 @@ func (cp ConfigPage) Combined(base string) ([]Page, error) { Width: "750", Png: cp.Png(StationChannel(s, c), "/volcano/drums/latest/%s-seismic-combined.png"), Plots: []Plot{ - Plot{ + { Id: "dummy", Height: "220", Length: "35 days", @@ -80,7 +80,7 @@ func (cp ConfigPage) Combined(base string) ([]Page, error) { X: "40", Y: "260", Streams: []Stream{ - Stream{ + { Rrd: cp.Rrd(StationChannel(s, c), ""), }, }, @@ -92,7 +92,7 @@ func (cp ConfigPage) Combined(base string) ([]Page, error) { Time: "end", }, }, - Plot{ + { Id: "rsam", Clip: "1", Height: "220", @@ -102,7 +102,7 @@ func (cp ConfigPage) Combined(base string) ([]Page, error) { X: "40", Y: "20", Streams: []Stream{ - Stream{ + { Auto: "yes", Colour: "#000000a0", Format: "amplitude", @@ -158,7 +158,7 @@ func (cp ConfigPage) Combined(base string) ([]Page, error) { Pen: "2", }, }, - Plot{ + { Id: "ssam", Clip: "1", Height: "220", @@ -168,7 +168,7 @@ func (cp ConfigPage) Combined(base string) ([]Page, error) { X: "40", Y: "260", Streams: []Stream{ - Stream{ + { Auto: "yes", Colour: "#000000a0", Equalise: "no", @@ -261,7 +261,7 @@ func (cp ConfigPage) Combined(base string) ([]Page, error) { Width: "750", Png: cp.Png(s, "/volcano/drums/latest/%s-seismic-combined.png"), Plots: []Plot{ - Plot{ + { Id: "dummy", Height: "220", Length: "35 days", @@ -269,7 +269,7 @@ func (cp ConfigPage) Combined(base string) ([]Page, error) { X: "40", Y: "260", Streams: []Stream{ - Stream{ + { Rrd: cp.Rrd(s, ""), }, }, @@ -281,7 +281,7 @@ func (cp ConfigPage) Combined(base string) ([]Page, error) { Time: "end", }, }, - Plot{ + { Id: "rsam", Clip: "1", Height: "220", @@ -291,7 +291,7 @@ func (cp ConfigPage) Combined(base string) ([]Page, error) { X: "40", Y: "20", Streams: []Stream{ - Stream{ + { Auto: "yes", Colour: "#000000a0", Format: "amplitude", @@ -347,7 +347,7 @@ func (cp ConfigPage) Combined(base string) ([]Page, error) { Pen: "2", }, }, - Plot{ + { Id: "ssam", Clip: "1", Height: "220", @@ -357,7 +357,7 @@ func (cp ConfigPage) Combined(base string) ([]Page, error) { X: "40", Y: "260", Streams: []Stream{ - Stream{ + { Auto: "yes", Colour: "#000000a0", Equalise: "no", diff --git a/tools/chart/depth.go b/tools/chart/depth.go index 55fd0fc8a..f17c08180 100644 --- a/tools/chart/depth.go +++ b/tools/chart/depth.go @@ -65,7 +65,7 @@ func (cp ConfigPage) Depth(base string) ([]Page, error) { Width: "760", Png: cp.Png(StationChannel(s, c), "/volcano/%n/%s/%l/drum.png"), Plots: []Plot{ - Plot{ + { Id: "rsam", Clip: "1", Height: "440", @@ -74,7 +74,7 @@ func (cp ConfigPage) Depth(base string) ([]Page, error) { Width: "700", X: "40", Streams: []Stream{ - Stream{ + { Auto: "no", Colour: "#000000a0", Format: "amplitude", diff --git a/tools/chart/drum-small.go b/tools/chart/drum-small.go index b700f8a3c..39957cbf6 100644 --- a/tools/chart/drum-small.go +++ b/tools/chart/drum-small.go @@ -89,7 +89,7 @@ func (cp ConfigPage) DrumSmall(base string) ([]Page, error) { Width: "400", Png: cp.Png(StationChannel(s, c), "/earthquake/drums/latest/%s-seismic-drum.png"), Plots: []Plot{ - Plot{ + { Id: cp.Id(StationChannel(s, c), "%t-%n-%s-%l-s-drum"), Clip: "5", Height: "242", @@ -100,7 +100,7 @@ func (cp ConfigPage) DrumSmall(base string) ([]Page, error) { Y: "21", Missing: "Not operational", Streams: []Stream{ - Stream{ + { Alt: "137 104 205", Colour: "25 25 112", Format: "amplitude", @@ -125,13 +125,13 @@ func (cp ConfigPage) DrumSmall(base string) ([]Page, error) { String: s.Name, }, XGrids: []XGrid{ - XGrid{ + { Colour: "143 188 143", IsDate: "yes", Pen: "0.5", Step: "180", }, - XGrid{ + { Colour: "32 178 170", IsDate: "yes", Pen: "0.5", @@ -161,7 +161,7 @@ func (cp ConfigPage) DrumSmall(base string) ([]Page, error) { Width: "400", Png: cp.Png(s, "/earthquake/drums/latest/%s-seismic-drum.png"), Plots: []Plot{ - Plot{ + { Id: cp.Id(s, "%t-%n-%s-%l-s-drum"), Clip: "5", Height: "242", @@ -172,7 +172,7 @@ func (cp ConfigPage) DrumSmall(base string) ([]Page, error) { Y: "21", Missing: "Not operational", Streams: []Stream{ - Stream{ + { Alt: "137 104 205", Colour: "25 25 112", Font: "LiberationSans Bold 10", @@ -197,13 +197,13 @@ func (cp ConfigPage) DrumSmall(base string) ([]Page, error) { String: s.Title, }, XGrids: []XGrid{ - XGrid{ + { Colour: "143 188 143", IsDate: "yes", Pen: "0.5", Step: "180", }, - XGrid{ + { Colour: "32 178 170", IsDate: "yes", Pen: "0.5", diff --git a/tools/chart/drum.go b/tools/chart/drum.go index addbf5b77..90f7346a2 100644 --- a/tools/chart/drum.go +++ b/tools/chart/drum.go @@ -95,7 +95,7 @@ func (cp ConfigPage) Drum(base string) ([]Page, error) { Width: "760", Png: cp.Png(StationChannel(s, c), "/earthquake/drums/latest/%s-seismic-drum.png"), Plots: []Plot{ - Plot{ + { Id: cp.Id(StationChannel(s, c), "%t-%n-%s-%l-drum"), Clip: "5", Height: "440", @@ -104,7 +104,7 @@ func (cp ConfigPage) Drum(base string) ([]Page, error) { Width: "700", X: "40", Streams: []Stream{ - Stream{ + { Alt: "137 104 205", Auto: cp.Auto(StationChannel(s, c)), Gain: cp.Gain(StationChannel(s, c)), @@ -141,13 +141,13 @@ func (cp ConfigPage) Drum(base string) ([]Page, error) { String: s.Name, }, XGrids: []XGrid{ - XGrid{ + { Colour: "143 188 143", IsDate: "yes", Pen: "0.5", Step: "60", }, - XGrid{ + { Colour: "32 178 170", IsDate: "yes", Pen: "0.5", @@ -195,7 +195,7 @@ func (cp ConfigPage) Drum(base string) ([]Page, error) { Width: "760", Png: cp.Png(s, "/earthquake/drums/latest/%s-seismic-drum.png"), Plots: []Plot{ - Plot{ + { Id: cp.Id(s, "%t-%n-%s-%l-drum"), Clip: "5", Height: "440", @@ -204,7 +204,7 @@ func (cp ConfigPage) Drum(base string) ([]Page, error) { Width: "700", X: "40", Streams: []Stream{ - Stream{ + { Alt: "137 104 205", Auto: cp.Auto(s), Gain: cp.Gain(s), @@ -241,13 +241,13 @@ func (cp ConfigPage) Drum(base string) ([]Page, error) { String: s.Title, }, XGrids: []XGrid{ - XGrid{ + { Colour: "143 188 143", IsDate: "yes", Pen: "0.5", Step: "60", }, - XGrid{ + { Colour: "32 178 170", IsDate: "yes", Pen: "0.5", diff --git a/tools/chart/gauge.go b/tools/chart/gauge.go index 9b684f2b5..16cd1016e 100644 --- a/tools/chart/gauge.go +++ b/tools/chart/gauge.go @@ -86,7 +86,7 @@ func (cp ConfigPage) Gauge(base string) ([]Page, error) { Id: cp.Id(OptionStream{Network: net}, "pressure-gauge-gauge-%n"), Png: cp.Png(OptionStream{Network: net}, "/volcano/%n/gauge.png"), Plots: []Plot{ - Plot{ + { Id: "gauge", Clip: "100", Length: "48 hours", diff --git a/tools/chart/networks.go b/tools/chart/networks.go index b227c7d69..d54b282db 100644 --- a/tools/chart/networks.go +++ b/tools/chart/networks.go @@ -75,7 +75,7 @@ func (cp ConfigPage) Networks(base string) ([]Page, error) { Rrd: cp.Rrd(StationChannel(s, c), "amplitude/rsam/%s.%n/%s.%l-%c.%n.rrd"), Style: "rsam", Tags: []Tag{ - Tag{ + { Aligned: "right", Box: "#ffffffd0", Colour: "#006400", @@ -83,7 +83,7 @@ func (cp ConfigPage) Networks(base string) ([]Page, error) { String: s.Name, XOffset: "-720", }, - Tag{ + { Aligned: "left", Colour: "#006400", Font: "LiberationSans Bold 10", @@ -100,7 +100,7 @@ func (cp ConfigPage) Networks(base string) ([]Page, error) { Height: strconv.Itoa(len(streams)*40 + 70), Png: cp.Png(OptionStream{Network: net}, "/volcano/%n/rsam.png"), Plots: []Plot{ - Plot{ + { Id: "rsam", Clip: "1", Height: strconv.Itoa(len(streams) * 40), @@ -139,16 +139,16 @@ func (cp ConfigPage) Networks(base string) ([]Page, error) { Font: "LiberationSans Narrow 9", }, Dates: []Date{ - Date{ + { Font: "LiberationSans Narrow Bold 14", }, - Date{ + { Aligned: "bottom", Font: "LiberationSans Narrow Bold 14", String: "%b %d, %Y", Time: "start", }, - Date{ + { Aligned: "bottom", Font: "LiberationSans Narrow Bold 14", String: "%b %d, %Y", @@ -218,7 +218,7 @@ func (cp ConfigPage) Networks(base string) ([]Page, error) { Rrd: cp.Rrd(StationChannel(s, c), "spectra/ssam/%s.%n/%s.%l-%c.%n.rrd"), Style: "ssam", Tags: []Tag{ - Tag{ + { Aligned: "right", Box: "#ffffffd0", Colour: "#006400", @@ -226,7 +226,7 @@ func (cp ConfigPage) Networks(base string) ([]Page, error) { String: s.Name, XOffset: "-720", }, - Tag{ + { Aligned: "left", Colour: "#006400", Font: "LiberationSans Bold 10", @@ -243,7 +243,7 @@ func (cp ConfigPage) Networks(base string) ([]Page, error) { Height: strconv.Itoa(len(streams)*40 + 70), Png: cp.Png(OptionStream{Network: net}, "/volcano/%n/ssam.png"), Plots: []Plot{ - Plot{ + { Id: "ssam", Clip: "1", Height: strconv.Itoa(len(streams) * 40), @@ -277,16 +277,16 @@ func (cp ConfigPage) Networks(base string) ([]Page, error) { Font: "LiberationSans Narrow 9", }, Dates: []Date{ - Date{ + { Font: "LiberationSans Narrow Bold 14", }, - Date{ + { Aligned: "bottom", Font: "LiberationSans Narrow Bold 14", String: "%b %d, %Y", Time: "start", }, - Date{ + { Aligned: "bottom", Font: "LiberationSans Narrow Bold 14", String: "%b %d, %Y", @@ -353,7 +353,7 @@ func (cp ConfigPage) Networks(base string) ([]Page, error) { Rrd: cp.Rrd(StationChannel(s, c), "spectra/ssam/%s.%n/%s.%l-%c.%n.rrd"), Style: "tremor", Tags: []Tag{ - Tag{ + { Aligned: "right", Box: "#ffffffd0", Colour: "#006400", @@ -361,7 +361,7 @@ func (cp ConfigPage) Networks(base string) ([]Page, error) { String: s.Name, XOffset: "-720", }, - Tag{ + { Aligned: "left", Colour: "#006400", Font: "LiberationSans Bold 10", @@ -378,7 +378,7 @@ func (cp ConfigPage) Networks(base string) ([]Page, error) { Height: strconv.Itoa(len(streams)*40 + 70), Png: cp.Png(OptionStream{Network: net}, "/volcano/%n/tremor.png"), Plots: []Plot{ - Plot{ + { Id: "tremor", Clip: "1", Height: strconv.Itoa(len(streams) * 40), @@ -417,16 +417,16 @@ func (cp ConfigPage) Networks(base string) ([]Page, error) { Font: "LiberationSans Narrow 9", }, Dates: []Date{ - Date{ + { Font: "LiberationSans Narrow Bold 14", }, - Date{ + { Aligned: "bottom", Font: "LiberationSans Narrow Bold 14", String: "%b %d, %Y", Time: "start", }, - Date{ + { Aligned: "bottom", Font: "LiberationSans Narrow Bold 14", String: "%b %d, %Y", diff --git a/tools/chart/temperatue.go b/tools/chart/temperatue.go index 60ff003c8..36914c0a5 100644 --- a/tools/chart/temperatue.go +++ b/tools/chart/temperatue.go @@ -15,7 +15,7 @@ func (cp ConfigPage) Temperature(base string) ([]Page, error) { Width: "770", Png: cp.Png(s, "/volcano/%n/%s/%l/drum.png"), Plots: []Plot{ - Plot{ + { Id: "rsam", Clip: "1", Height: "440", @@ -24,7 +24,7 @@ func (cp ConfigPage) Temperature(base string) ([]Page, error) { Width: "700", X: "40", Streams: []Stream{ - Stream{ + { Auto: "false", Gain: "50.0", Colour: "#000000a0", diff --git a/tools/chart/trace.go b/tools/chart/trace.go index 5772548cf..568f3356a 100644 --- a/tools/chart/trace.go +++ b/tools/chart/trace.go @@ -64,7 +64,7 @@ func (cp ConfigPage) Trace(base string) ([]Page, error) { Rrd: cp.Rrd(StationChannel(s, c), "amplitude/drum/%s.%n/%s.%l-%c.%n.rrd"), Style: "trace", Tags: []Tag{ - Tag{ + { Aligned: "right", Box: "#ffffffe0", Colour: "#000000", @@ -72,7 +72,7 @@ func (cp ConfigPage) Trace(base string) ([]Page, error) { String: s.Name, XOffset: "-720", }, - Tag{ + { Aligned: "left", Colour: "#000000", Font: "LiberationSans Bold 7", @@ -89,7 +89,7 @@ func (cp ConfigPage) Trace(base string) ([]Page, error) { Width: "800", Png: cp.Png(OptionStream{}, "/earthquake/drums/latest/national-%a-trace.png"), Plots: []Plot{ - Plot{ + { Id: "drum", Clip: "2", Height: "670", diff --git a/tools/chart/traces.go b/tools/chart/traces.go index 08c53f4cb..c22a30aa2 100644 --- a/tools/chart/traces.go +++ b/tools/chart/traces.go @@ -70,7 +70,7 @@ func (cp ConfigPage) Traces(base string) ([]Page, error) { Rrd: cp.Rrd(StationChannel(s, c), "amplitude/drum/%s.%n/%s.%l-%c.%n.rrd"), Style: "trace", Tags: []Tag{ - Tag{ + { Aligned: "right", Box: "#ffffffe0", Colour: "#006400", @@ -78,7 +78,7 @@ func (cp ConfigPage) Traces(base string) ([]Page, error) { String: s.Name, XOffset: "-720", }, - Tag{ + { Aligned: "left", Colour: "#006400", Font: "LiberationSans Bold 10", @@ -95,7 +95,7 @@ func (cp ConfigPage) Traces(base string) ([]Page, error) { Height: strconv.Itoa(len(streams)*20 + 80), Png: cp.Png(OptionStream{Network: net}, "/volcano/%n/%x.png"), Plots: []Plot{ - Plot{ + { Id: "trace", Clip: "1", Height: strconv.Itoa(len(streams) * 20), diff --git a/tools/gloria/main.go b/tools/gloria/main.go index 3b596a266..c97dca42b 100644 --- a/tools/gloria/main.go +++ b/tools/gloria/main.go @@ -3,8 +3,8 @@ package main import ( "flag" "fmt" - "github.com/GeoNet/kit/gloria_pb" "github.com/GeoNet/delta/meta" + "github.com/GeoNet/kit/gloria_pb" "github.com/golang/protobuf/proto" "io/ioutil" "os" @@ -58,8 +58,8 @@ func main() { firmwareHistory[i.Model][i.Serial] = append(firmwareHistory[i.Model][i.Serial], i) } - for j, _ := range firmwareHistory { - for k, _ := range firmwareHistory[j] { + for j := range firmwareHistory { + for k := range firmwareHistory[j] { sort.Sort(meta.FirmwareHistoryList(firmwareHistory[j][k])) } } @@ -74,7 +74,7 @@ func main() { for _, i := range installedAntennaList { installedAntenna[i.Mark] = append(installedAntenna[i.Mark], i) } - for i, _ := range installedAntenna { + for i := range installedAntenna { sort.Sort(sort.Reverse(meta.InstalledAntennaList(installedAntenna[i]))) } @@ -88,7 +88,7 @@ func main() { for _, i := range deployedReceiverList { deployedReceivers[i.Mark] = append(deployedReceivers[i.Mark], i) } - for i, _ := range deployedReceivers { + for i := range deployedReceivers { sort.Sort(sort.Reverse(meta.DeployedReceiverList(deployedReceivers[i]))) } @@ -102,7 +102,7 @@ func main() { for _, i := range installedRadomeList { installedRadomes[i.Mark] = append(installedRadomes[i.Mark], i) } - for i, _ := range installedRadomes { + for i := range installedRadomes { sort.Sort(meta.InstalledRadomeList(installedRadomes[i])) } diff --git a/tools/impact/build.go b/tools/impact/build.go index 1cf798014..5b130755a 100644 --- a/tools/impact/build.go +++ b/tools/impact/build.go @@ -112,7 +112,7 @@ func buildStreams(base, channels string) (map[string]Stream, error) { } return stream.Axial }()) - for pin, _ := range response.Components { + for pin := range response.Components { if !(pin < len(lookup)) { continue } diff --git a/tools/pod/blockette.go b/tools/pod/blockette.go index 39112a835..2b9d2cc16 100644 --- a/tools/pod/blockette.go +++ b/tools/pod/blockette.go @@ -514,7 +514,7 @@ func (r FIRResponse) String() string { len(r.Coefficients), func() string { var c []string - for i, _ := range r.Coefficients { + for i := range r.Coefficients { if r.SymmetryCode == "A" { //c = append(c, fmt.Sprintf("%+14.7E", r.Coefficients[len(r.Coefficients)-i-1])) c = append(c, fmt.Sprintf("%+14.7E", r.Coefficients[i])) diff --git a/tools/pod/main.go b/tools/pod/main.go index 7f432bc52..43d3f3cfc 100644 --- a/tools/pod/main.go +++ b/tools/pod/main.go @@ -60,7 +60,7 @@ func main() { log.Fatalf("unable to decode StationXML file: %s [%v]", f, err) } - for i, _ := range s.Networks { + for i := range s.Networks { if err := pod.Network(&s.Networks[i]); err != nil { log.Fatalf("unable to build POD files: [%v]", err) } diff --git a/tools/pod/pod.go b/tools/pod/pod.go index 151ef43e8..a11ba06f7 100644 --- a/tools/pod/pod.go +++ b/tools/pod/pod.go @@ -80,7 +80,7 @@ func (p *Pod) Header() error { } func (p *Pod) Network(net *stationxml.Network) error { - for i, _ := range net.Stations { + for i := range net.Stations { if err := p.Station(net, &net.Stations[i]); err != nil { return err } @@ -152,7 +152,7 @@ func (p *Pod) Station(net *stationxml.Network, sta *stationxml.Station) error { } var channels []*stationxml.Channel - for i, _ := range sta.Channels { + for i := range sta.Channels { channels = append(channels, &sta.Channels[i]) } diff --git a/tools/rinexml/main.go b/tools/rinexml/main.go index 4f150045b..19f39b507 100644 --- a/tools/rinexml/main.go +++ b/tools/rinexml/main.go @@ -49,7 +49,7 @@ var HeaderComments map[string]string = map[string]string{ } var DownloadNameFormats map[string]DownloadNameFormatXML = map[string]DownloadNameFormatXML{ - "x4": DownloadNameFormatXML{ + "x4": { Type: "long", Year: "x4 A4 x*", Month: "x8 A2 x*", @@ -58,7 +58,7 @@ var DownloadNameFormats map[string]DownloadNameFormatXML = map[string]DownloadNa Minute: "x14 A2 x*", Second: "x16 A2 x*", }, - "x5": DownloadNameFormatXML{ + "x5": { Type: "long", Year: "x5 A4 x*", Month: "x9 A2 x*", @@ -67,12 +67,12 @@ var DownloadNameFormats map[string]DownloadNameFormatXML = map[string]DownloadNa Minute: "x16 A2 x*", Second: "x18 A2 x*", }, - "x6": DownloadNameFormatXML{ + "x6": { Type: "short", Year: "x6 A2", YearDay: "x9 A3", }, - "x15": DownloadNameFormatXML{ + "x15": { Type: "long", Year: "x15 A4 x*", Month: "x20 A2 x*", @@ -81,7 +81,7 @@ var DownloadNameFormats map[string]DownloadNameFormatXML = map[string]DownloadNa Minute: "x28 A2 x*", Second: "x30 A2 x*", }, - "x17": DownloadNameFormatXML{ + "x17": { Type: "long", Year: "x17 A4 x*", Month: "x22 A2 x*", @@ -90,7 +90,7 @@ var DownloadNameFormats map[string]DownloadNameFormatXML = map[string]DownloadNa Minute: "x30 A2 x*", Second: "x32 A2 x*", }, - "x18": DownloadNameFormatXML{ + "x18": { Type: "long", Year: "x18 A4 x*", Month: "x23 A2 x*", @@ -99,7 +99,7 @@ var DownloadNameFormats map[string]DownloadNameFormatXML = map[string]DownloadNa Minute: "x31 A2 x*", Second: "x33 A2 x*", }, - "x19": DownloadNameFormatXML{ + "x19": { Type: "long", Year: "x19 A4 x*", Month: "x24 A2 x*", @@ -108,7 +108,7 @@ var DownloadNameFormats map[string]DownloadNameFormatXML = map[string]DownloadNa Minute: "x32 A2 x*", Second: "x34 A2 x*", }, - "x21": DownloadNameFormatXML{ + "x21": { Type: "long", Year: "x21 A4 x*", Month: "x26 A2 x*", @@ -175,8 +175,8 @@ func main() { firmwareHistory[i.Model][i.Serial] = append(firmwareHistory[i.Model][i.Serial], i) } - for j, _ := range firmwareHistory { - for k, _ := range firmwareHistory[j] { + for j := range firmwareHistory { + for k := range firmwareHistory[j] { sort.Sort(meta.FirmwareHistoryList(firmwareHistory[j][k])) } } @@ -191,7 +191,7 @@ func main() { for _, i := range installedAntennaList { installedAntenna[i.Mark] = append(installedAntenna[i.Mark], i) } - for i, _ := range installedAntenna { + for i := range installedAntenna { sort.Sort(sort.Reverse(meta.InstalledAntennaList(installedAntenna[i]))) } @@ -205,7 +205,7 @@ func main() { for _, i := range deployedReceiverList { deployedReceivers[i.Mark] = append(deployedReceivers[i.Mark], i) } - for i, _ := range deployedReceivers { + for i := range deployedReceivers { sort.Sort(sort.Reverse(meta.DeployedReceiverList(deployedReceivers[i]))) } @@ -219,7 +219,7 @@ func main() { for _, i := range installedRadomeList { installedRadomes[i.Mark] = append(installedRadomes[i.Mark], i) } - for i, _ := range installedRadomes { + for i := range installedRadomes { sort.Sort(meta.InstalledRadomeList(installedRadomes[i])) } @@ -233,7 +233,7 @@ func main() { for _, i := range installedMetSensorList { installedMetSensors[i.Mark] = append(installedMetSensors[i.Mark], i) } - for i, _ := range installedMetSensors { + for i := range installedMetSensors { sort.Sort(meta.InstalledMetSensorList(installedMetSensors[i])) } @@ -326,7 +326,7 @@ func main() { var firmware []FirmwareHistoryXML if _, ok := firmwareHistory[r.Model]; ok { if _, ok := firmwareHistory[r.Model][r.Serial]; ok { - for i, _ := range firmwareHistory[r.Model][r.Serial] { + for i := range firmwareHistory[r.Model][r.Serial] { v := firmwareHistory[r.Model][r.Serial][len(firmwareHistory[r.Model][r.Serial])-i-1] /* if v.End.Before(r.Start) || v.Start.After(r.End) { diff --git a/tools/rinexml/site_test.go b/tools/rinexml/site_test.go index adc1d67d4..2d7eaa762 100644 --- a/tools/rinexml/site_test.go +++ b/tools/rinexml/site_test.go @@ -97,7 +97,7 @@ func TestSiteXML_Marshal(t *testing.T) { Datum: "WGS84", }, Sessions: []CGPSSessionXML{ - CGPSSessionXML{ + { StartTime: "2015-08-31T20:40:01", StopTime: "open", ObservationInterval: Number{ @@ -126,17 +126,17 @@ func TestSiteXML_Marshal(t *testing.T) { SerialNumber: "5307K50971", IGSDesignation: "TRIMBLE NETR9", FirmwareHistories: []FirmwareHistoryXML{ - FirmwareHistoryXML{ + { StartTime: "2015-08-31T20:40:01", StopTime: "open", Version: "4.85", }, - FirmwareHistoryXML{ + { StartTime: "2014-12-16T00:00:01", StopTime: "2015-08-31T20:40:00", Version: "4.82", }, - FirmwareHistoryXML{ + { StartTime: "2014-05-07T00:00:00", StopTime: "2014-12-16T00:00:00", Version: "4.81", diff --git a/tools/sit/main.go b/tools/sit/main.go index c9fafa61c..0bd3e5e09 100644 --- a/tools/sit/main.go +++ b/tools/sit/main.go @@ -99,12 +99,11 @@ func main() { Location: m.Location, Span: &sit_delta_pb.Span{ Start: m.Start.Unix(), - End: m.End.Unix(), + End: m.End.Unix(), }, }) } - //asset files -- All have the same format so just pull them all into a single big map assetFiles := []string{ "antennas.csv", @@ -167,7 +166,7 @@ func main() { AssetNumber: assets[i.Make+i.Model+i.Serial].Number, SerialNumber: i.Serial, Manufacturer: i.Make, - Height: -i.Vertical, + Height: -i.Vertical, }, Installed: &sit_delta_pb.Span{ Start: i.Start.Unix(), @@ -184,9 +183,9 @@ func main() { } connections := make(map[string][]string) for _, c := range connectionList { - //TODO - Do we need to display 'connection' info? + //TODO - Do we need to display 'connection' info? - arr := connections[strings.TrimSpace(c.Place + c.Role)] + arr := connections[strings.TrimSpace(c.Place+c.Role)] found := false for _, s := range arr { if s == c.Station { @@ -206,7 +205,7 @@ func main() { os.Exit(-1) } for _, i := range deployedDataloggerList { - stations := connections[strings.TrimSpace(i.Place + i.Role)] + stations := connections[strings.TrimSpace(i.Place+i.Role)] for _, s := range stations { equipment[s] = append(equipment[s], &sit_delta_pb.Equipment_Install{ Equipment: &sit_delta_pb.Equipment{ @@ -260,7 +259,7 @@ func main() { AssetNumber: assets[i.Make+i.Model+i.Serial].Number, SerialNumber: i.Serial, Manufacturer: i.Make, - Height: -i.Vertical, + Height: -i.Vertical, }, Installed: &sit_delta_pb.Span{ Start: i.Start.Unix(), @@ -332,7 +331,7 @@ func main() { AssetNumber: assets[i.Make+i.Model+i.Serial].Number, SerialNumber: i.Serial, Manufacturer: i.Make, - Height: -i.Vertical, + Height: -i.Vertical, }, Installed: &sit_delta_pb.Span{ Start: i.Start.Unix(), @@ -346,7 +345,6 @@ func main() { } } - for _, m := range markList { im := make([]*sit_delta_pb.InstalledMonument, 0) @@ -361,7 +359,7 @@ func main() { }, Monument: &sit_delta_pb.Monument{ DomesNumber: l.DomesNumber, - Height: l.GroundRelationship, + Height: l.GroundRelationship, }, } im = append(im, &newMonument) @@ -374,9 +372,9 @@ func main() { InstalledMonument: im, Point: &sit_delta_pb.Point{ Longitude: m.Longitude, - Latitude: m.Latitude, + Latitude: m.Latitude, Elevation: m.Elevation, - Datum: m.Datum, + Datum: m.Datum, }, } diff --git a/tools/sitelogs/main.go b/tools/sitelogs/main.go index 3e7ffadc9..f70e547ec 100644 --- a/tools/sitelogs/main.go +++ b/tools/sitelogs/main.go @@ -116,8 +116,8 @@ func main() { firmwareHistory[i.Model][i.Serial] = append(firmwareHistory[i.Model][i.Serial], i) } - for j, _ := range firmwareHistory { - for k, _ := range firmwareHistory[j] { + for j := range firmwareHistory { + for k := range firmwareHistory[j] { sort.Sort(meta.FirmwareHistoryList(firmwareHistory[j][k])) } } @@ -131,7 +131,7 @@ func main() { for _, i := range installedAntennaList { installedAntenna[i.Mark] = append(installedAntenna[i.Mark], i) } - for i, _ := range installedAntenna { + for i := range installedAntenna { sort.Sort(meta.InstalledAntennaList(installedAntenna[i])) } @@ -144,7 +144,7 @@ func main() { for _, i := range deployedReceiverList { deployedReceivers[i.Mark] = append(deployedReceivers[i.Mark], i) } - for i, _ := range deployedReceivers { + for i := range deployedReceivers { sort.Sort(meta.DeployedReceiverList(deployedReceivers[i])) } @@ -157,7 +157,7 @@ func main() { for _, i := range installedRadomeList { installedRadomes[i.Mark] = append(installedRadomes[i.Mark], i) } - for i, _ := range installedRadomes { + for i := range installedRadomes { sort.Sort(meta.InstalledRadomeList(installedRadomes[i])) } @@ -170,7 +170,7 @@ func main() { for _, i := range installedMetSensorList { installedMetSensors[i.Mark] = append(installedMetSensors[i.Mark], i) } - for i, _ := range installedMetSensors { + for i := range installedMetSensors { sort.Sort(meta.InstalledMetSensorList(installedMetSensors[i])) } @@ -292,7 +292,7 @@ func main() { for _, r := range deployedReceivers[m.Code] { if _, ok := firmwareHistory[r.Model]; ok { if _, ok := firmwareHistory[r.Model][r.Serial]; ok { - for i, _ := range firmwareHistory[r.Model][r.Serial] { + for i := range firmwareHistory[r.Model][r.Serial] { v := firmwareHistory[r.Model][r.Serial][len(firmwareHistory[r.Model][r.Serial])-i-1] if v.End.Before(r.Start) || v.Start.After(r.End) { diff --git a/tools/spectra/build.go b/tools/spectra/build.go index d1561b8fe..8a4ba7086 100644 --- a/tools/spectra/build.go +++ b/tools/spectra/build.go @@ -93,7 +93,7 @@ func buildSpectras(cfgs map[string]Config, base, dir string) ([]Spectra, error) var spectras []Spectra var keys []string - for key, _ := range cfgs { + for key := range cfgs { keys = append(keys, key) } sort.Strings(keys) @@ -180,7 +180,7 @@ func buildSpectras(cfgs map[string]Config, base, dir string) ([]Spectra, error) } lookup := response.Channels(stream.Axial) - for pin, _ := range response.Components { + for pin := range response.Components { if !(pin < len(lookup)) { continue } @@ -253,7 +253,7 @@ func buildSpectras(cfgs map[string]Config, base, dir string) ([]Spectra, error) Step: cfg.Step, Daemon: cfg.Daemon, Stations: []Station{ - Station{ + { StationId: station.Code, NetworkId: network.External, Name: station.Name, @@ -276,7 +276,7 @@ func buildSpectras(cfgs map[string]Config, base, dir string) ([]Spectra, error) Step: cfg.Step, Daemon: cfg.Daemon, Stations: []Station{ - Station{ + { StationId: extra.StationId, NetworkId: extra.NetworkId, Name: extra.Name, diff --git a/tools/stationxml/build.go b/tools/stationxml/build.go index c097ee386..1c7cf5942 100644 --- a/tools/stationxml/build.go +++ b/tools/stationxml/build.go @@ -395,7 +395,7 @@ func (b *Builder) Construct(base string) ([]stationxml.Network, error) { } }(), Comments: []stationxml.Comment{ - stationxml.Comment{ + { Id: 1, Value: func() string { switch location.Survey { @@ -414,11 +414,11 @@ func (b *Builder) Construct(base string) ([]stationxml.Network, error) { } }(), }, - stationxml.Comment{ + { Id: 2, Value: "Location is given in " + location.Datum, }, - stationxml.Comment{ + { Id: 3, Value: "Sensor orientation not known", }, @@ -633,7 +633,7 @@ func (b *Builder) Construct(base string) ([]stationxml.Network, error) { StartDate: start, EndDate: end, Comments: []stationxml.Comment{ - stationxml.Comment{ + { Id: 1, Value: "Location is given in " + station.Datum, },