orb_def 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92b075b5b2d2eed643a8bb8d93e51d5b698549a0195e48e9bceb5c66b1c8ecc9
4
- data.tar.gz: f2630ce0ba16ce9b545d30f1f6618f7f5ecd30a07b67756e7c88720f40a99c1d
3
+ metadata.gz: 43db273571726b0a6c3182047428c3ff119102d86bd3169c6f4ad61b32b758dd
4
+ data.tar.gz: 8e263d2142fc74bfb1741131b573cd2f4deddcce665f055f84806f164d97dfeb
5
5
  SHA512:
6
- metadata.gz: 66ff989eaf224f39ec0b2fa623145e37c565ffee63c7b54a227d2cfb208c44698e696b808a125a901e9da6f2595598d62134ae0fbd7ae0d225dbcaddce822331
7
- data.tar.gz: 846e2b422b1d8b584883201758f785f8567cc29183b4e41ae6ef23aceeef0bb411f4102f34846c113d0d1fdb86665b51602f9488ab1194619001f66699ca4b95
6
+ metadata.gz: 2811909085fdcb3a471a0b7a82875ee09f458e9ee3b6e1a2f0afa14b5029d9a7280448bdad1e58ab78796348bbbdf33bff04ddaa9d8febd14d3c9edea2947a19
7
+ data.tar.gz: 3334406cdfb028e2c10e5a8c102521e7fbf05c76d76678e4b3763da9a90aafca556eb3928348157b3384f9b09655227c0bb9011bdd66e2950dd7e623abcd3f97
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- orb_def (0.0.2)
4
+ orb_def (0.0.3)
5
5
  active_model_serializers
6
6
  faraday
7
7
  geokit-rails (~> 2.3, >= 2.3.1)
data/README.md CHANGED
@@ -40,6 +40,22 @@ Populate the DB with required seed information:
40
40
  $ rails orb_def:seed_db
41
41
  ```
42
42
 
43
+ Import all fires with their weather readings:
44
+ ```ruby
45
+ OrbDef::FirmsImport.all
46
+ ```
47
+
48
+ You can then hit the api/v1/search endpoint:
49
+ ```bash
50
+ http://localhost:3000/api/v1/fires/search?sw_bound_point=22,22&ne_bound_point=22.325,23.345345&page=1
51
+ ```
52
+
53
+ or you can call the fire model directly:
54
+ ```ruby
55
+ OrbDef::Fire.in_last_24_hours.in_bounds([sw_bound_point, ne_bound_point])
56
+ OrbDef::Fire.in_last_24_hours.within(10, origin: [latitude, longitude])
57
+ OrbDef::Fire.within(10, origin: [latitude, longitude])
58
+ ```
43
59
  ## Contributing
44
60
  Fell free to contribute by opening cloning the repo and opening a PR.
45
61
 
@@ -10,7 +10,9 @@ module OrbDef
10
10
  end
11
11
 
12
12
  def search
13
- render json: fires_in_bounds, status: :ok, each_serializer: Api::V1::FireSerializer
13
+ @pagy, @records = pagy(Fire.in_last_24_hours.in_bounds([sw_bound_point, ne_bound_point]), items: 100)
14
+
15
+ render json: @records, status: :ok, each_serializer: Api::V1::FireSerializer
14
16
  end
15
17
 
16
18
  def fires_current_wind_direction_indicator
@@ -29,13 +31,6 @@ module OrbDef
29
31
 
30
32
  private
31
33
 
32
- def fire_params
33
- params.permit(:sw_bound_point, :ne_bound_point)
34
- end
35
-
36
- def fires_in_bounds
37
- @fires_in_bounds ||= Fire.in_last_24_hours.in_bounds([sw_bound_point, ne_bound_point])
38
- end
39
34
  def sw_bound_point
40
35
  @sw_bound_point ||= Geokit::LatLng.new(get_lat(sw_lat_lng), get_lng(sw_lat_lng))
41
36
  end
@@ -2,7 +2,7 @@ class CreateOrbDefFires < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  create_table :orb_def_fires do |t|
4
4
  t.belongs_to :weather_station, index: true
5
- t.belongs_to :detected_at_weather_reading, limit: 8, index: true
5
+ t.belongs_to :weather_reading, index: true
6
6
  t.belongs_to :detection_type
7
7
  t.float :latitude, precision: 10, scale: 6, index: true
8
8
  t.float :longitude, precision: 10, scale: 6, index: true
@@ -21,6 +21,7 @@ class CreateOrbDefFires < ActiveRecord::Migration[5.2]
21
21
  t.string :confidence
22
22
  t.string :version
23
23
  t.string :day_night
24
+ t.bigint :detected_at_weather_reading_id
24
25
  t.timestamp :detected_at, index: true, uniqueness: false
25
26
  t.timestamps
26
27
  end
@@ -1,3 +1,3 @@
1
1
  module OrbDef
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
@@ -23,7 +23,7 @@ ActiveRecord::Schema.define(version: 2020_04_28_063630) do
23
23
 
24
24
  create_table "orb_def_fires", force: :cascade do |t|
25
25
  t.bigint "weather_station_id"
26
- t.bigint "detected_at_weather_reading_id"
26
+ t.bigint "weather_reading_id"
27
27
  t.bigint "detection_type_id"
28
28
  t.float "latitude"
29
29
  t.float "longitude"
@@ -42,16 +42,17 @@ ActiveRecord::Schema.define(version: 2020_04_28_063630) do
42
42
  t.string "confidence"
43
43
  t.string "version"
44
44
  t.string "day_night"
45
+ t.bigint "detected_at_weather_reading_id"
45
46
  t.datetime "detected_at"
46
47
  t.datetime "created_at", null: false
47
48
  t.datetime "updated_at", null: false
48
49
  t.index ["detected_at"], name: "index_orb_def_fires_on_detected_at"
49
- t.index ["detected_at_weather_reading_id"], name: "index_orb_def_fires_on_detected_at_weather_reading_id"
50
50
  t.index ["detection_type_id"], name: "index_orb_def_fires_on_detection_type_id"
51
51
  t.index ["identifier"], name: "index_orb_def_fires_on_identifier"
52
52
  t.index ["lat_long"], name: "index_orb_def_fires_on_lat_long"
53
53
  t.index ["latitude"], name: "index_orb_def_fires_on_latitude"
54
54
  t.index ["longitude"], name: "index_orb_def_fires_on_longitude"
55
+ t.index ["weather_reading_id"], name: "index_orb_def_fires_on_weather_reading_id"
55
56
  t.index ["weather_station_id"], name: "index_orb_def_fires_on_weather_station_id"
56
57
  end
57
58
 
@@ -0,0 +1,322 @@
1
+  (2.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
2
+ ↳ bin/rails:25
3
+  (4.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
4
+ ↳ bin/rails:25
5
+  (0.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
6
+ ↳ bin/rails:25
7
+  (0.3ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
8
+ ↳ bin/rails:25
9
+  (0.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
10
+ ↳ bin/rails:25
11
+  (0.2ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
12
+ ↳ bin/rails:25
13
+  (102.1ms) DROP DATABASE IF EXISTS "orb_def_development"
14
+ ↳ bin/rails:25
15
+  (86.6ms) DROP DATABASE IF EXISTS "orb_def_test"
16
+ ↳ bin/rails:25
17
+  (216.5ms) CREATE DATABASE "orb_def_development" ENCODING = 'utf8'
18
+ ↳ bin/rails:25
19
+  (150.2ms) CREATE DATABASE "orb_def_test" ENCODING = 'utf8'
20
+ ↳ bin/rails:25
21
+  (10.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
22
+ ↳ bin/rails:25
23
+  (3.4ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
24
+ ↳ bin/rails:25
25
+  (0.5ms) SELECT pg_try_advisory_lock(2905996609753658505)
26
+ ↳ bin/rails:25
27
+  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
28
+ ↳ bin/rails:25
29
+ Migrating to CreateOrbDefWeatherStations (20200422073925)
30
+  (0.2ms) BEGIN
31
+ ↳ bin/rails:25
32
+  (5.7ms) CREATE TABLE "orb_def_weather_stations" ("id" bigserial primary key, "name" character varying, "latitude" float, "longitude" float, "identifier" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
33
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200422073925_create_orb_def_weather_stations.rb:3
34
+  (1.0ms) CREATE INDEX "index_orb_def_weather_stations_on_identifier" ON "orb_def_weather_stations" ("identifier")
35
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200422073925_create_orb_def_weather_stations.rb:3
36
+ ActiveRecord::SchemaMigration Create (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20200422073925"]]
37
+ ↳ bin/rails:25
38
+  (0.4ms) COMMIT
39
+ ↳ bin/rails:25
40
+ Migrating to CreateOrbDefWeatherReadings (20200422073938)
41
+  (0.3ms) BEGIN
42
+ ↳ bin/rails:25
43
+  (7.0ms) CREATE TABLE "orb_def_weather_readings" ("id" bigserial primary key, "weather_station_id" bigint, "identifier" character varying, "temperature" float, "pressure" float, "ground_level" float, "humidity" integer, "wind_speed" float, "wind_direction" float, "rain" float, "cloud" integer, "description" character varying, "reading_at" timestamp, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
44
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200422073938_create_orb_def_weather_readings.rb:3
45
+  (0.9ms) CREATE INDEX "index_orb_def_weather_readings_on_weather_station_id" ON "orb_def_weather_readings" ("weather_station_id")
46
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200422073938_create_orb_def_weather_readings.rb:3
47
+  (0.8ms) CREATE INDEX "index_orb_def_weather_readings_on_identifier" ON "orb_def_weather_readings" ("identifier")
48
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200422073938_create_orb_def_weather_readings.rb:3
49
+ ActiveRecord::SchemaMigration Create (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20200422073938"]]
50
+ ↳ bin/rails:25
51
+  (0.4ms) COMMIT
52
+ ↳ bin/rails:25
53
+ Migrating to CreateOrbDefDetectionTypes (20200423064313)
54
+  (0.3ms) BEGIN
55
+ ↳ bin/rails:25
56
+  (4.4ms) CREATE TABLE "orb_def_detection_types" ("id" bigserial primary key, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
57
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200423064313_create_orb_def_detection_types.rb:3
58
+ ActiveRecord::SchemaMigration Create (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20200423064313"]]
59
+ ↳ bin/rails:25
60
+  (0.4ms) COMMIT
61
+ ↳ bin/rails:25
62
+ Migrating to CreateOrbDefFires (20200428063630)
63
+  (0.5ms) BEGIN
64
+ ↳ bin/rails:25
65
+  (3.5ms) CREATE TABLE "orb_def_fires" ("id" bigserial primary key, "weather_station_id" bigint, "weather_reading_id" bigint, "detection_type_id" bigint, "latitude" float, "longitude" float, "brightness" float, "bright_t31" float, "bright_ti5" float, "bright_ti4" float, "scan" float, "track" float, "frp" float, "distance" integer, "scan_type" character varying, "identifier" character varying, "lat_long" character varying, "satellite" character varying, "confidence" character varying, "version" character varying, "day_night" character varying, "detected_at_weather_reading" bigint, "detected_at" timestamp, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
66
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
67
+  (0.9ms) CREATE INDEX "index_orb_def_fires_on_weather_station_id" ON "orb_def_fires" ("weather_station_id")
68
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
69
+  (0.8ms) CREATE INDEX "index_orb_def_fires_on_weather_reading_id" ON "orb_def_fires" ("weather_reading_id")
70
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
71
+  (0.9ms) CREATE INDEX "index_orb_def_fires_on_detection_type_id" ON "orb_def_fires" ("detection_type_id")
72
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
73
+  (0.9ms) CREATE INDEX "index_orb_def_fires_on_latitude" ON "orb_def_fires" ("latitude")
74
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
75
+  (0.8ms) CREATE INDEX "index_orb_def_fires_on_longitude" ON "orb_def_fires" ("longitude")
76
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
77
+  (0.7ms) CREATE INDEX "index_orb_def_fires_on_identifier" ON "orb_def_fires" ("identifier")
78
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
79
+  (0.8ms) CREATE INDEX "index_orb_def_fires_on_lat_long" ON "orb_def_fires" ("lat_long")
80
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
81
+  (1.8ms) CREATE INDEX "index_orb_def_fires_on_detected_at" ON "orb_def_fires" ("detected_at")
82
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
83
+ ActiveRecord::SchemaMigration Create (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20200428063630"]]
84
+ ↳ bin/rails:25
85
+  (0.3ms) COMMIT
86
+ ↳ bin/rails:25
87
+ ActiveRecord::InternalMetadata Load (0.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
88
+ ↳ bin/rails:25
89
+  (0.2ms) BEGIN
90
+ ↳ bin/rails:25
91
+ ActiveRecord::InternalMetadata Create (0.4ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2020-05-08 08:43:12.869684"], ["updated_at", "2020-05-08 08:43:12.869684"]]
92
+ ↳ bin/rails:25
93
+  (4.1ms) COMMIT
94
+ ↳ bin/rails:25
95
+  (0.2ms) SELECT pg_advisory_unlock(2905996609753658505)
96
+ ↳ bin/rails:25
97
+  (0.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
98
+ ↳ bin/rails:25
99
+  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
100
+ ↳ bin/rails:25
101
+  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
102
+ ↳ bin/rails:25
103
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
104
+ ↳ bin/rails:25
105
+  (0.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
106
+ ↳ bin/rails:25
107
+  (0.2ms) SELECT pg_try_advisory_lock(2905996609753658505)
108
+ ↳ bin/rails:25
109
+  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
110
+ ↳ bin/rails:25
111
+ Migrating to CreateOrbDefFires (20200428063630)
112
+  (0.2ms) BEGIN
113
+ ↳ bin/rails:25
114
+  (2.7ms) DROP TABLE "orb_def_fires"
115
+ ↳ bin/rails:25
116
+ ActiveRecord::SchemaMigration Destroy (0.5ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20200428063630"]]
117
+ ↳ bin/rails:25
118
+  (2.9ms) COMMIT
119
+ ↳ bin/rails:25
120
+  (0.3ms) SELECT pg_advisory_unlock(2905996609753658505)
121
+ ↳ bin/rails:25
122
+  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
123
+ ↳ bin/rails:25
124
+  (0.2ms) SELECT pg_try_advisory_lock(2905996609753658505)
125
+ ↳ bin/rails:25
126
+  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
127
+ ↳ bin/rails:25
128
+ Migrating to CreateOrbDefFires (20200428063630)
129
+  (0.2ms) BEGIN
130
+ ↳ bin/rails:25
131
+  (13.4ms) CREATE TABLE "orb_def_fires" ("id" bigserial primary key, "weather_station_id" bigint, "weather_reading_id" bigint, "detection_type_id" bigint, "latitude" float, "longitude" float, "brightness" float, "bright_t31" float, "bright_ti5" float, "bright_ti4" float, "scan" float, "track" float, "frp" float, "distance" integer, "scan_type" character varying, "identifier" character varying, "lat_long" character varying, "satellite" character varying, "confidence" character varying, "version" character varying, "day_night" character varying, "detected_at_weather_reading_id" bigint, "detected_at" timestamp, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
132
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
133
+  (1.0ms) CREATE INDEX "index_orb_def_fires_on_weather_station_id" ON "orb_def_fires" ("weather_station_id")
134
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
135
+  (1.1ms) CREATE INDEX "index_orb_def_fires_on_weather_reading_id" ON "orb_def_fires" ("weather_reading_id")
136
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
137
+  (0.8ms) CREATE INDEX "index_orb_def_fires_on_detection_type_id" ON "orb_def_fires" ("detection_type_id")
138
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
139
+  (1.0ms) CREATE INDEX "index_orb_def_fires_on_latitude" ON "orb_def_fires" ("latitude")
140
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
141
+  (0.9ms) CREATE INDEX "index_orb_def_fires_on_longitude" ON "orb_def_fires" ("longitude")
142
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
143
+  (1.0ms) CREATE INDEX "index_orb_def_fires_on_identifier" ON "orb_def_fires" ("identifier")
144
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
145
+  (1.2ms) CREATE INDEX "index_orb_def_fires_on_lat_long" ON "orb_def_fires" ("lat_long")
146
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
147
+  (1.1ms) CREATE INDEX "index_orb_def_fires_on_detected_at" ON "orb_def_fires" ("detected_at")
148
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
149
+ ActiveRecord::SchemaMigration Create (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20200428063630"]]
150
+ ↳ bin/rails:25
151
+  (0.6ms) COMMIT
152
+ ↳ bin/rails:25
153
+ ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
154
+ ↳ bin/rails:25
155
+  (0.2ms) BEGIN
156
+ ↳ bin/rails:25
157
+  (0.2ms) COMMIT
158
+ ↳ bin/rails:25
159
+  (0.2ms) SELECT pg_advisory_unlock(2905996609753658505)
160
+ ↳ bin/rails:25
161
+  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
162
+ ↳ bin/rails:25
163
+  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
164
+ ↳ bin/rails:25
165
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
166
+ ↳ bin/rails:25
167
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
168
+ ↳ bin/rails:25
169
+  (0.1ms) SELECT pg_try_advisory_lock(2905996609753658505)
170
+ ↳ bin/rails:25
171
+  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
172
+ ↳ bin/rails:25
173
+ Migrating to CreateOrbDefFires (20200428063630)
174
+  (0.1ms) BEGIN
175
+ ↳ bin/rails:25
176
+  (2.3ms) DROP TABLE "orb_def_fires"
177
+ ↳ bin/rails:25
178
+ ActiveRecord::SchemaMigration Destroy (0.4ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20200428063630"]]
179
+ ↳ bin/rails:25
180
+  (2.4ms) COMMIT
181
+ ↳ bin/rails:25
182
+  (0.2ms) SELECT pg_advisory_unlock(2905996609753658505)
183
+ ↳ bin/rails:25
184
+  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
185
+ ↳ bin/rails:25
186
+  (0.3ms) SELECT pg_try_advisory_lock(2905996609753658505)
187
+ ↳ bin/rails:25
188
+  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
189
+ ↳ bin/rails:25
190
+ Migrating to CreateOrbDefFires (20200428063630)
191
+  (0.2ms) BEGIN
192
+ ↳ bin/rails:25
193
+  (7.1ms) CREATE TABLE "orb_def_fires" ("id" bigserial primary key, "weather_station_id" bigint, "weather_reading_id" bigint, "detection_type_id" bigint, "latitude" float, "longitude" float, "brightness" float, "bright_t31" float, "bright_ti5" float, "bright_ti4" float, "scan" float, "track" float, "frp" float, "distance" integer, "scan_type" character varying, "identifier" character varying, "lat_long" character varying, "satellite" character varying, "confidence" character varying, "version" character varying, "day_night" character varying, "detected_at_weather_reading_id" bigint, "detected_at" timestamp, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
194
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
195
+  (1.4ms) CREATE INDEX "index_orb_def_fires_on_weather_station_id" ON "orb_def_fires" ("weather_station_id")
196
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
197
+  (1.1ms) CREATE INDEX "index_orb_def_fires_on_weather_reading_id" ON "orb_def_fires" ("weather_reading_id")
198
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
199
+  (1.0ms) CREATE INDEX "index_orb_def_fires_on_detection_type_id" ON "orb_def_fires" ("detection_type_id")
200
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
201
+  (1.2ms) CREATE INDEX "index_orb_def_fires_on_latitude" ON "orb_def_fires" ("latitude")
202
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
203
+  (1.0ms) CREATE INDEX "index_orb_def_fires_on_longitude" ON "orb_def_fires" ("longitude")
204
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
205
+  (1.2ms) CREATE INDEX "index_orb_def_fires_on_identifier" ON "orb_def_fires" ("identifier")
206
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
207
+  (0.9ms) CREATE INDEX "index_orb_def_fires_on_lat_long" ON "orb_def_fires" ("lat_long")
208
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
209
+  (1.5ms) CREATE INDEX "index_orb_def_fires_on_detected_at" ON "orb_def_fires" ("detected_at")
210
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
211
+ ActiveRecord::SchemaMigration Create (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20200428063630"]]
212
+ ↳ bin/rails:25
213
+  (0.6ms) COMMIT
214
+ ↳ bin/rails:25
215
+ ActiveRecord::InternalMetadata Load (0.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
216
+ ↳ bin/rails:25
217
+  (0.2ms) BEGIN
218
+ ↳ bin/rails:25
219
+  (0.1ms) COMMIT
220
+ ↳ bin/rails:25
221
+  (0.2ms) SELECT pg_advisory_unlock(2905996609753658505)
222
+ ↳ bin/rails:25
223
+  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
224
+ ↳ bin/rails:25
225
+  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
226
+ ↳ bin/rails:25
227
+  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
228
+ ↳ bin/rails:25
229
+  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
230
+ ↳ bin/rails:25
231
+  (0.2ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
232
+ ↳ bin/rails:25
233
+  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
234
+ ↳ bin/rails:25
235
+  (0.2ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]
236
+ ↳ bin/rails:25
237
+  (78.2ms) DROP DATABASE IF EXISTS "orb_def_development"
238
+ ↳ bin/rails:25
239
+  (70.8ms) DROP DATABASE IF EXISTS "orb_def_test"
240
+ ↳ bin/rails:25
241
+  (227.7ms) CREATE DATABASE "orb_def_development" ENCODING = 'utf8'
242
+ ↳ bin/rails:25
243
+  (116.6ms) CREATE DATABASE "orb_def_test" ENCODING = 'utf8'
244
+ ↳ bin/rails:25
245
+  (6.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
246
+ ↳ bin/rails:25
247
+  (4.2ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
248
+ ↳ bin/rails:25
249
+  (0.3ms) SELECT pg_try_advisory_lock(2905996609753658505)
250
+ ↳ bin/rails:25
251
+  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
252
+ ↳ bin/rails:25
253
+ Migrating to CreateOrbDefWeatherStations (20200422073925)
254
+  (0.2ms) BEGIN
255
+ ↳ bin/rails:25
256
+  (5.2ms) CREATE TABLE "orb_def_weather_stations" ("id" bigserial primary key, "name" character varying, "latitude" float, "longitude" float, "identifier" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
257
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200422073925_create_orb_def_weather_stations.rb:3
258
+  (1.0ms) CREATE INDEX "index_orb_def_weather_stations_on_identifier" ON "orb_def_weather_stations" ("identifier")
259
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200422073925_create_orb_def_weather_stations.rb:3
260
+ ActiveRecord::SchemaMigration Create (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20200422073925"]]
261
+ ↳ bin/rails:25
262
+  (0.4ms) COMMIT
263
+ ↳ bin/rails:25
264
+ Migrating to CreateOrbDefWeatherReadings (20200422073938)
265
+  (0.3ms) BEGIN
266
+ ↳ bin/rails:25
267
+  (4.4ms) CREATE TABLE "orb_def_weather_readings" ("id" bigserial primary key, "weather_station_id" bigint, "identifier" character varying, "temperature" float, "pressure" float, "ground_level" float, "humidity" integer, "wind_speed" float, "wind_direction" float, "rain" float, "cloud" integer, "description" character varying, "reading_at" timestamp, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
268
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200422073938_create_orb_def_weather_readings.rb:3
269
+  (1.3ms) CREATE INDEX "index_orb_def_weather_readings_on_weather_station_id" ON "orb_def_weather_readings" ("weather_station_id")
270
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200422073938_create_orb_def_weather_readings.rb:3
271
+  (1.3ms) CREATE INDEX "index_orb_def_weather_readings_on_identifier" ON "orb_def_weather_readings" ("identifier")
272
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200422073938_create_orb_def_weather_readings.rb:3
273
+ ActiveRecord::SchemaMigration Create (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20200422073938"]]
274
+ ↳ bin/rails:25
275
+  (0.5ms) COMMIT
276
+ ↳ bin/rails:25
277
+ Migrating to CreateOrbDefDetectionTypes (20200423064313)
278
+  (0.5ms) BEGIN
279
+ ↳ bin/rails:25
280
+  (4.2ms) CREATE TABLE "orb_def_detection_types" ("id" bigserial primary key, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
281
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200423064313_create_orb_def_detection_types.rb:3
282
+ ActiveRecord::SchemaMigration Create (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20200423064313"]]
283
+ ↳ bin/rails:25
284
+  (0.4ms) COMMIT
285
+ ↳ bin/rails:25
286
+ Migrating to CreateOrbDefFires (20200428063630)
287
+  (0.4ms) BEGIN
288
+ ↳ bin/rails:25
289
+  (4.6ms) CREATE TABLE "orb_def_fires" ("id" bigserial primary key, "weather_station_id" bigint, "weather_reading_id" bigint, "detection_type_id" bigint, "latitude" float, "longitude" float, "brightness" float, "bright_t31" float, "bright_ti5" float, "bright_ti4" float, "scan" float, "track" float, "frp" float, "distance" integer, "scan_type" character varying, "identifier" character varying, "lat_long" character varying, "satellite" character varying, "confidence" character varying, "version" character varying, "day_night" character varying, "detected_at_weather_reading_id" bigint, "detected_at" timestamp, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
290
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
291
+  (1.1ms) CREATE INDEX "index_orb_def_fires_on_weather_station_id" ON "orb_def_fires" ("weather_station_id")
292
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
293
+  (2.0ms) CREATE INDEX "index_orb_def_fires_on_weather_reading_id" ON "orb_def_fires" ("weather_reading_id")
294
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
295
+  (1.5ms) CREATE INDEX "index_orb_def_fires_on_detection_type_id" ON "orb_def_fires" ("detection_type_id")
296
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
297
+  (1.0ms) CREATE INDEX "index_orb_def_fires_on_latitude" ON "orb_def_fires" ("latitude")
298
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
299
+  (1.2ms) CREATE INDEX "index_orb_def_fires_on_longitude" ON "orb_def_fires" ("longitude")
300
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
301
+  (1.7ms) CREATE INDEX "index_orb_def_fires_on_identifier" ON "orb_def_fires" ("identifier")
302
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
303
+  (1.2ms) CREATE INDEX "index_orb_def_fires_on_lat_long" ON "orb_def_fires" ("lat_long")
304
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
305
+  (1.9ms) CREATE INDEX "index_orb_def_fires_on_detected_at" ON "orb_def_fires" ("detected_at")
306
+ ↳ /Users/jamesgascoigne-taylor/Documents/projects/open_source/orbital_defence_engine/db/migrate/20200428063630_create_orb_def_fires.rb:3
307
+ ActiveRecord::SchemaMigration Create (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20200428063630"]]
308
+ ↳ bin/rails:25
309
+  (0.5ms) COMMIT
310
+ ↳ bin/rails:25
311
+ ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
312
+ ↳ bin/rails:25
313
+  (0.3ms) BEGIN
314
+ ↳ bin/rails:25
315
+ ActiveRecord::InternalMetadata Create (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2020-05-08 14:27:42.478420"], ["updated_at", "2020-05-08 14:27:42.478420"]]
316
+ ↳ bin/rails:25
317
+  (0.3ms) COMMIT
318
+ ↳ bin/rails:25
319
+  (0.3ms) SELECT pg_advisory_unlock(2905996609753658505)
320
+ ↳ bin/rails:25
321
+  (0.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
322
+ ↳ bin/rails:25
@@ -0,0 +1,330 @@
1
+  (78.3ms) DROP DATABASE IF EXISTS "orb_def_test"
2
+  (165.9ms) CREATE DATABASE "orb_def_test" ENCODING = 'utf8'
3
+ SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
4
+  (0.4ms) DROP TABLE IF EXISTS "orb_def_detection_types" CASCADE
5
+  (12.0ms) CREATE TABLE "orb_def_detection_types" ("id" bigserial primary key, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
6
+  (0.5ms) DROP TABLE IF EXISTS "orb_def_fires" CASCADE
7
+  (5.6ms) CREATE TABLE "orb_def_fires" ("id" bigserial primary key, "weather_station_id" bigint, "weather_reading_id" bigint, "detection_type_id" bigint, "latitude" float, "longitude" float, "brightness" float, "bright_t31" float, "bright_ti5" float, "bright_ti4" float, "scan" float, "track" float, "frp" float, "distance" integer, "scan_type" character varying, "identifier" character varying, "lat_long" character varying, "satellite" character varying, "confidence" character varying, "version" character varying, "day_night" character varying, "detected_at_weather_reading" bigint, "detected_at" timestamp, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
8
+  (2.2ms) CREATE INDEX "index_orb_def_fires_on_detected_at" ON "orb_def_fires" ("detected_at")
9
+  (1.8ms) CREATE INDEX "index_orb_def_fires_on_detection_type_id" ON "orb_def_fires" ("detection_type_id")
10
+  (1.5ms) CREATE INDEX "index_orb_def_fires_on_identifier" ON "orb_def_fires" ("identifier")
11
+  (1.7ms) CREATE INDEX "index_orb_def_fires_on_lat_long" ON "orb_def_fires" ("lat_long")
12
+  (2.2ms) CREATE INDEX "index_orb_def_fires_on_latitude" ON "orb_def_fires" ("latitude")
13
+  (1.8ms) CREATE INDEX "index_orb_def_fires_on_longitude" ON "orb_def_fires" ("longitude")
14
+  (1.8ms) CREATE INDEX "index_orb_def_fires_on_weather_reading_id" ON "orb_def_fires" ("weather_reading_id")
15
+  (2.2ms) CREATE INDEX "index_orb_def_fires_on_weather_station_id" ON "orb_def_fires" ("weather_station_id")
16
+  (0.3ms) DROP TABLE IF EXISTS "orb_def_weather_readings" CASCADE
17
+  (7.4ms) CREATE TABLE "orb_def_weather_readings" ("id" bigserial primary key, "weather_station_id" bigint, "identifier" character varying, "temperature" float, "pressure" float, "ground_level" float, "humidity" integer, "wind_speed" float, "wind_direction" float, "rain" float, "cloud" integer, "description" character varying, "reading_at" timestamp, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
18
+  (1.4ms) CREATE INDEX "index_orb_def_weather_readings_on_identifier" ON "orb_def_weather_readings" ("identifier")
19
+  (1.8ms) CREATE INDEX "index_orb_def_weather_readings_on_weather_station_id" ON "orb_def_weather_readings" ("weather_station_id")
20
+  (0.2ms) DROP TABLE IF EXISTS "orb_def_weather_stations" CASCADE
21
+  (4.8ms) CREATE TABLE "orb_def_weather_stations" ("id" bigserial primary key, "name" character varying, "latitude" float, "longitude" float, "identifier" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
22
+  (1.5ms) CREATE INDEX "index_orb_def_weather_stations_on_identifier" ON "orb_def_weather_stations" ("identifier")
23
+  (4.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
24
+  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
25
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES (20200428063630)
26
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES
27
+ (20200422073938),
28
+ (20200423064313),
29
+ (20200422073925);
30
+
31
+ 
32
+  (4.7ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
33
+ ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
34
+  (0.3ms) BEGIN
35
+ ActiveRecord::InternalMetadata Create (0.5ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "test"], ["created_at", "2020-05-08 08:43:26.127786"], ["updated_at", "2020-05-08 08:43:26.127786"]]
36
+  (0.3ms) COMMIT
37
+ ActiveRecord::InternalMetadata Load (0.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
38
+  (0.2ms) BEGIN
39
+  (0.2ms) COMMIT
40
+  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
41
+  (0.3ms) BEGIN
42
+  (0.3ms) ROLLBACK
43
+  (0.2ms) BEGIN
44
+  (0.2ms) SAVEPOINT active_record_1
45
+ OrbDef::DetectionType Exists (0.9ms) SELECT 1 AS one FROM "orb_def_detection_types" WHERE "orb_def_detection_types"."name" = $1 LIMIT $2 [["name", "Satellite"], ["LIMIT", 1]]
46
+ OrbDef::DetectionType Create (0.9ms) INSERT INTO "orb_def_detection_types" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Satellite"], ["created_at", "2020-05-08 08:43:26.294869"], ["updated_at", "2020-05-08 08:43:26.294869"]]
47
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48
+  (1.8ms) SELECT COUNT(*) FROM "orb_def_fires"
49
+ Nasa::FirmsClient#fetch - Started
50
+ Nasa::FirmsClient#fetch - Completed
51
+ OrbDef::Fire Load (0.4ms) SELECT "orb_def_fires".* FROM "orb_def_fires" WHERE "orb_def_fires"."identifier" = $1 LIMIT $2 [["identifier", "ad019c89dafc50b63f903c11b492837ed5f280ce94f40344b21d4eb9c31f6c95"], ["LIMIT", 1]]
52
+ OrbDef::DetectionType Load (0.2ms) SELECT "orb_def_detection_types".* FROM "orb_def_detection_types" WHERE "orb_def_detection_types"."name" = $1 LIMIT $2 [["name", "Satellite"], ["LIMIT", 1]]
53
+  (0.3ms) SAVEPOINT active_record_1
54
+ OrbDef::DetectionType Load (0.3ms) SELECT "orb_def_detection_types".* FROM "orb_def_detection_types" WHERE "orb_def_detection_types"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]
55
+ OrbDef::Fire Exists (0.2ms) SELECT 1 AS one FROM "orb_def_fires" WHERE "orb_def_fires"."identifier" = $1 LIMIT $2 [["identifier", "ad019c89dafc50b63f903c11b492837ed5f280ce94f40344b21d4eb9c31f6c95"], ["LIMIT", 1]]
56
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
57
+ OrbDef::WeatherStation Load (2.0ms) SELECT "orb_def_weather_stations".* FROM "orb_def_weather_stations" WHERE (orb_def_weather_stations.latitude IS NOT NULL AND orb_def_weather_stations.longitude IS NOT NULL) AND (orb_def_weather_stations.latitude>-12.964850747578364 AND orb_def_weather_stations.latitude<-12.785149252421634 AND orb_def_weather_stations.longitude>142.2418320160664 AND orb_def_weather_stations.longitude<142.42616798393362) AND ((
58
+ (ACOS(least(1,COS(-0.2247111411942699)*COS(2.4841969375336093)*COS(RADIANS(orb_def_weather_stations.latitude))*COS(RADIANS(orb_def_weather_stations.longitude))+
59
+ COS(-0.2247111411942699)*SIN(2.4841969375336093)*COS(RADIANS(orb_def_weather_stations.latitude))*SIN(RADIANS(orb_def_weather_stations.longitude))+
60
+ SIN(-0.2247111411942699)*SIN(RADIANS(orb_def_weather_stations.latitude))))*6376.77271)
61
+ <= 10)) ORDER BY "orb_def_weather_stations"."id" ASC LIMIT $1 [["LIMIT", 1]]
62
+ OrbDef::WeatherStation Load (0.4ms) SELECT "orb_def_weather_stations".* FROM "orb_def_weather_stations" WHERE "orb_def_weather_stations"."identifier" = $1 LIMIT $2 [["identifier", "Weipa:AUS"], ["LIMIT", 1]]
63
+  (0.3ms) SAVEPOINT active_record_1
64
+ OrbDef::WeatherStation Exists (0.3ms) SELECT 1 AS one FROM "orb_def_weather_stations" WHERE "orb_def_weather_stations"."identifier" = $1 LIMIT $2 [["identifier", "Weipa:AUS"], ["LIMIT", 1]]
65
+ OrbDef::WeatherStation Create (0.7ms) INSERT INTO "orb_def_weather_stations" ("name", "latitude", "longitude", "identifier", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["name", "Weipa"], ["latitude", -12.88], ["longitude", 142.33], ["identifier", "Weipa:AUS"], ["created_at", "2020-01-22 07:56:44"], ["updated_at", "2020-01-22 07:56:44"]]
66
+  (0.1ms) RELEASE SAVEPOINT active_record_1
67
+ OrbDef::WeatherReading Load (0.6ms) SELECT "orb_def_weather_readings".* FROM "orb_def_weather_readings" WHERE "orb_def_weather_readings"."identifier" = $1 LIMIT $2 [["identifier", "Weipa:1579680278"], ["LIMIT", 1]]
68
+  (0.2ms) SAVEPOINT active_record_1
69
+ OrbDef::WeatherStation Load (0.2ms) SELECT "orb_def_weather_stations".* FROM "orb_def_weather_stations" WHERE "orb_def_weather_stations"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]
70
+ OrbDef::WeatherReading Exists (0.2ms) SELECT 1 AS one FROM "orb_def_weather_readings" WHERE "orb_def_weather_readings"."identifier" = $1 LIMIT $2 [["identifier", "Weipa:1579680278"], ["LIMIT", 1]]
71
+ OrbDef::WeatherReading Create (0.5ms) INSERT INTO "orb_def_weather_readings" ("weather_station_id", "identifier", "temperature", "pressure", "humidity", "wind_speed", "wind_direction", "description", "reading_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["weather_station_id", 1], ["identifier", "Weipa:1579680278"], ["temperature", 300.15], ["pressure", 1008.0], ["humidity", 78], ["wind_speed", 12.96], ["wind_direction", 270.0], ["description", "light intensity shower rain"], ["reading_at", "2020-01-22 08:04:38"], ["created_at", "2020-01-22 07:56:44"], ["updated_at", "2020-01-22 07:56:44"]]
72
+  (0.1ms) RELEASE SAVEPOINT active_record_1
73
+  (0.1ms) SAVEPOINT active_record_1
74
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
75
+  (0.1ms) ROLLBACK
76
+  (0.2ms) BEGIN
77
+  (0.3ms) ROLLBACK
78
+  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
79
+  (0.3ms) BEGIN
80
+  (0.3ms) ROLLBACK
81
+  (0.1ms) BEGIN
82
+  (0.2ms) SAVEPOINT active_record_1
83
+ OrbDef::DetectionType Exists (0.8ms) SELECT 1 AS one FROM "orb_def_detection_types" WHERE "orb_def_detection_types"."name" = $1 LIMIT $2 [["name", "Satellite"], ["LIMIT", 1]]
84
+ OrbDef::DetectionType Create (0.4ms) INSERT INTO "orb_def_detection_types" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Satellite"], ["created_at", "2020-05-08 08:45:23.036410"], ["updated_at", "2020-05-08 08:45:23.036410"]]
85
+  (0.1ms) RELEASE SAVEPOINT active_record_1
86
+  (0.8ms) SELECT COUNT(*) FROM "orb_def_fires"
87
+ Nasa::FirmsClient#fetch - Started
88
+ Nasa::FirmsClient#fetch - Completed
89
+ OrbDef::Fire Load (0.3ms) SELECT "orb_def_fires".* FROM "orb_def_fires" WHERE "orb_def_fires"."identifier" = $1 LIMIT $2 [["identifier", "ad019c89dafc50b63f903c11b492837ed5f280ce94f40344b21d4eb9c31f6c95"], ["LIMIT", 1]]
90
+ OrbDef::DetectionType Load (0.2ms) SELECT "orb_def_detection_types".* FROM "orb_def_detection_types" WHERE "orb_def_detection_types"."name" = $1 LIMIT $2 [["name", "Satellite"], ["LIMIT", 1]]
91
+  (0.3ms) SAVEPOINT active_record_1
92
+ OrbDef::DetectionType Load (0.2ms) SELECT "orb_def_detection_types".* FROM "orb_def_detection_types" WHERE "orb_def_detection_types"."id" = $1 LIMIT $2 [["id", 2], ["LIMIT", 1]]
93
+ OrbDef::Fire Exists (0.2ms) SELECT 1 AS one FROM "orb_def_fires" WHERE "orb_def_fires"."identifier" = $1 LIMIT $2 [["identifier", "ad019c89dafc50b63f903c11b492837ed5f280ce94f40344b21d4eb9c31f6c95"], ["LIMIT", 1]]
94
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
95
+ OrbDef::WeatherStation Load (1.5ms) SELECT "orb_def_weather_stations".* FROM "orb_def_weather_stations" WHERE (orb_def_weather_stations.latitude IS NOT NULL AND orb_def_weather_stations.longitude IS NOT NULL) AND (orb_def_weather_stations.latitude>-12.964850747578364 AND orb_def_weather_stations.latitude<-12.785149252421634 AND orb_def_weather_stations.longitude>142.2418320160664 AND orb_def_weather_stations.longitude<142.42616798393362) AND ((
96
+ (ACOS(least(1,COS(-0.2247111411942699)*COS(2.4841969375336093)*COS(RADIANS(orb_def_weather_stations.latitude))*COS(RADIANS(orb_def_weather_stations.longitude))+
97
+ COS(-0.2247111411942699)*SIN(2.4841969375336093)*COS(RADIANS(orb_def_weather_stations.latitude))*SIN(RADIANS(orb_def_weather_stations.longitude))+
98
+ SIN(-0.2247111411942699)*SIN(RADIANS(orb_def_weather_stations.latitude))))*6376.77271)
99
+ <= 10)) ORDER BY "orb_def_weather_stations"."id" ASC LIMIT $1 [["LIMIT", 1]]
100
+ OrbDef::WeatherStation Load (0.3ms) SELECT "orb_def_weather_stations".* FROM "orb_def_weather_stations" WHERE "orb_def_weather_stations"."identifier" = $1 LIMIT $2 [["identifier", "Weipa:AUS"], ["LIMIT", 1]]
101
+  (0.3ms) SAVEPOINT active_record_1
102
+ OrbDef::WeatherStation Exists (0.4ms) SELECT 1 AS one FROM "orb_def_weather_stations" WHERE "orb_def_weather_stations"."identifier" = $1 LIMIT $2 [["identifier", "Weipa:AUS"], ["LIMIT", 1]]
103
+ OrbDef::WeatherStation Create (0.4ms) INSERT INTO "orb_def_weather_stations" ("name", "latitude", "longitude", "identifier", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["name", "Weipa"], ["latitude", -12.88], ["longitude", 142.33], ["identifier", "Weipa:AUS"], ["created_at", "2020-01-22 07:56:44"], ["updated_at", "2020-01-22 07:56:44"]]
104
+  (0.1ms) RELEASE SAVEPOINT active_record_1
105
+ OrbDef::WeatherReading Load (0.5ms) SELECT "orb_def_weather_readings".* FROM "orb_def_weather_readings" WHERE "orb_def_weather_readings"."identifier" = $1 LIMIT $2 [["identifier", "Weipa:1579680278"], ["LIMIT", 1]]
106
+  (0.3ms) SAVEPOINT active_record_1
107
+ OrbDef::WeatherStation Load (0.2ms) SELECT "orb_def_weather_stations".* FROM "orb_def_weather_stations" WHERE "orb_def_weather_stations"."id" = $1 LIMIT $2 [["id", 2], ["LIMIT", 1]]
108
+ OrbDef::WeatherReading Exists (0.2ms) SELECT 1 AS one FROM "orb_def_weather_readings" WHERE "orb_def_weather_readings"."identifier" = $1 LIMIT $2 [["identifier", "Weipa:1579680278"], ["LIMIT", 1]]
109
+ OrbDef::WeatherReading Create (0.3ms) INSERT INTO "orb_def_weather_readings" ("weather_station_id", "identifier", "temperature", "pressure", "humidity", "wind_speed", "wind_direction", "description", "reading_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["weather_station_id", 2], ["identifier", "Weipa:1579680278"], ["temperature", 300.15], ["pressure", 1008.0], ["humidity", 78], ["wind_speed", 12.96], ["wind_direction", 270.0], ["description", "light intensity shower rain"], ["reading_at", "2020-01-22 08:04:38"], ["created_at", "2020-01-22 07:56:44"], ["updated_at", "2020-01-22 07:56:44"]]
110
+  (0.1ms) RELEASE SAVEPOINT active_record_1
111
+  (0.1ms) SAVEPOINT active_record_1
112
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
113
+  (0.1ms) ROLLBACK
114
+  (0.1ms) BEGIN
115
+  (0.3ms) ROLLBACK
116
+  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
117
+  (0.3ms) BEGIN
118
+  (0.2ms) ROLLBACK
119
+  (0.1ms) BEGIN
120
+  (0.2ms) SAVEPOINT active_record_1
121
+ OrbDef::DetectionType Exists (0.7ms) SELECT 1 AS one FROM "orb_def_detection_types" WHERE "orb_def_detection_types"."name" = $1 LIMIT $2 [["name", "Satellite"], ["LIMIT", 1]]
122
+ OrbDef::DetectionType Create (0.5ms) INSERT INTO "orb_def_detection_types" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Satellite"], ["created_at", "2020-05-08 08:46:20.528027"], ["updated_at", "2020-05-08 08:46:20.528027"]]
123
+  (0.1ms) RELEASE SAVEPOINT active_record_1
124
+  (1.1ms) SELECT COUNT(*) FROM "orb_def_fires"
125
+ Nasa::FirmsClient#fetch - Started
126
+ Nasa::FirmsClient#fetch - Completed
127
+ OrbDef::Fire Load (0.2ms) SELECT "orb_def_fires".* FROM "orb_def_fires" WHERE "orb_def_fires"."identifier" = $1 LIMIT $2 [["identifier", "ad019c89dafc50b63f903c11b492837ed5f280ce94f40344b21d4eb9c31f6c95"], ["LIMIT", 1]]
128
+ OrbDef::DetectionType Load (0.3ms) SELECT "orb_def_detection_types".* FROM "orb_def_detection_types" WHERE "orb_def_detection_types"."name" = $1 LIMIT $2 [["name", "Satellite"], ["LIMIT", 1]]
129
+  (0.3ms) SAVEPOINT active_record_1
130
+ OrbDef::DetectionType Load (0.3ms) SELECT "orb_def_detection_types".* FROM "orb_def_detection_types" WHERE "orb_def_detection_types"."id" = $1 LIMIT $2 [["id", 3], ["LIMIT", 1]]
131
+ OrbDef::Fire Exists (0.3ms) SELECT 1 AS one FROM "orb_def_fires" WHERE "orb_def_fires"."identifier" = $1 LIMIT $2 [["identifier", "ad019c89dafc50b63f903c11b492837ed5f280ce94f40344b21d4eb9c31f6c95"], ["LIMIT", 1]]
132
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
133
+ OrbDef::WeatherStation Load (1.2ms) SELECT "orb_def_weather_stations".* FROM "orb_def_weather_stations" WHERE (orb_def_weather_stations.latitude IS NOT NULL AND orb_def_weather_stations.longitude IS NOT NULL) AND (orb_def_weather_stations.latitude>-12.964850747578364 AND orb_def_weather_stations.latitude<-12.785149252421634 AND orb_def_weather_stations.longitude>142.2418320160664 AND orb_def_weather_stations.longitude<142.42616798393362) AND ((
134
+ (ACOS(least(1,COS(-0.2247111411942699)*COS(2.4841969375336093)*COS(RADIANS(orb_def_weather_stations.latitude))*COS(RADIANS(orb_def_weather_stations.longitude))+
135
+ COS(-0.2247111411942699)*SIN(2.4841969375336093)*COS(RADIANS(orb_def_weather_stations.latitude))*SIN(RADIANS(orb_def_weather_stations.longitude))+
136
+ SIN(-0.2247111411942699)*SIN(RADIANS(orb_def_weather_stations.latitude))))*6376.77271)
137
+ <= 10)) ORDER BY "orb_def_weather_stations"."id" ASC LIMIT $1 [["LIMIT", 1]]
138
+ OrbDef::WeatherStation Load (0.2ms) SELECT "orb_def_weather_stations".* FROM "orb_def_weather_stations" WHERE "orb_def_weather_stations"."identifier" = $1 LIMIT $2 [["identifier", "Weipa:AUS"], ["LIMIT", 1]]
139
+  (0.3ms) SAVEPOINT active_record_1
140
+ OrbDef::WeatherStation Exists (0.2ms) SELECT 1 AS one FROM "orb_def_weather_stations" WHERE "orb_def_weather_stations"."identifier" = $1 LIMIT $2 [["identifier", "Weipa:AUS"], ["LIMIT", 1]]
141
+ OrbDef::WeatherStation Create (0.3ms) INSERT INTO "orb_def_weather_stations" ("name", "latitude", "longitude", "identifier", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["name", "Weipa"], ["latitude", -12.88], ["longitude", 142.33], ["identifier", "Weipa:AUS"], ["created_at", "2020-01-22 07:56:44"], ["updated_at", "2020-01-22 07:56:44"]]
142
+  (0.1ms) RELEASE SAVEPOINT active_record_1
143
+ OrbDef::WeatherReading Load (0.4ms) SELECT "orb_def_weather_readings".* FROM "orb_def_weather_readings" WHERE "orb_def_weather_readings"."identifier" = $1 LIMIT $2 [["identifier", "Weipa:1579680278"], ["LIMIT", 1]]
144
+  (0.2ms) SAVEPOINT active_record_1
145
+ OrbDef::WeatherStation Load (0.2ms) SELECT "orb_def_weather_stations".* FROM "orb_def_weather_stations" WHERE "orb_def_weather_stations"."id" = $1 LIMIT $2 [["id", 3], ["LIMIT", 1]]
146
+ OrbDef::WeatherReading Exists (0.3ms) SELECT 1 AS one FROM "orb_def_weather_readings" WHERE "orb_def_weather_readings"."identifier" = $1 LIMIT $2 [["identifier", "Weipa:1579680278"], ["LIMIT", 1]]
147
+ OrbDef::WeatherReading Create (0.3ms) INSERT INTO "orb_def_weather_readings" ("weather_station_id", "identifier", "temperature", "pressure", "humidity", "wind_speed", "wind_direction", "description", "reading_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["weather_station_id", 3], ["identifier", "Weipa:1579680278"], ["temperature", 300.15], ["pressure", 1008.0], ["humidity", 78], ["wind_speed", 12.96], ["wind_direction", 270.0], ["description", "light intensity shower rain"], ["reading_at", "2020-01-22 08:04:38"], ["created_at", "2020-01-22 07:56:44"], ["updated_at", "2020-01-22 07:56:44"]]
148
+  (0.1ms) RELEASE SAVEPOINT active_record_1
149
+  (0.1ms) SAVEPOINT active_record_1
150
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
151
+  (0.2ms) ROLLBACK
152
+  (0.1ms) BEGIN
153
+  (0.2ms) ROLLBACK
154
+  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
155
+  (0.3ms) BEGIN
156
+  (0.1ms) ROLLBACK
157
+  (0.1ms) BEGIN
158
+  (0.1ms) SAVEPOINT active_record_1
159
+ OrbDef::DetectionType Exists (0.7ms) SELECT 1 AS one FROM "orb_def_detection_types" WHERE "orb_def_detection_types"."name" = $1 LIMIT $2 [["name", "Satellite"], ["LIMIT", 1]]
160
+ OrbDef::DetectionType Create (0.4ms) INSERT INTO "orb_def_detection_types" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Satellite"], ["created_at", "2020-05-08 14:27:05.867745"], ["updated_at", "2020-05-08 14:27:05.867745"]]
161
+  (0.2ms) RELEASE SAVEPOINT active_record_1
162
+  (2.5ms) SELECT COUNT(*) FROM "orb_def_fires"
163
+ Nasa::FirmsClient#fetch - Started
164
+ Nasa::FirmsClient#fetch - Completed
165
+ OrbDef::Fire Load (0.3ms) SELECT "orb_def_fires".* FROM "orb_def_fires" WHERE "orb_def_fires"."identifier" = $1 LIMIT $2 [["identifier", "ad019c89dafc50b63f903c11b492837ed5f280ce94f40344b21d4eb9c31f6c95"], ["LIMIT", 1]]
166
+ OrbDef::DetectionType Load (0.1ms) SELECT "orb_def_detection_types".* FROM "orb_def_detection_types" WHERE "orb_def_detection_types"."name" = $1 LIMIT $2 [["name", "Satellite"], ["LIMIT", 1]]
167
+  (0.3ms) SAVEPOINT active_record_1
168
+ OrbDef::DetectionType Load (0.2ms) SELECT "orb_def_detection_types".* FROM "orb_def_detection_types" WHERE "orb_def_detection_types"."id" = $1 LIMIT $2 [["id", 4], ["LIMIT", 1]]
169
+ OrbDef::Fire Exists (0.2ms) SELECT 1 AS one FROM "orb_def_fires" WHERE "orb_def_fires"."identifier" = $1 LIMIT $2 [["identifier", "ad019c89dafc50b63f903c11b492837ed5f280ce94f40344b21d4eb9c31f6c95"], ["LIMIT", 1]]
170
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
171
+ OrbDef::WeatherStation Load (1.9ms) SELECT "orb_def_weather_stations".* FROM "orb_def_weather_stations" WHERE (orb_def_weather_stations.latitude IS NOT NULL AND orb_def_weather_stations.longitude IS NOT NULL) AND (orb_def_weather_stations.latitude>-12.964850747578364 AND orb_def_weather_stations.latitude<-12.785149252421634 AND orb_def_weather_stations.longitude>142.2418320160664 AND orb_def_weather_stations.longitude<142.42616798393362) AND ((
172
+ (ACOS(least(1,COS(-0.2247111411942699)*COS(2.4841969375336093)*COS(RADIANS(orb_def_weather_stations.latitude))*COS(RADIANS(orb_def_weather_stations.longitude))+
173
+ COS(-0.2247111411942699)*SIN(2.4841969375336093)*COS(RADIANS(orb_def_weather_stations.latitude))*SIN(RADIANS(orb_def_weather_stations.longitude))+
174
+ SIN(-0.2247111411942699)*SIN(RADIANS(orb_def_weather_stations.latitude))))*6376.77271)
175
+ <= 10)) ORDER BY "orb_def_weather_stations"."id" ASC LIMIT $1 [["LIMIT", 1]]
176
+ OrbDef::WeatherStation Load (0.4ms) SELECT "orb_def_weather_stations".* FROM "orb_def_weather_stations" WHERE "orb_def_weather_stations"."identifier" = $1 LIMIT $2 [["identifier", "Weipa:AUS"], ["LIMIT", 1]]
177
+  (0.2ms) SAVEPOINT active_record_1
178
+ OrbDef::WeatherStation Exists (0.3ms) SELECT 1 AS one FROM "orb_def_weather_stations" WHERE "orb_def_weather_stations"."identifier" = $1 LIMIT $2 [["identifier", "Weipa:AUS"], ["LIMIT", 1]]
179
+ OrbDef::WeatherStation Create (0.4ms) INSERT INTO "orb_def_weather_stations" ("name", "latitude", "longitude", "identifier", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["name", "Weipa"], ["latitude", -12.88], ["longitude", 142.33], ["identifier", "Weipa:AUS"], ["created_at", "2020-01-22 07:56:44"], ["updated_at", "2020-01-22 07:56:44"]]
180
+  (0.1ms) RELEASE SAVEPOINT active_record_1
181
+ OrbDef::WeatherReading Load (0.6ms) SELECT "orb_def_weather_readings".* FROM "orb_def_weather_readings" WHERE "orb_def_weather_readings"."identifier" = $1 LIMIT $2 [["identifier", "Weipa:1579680278"], ["LIMIT", 1]]
182
+  (0.2ms) SAVEPOINT active_record_1
183
+ OrbDef::WeatherStation Load (0.3ms) SELECT "orb_def_weather_stations".* FROM "orb_def_weather_stations" WHERE "orb_def_weather_stations"."id" = $1 LIMIT $2 [["id", 4], ["LIMIT", 1]]
184
+ OrbDef::WeatherReading Exists (0.2ms) SELECT 1 AS one FROM "orb_def_weather_readings" WHERE "orb_def_weather_readings"."identifier" = $1 LIMIT $2 [["identifier", "Weipa:1579680278"], ["LIMIT", 1]]
185
+ OrbDef::WeatherReading Create (0.3ms) INSERT INTO "orb_def_weather_readings" ("weather_station_id", "identifier", "temperature", "pressure", "humidity", "wind_speed", "wind_direction", "description", "reading_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["weather_station_id", 4], ["identifier", "Weipa:1579680278"], ["temperature", 300.15], ["pressure", 1008.0], ["humidity", 78], ["wind_speed", 12.96], ["wind_direction", 270.0], ["description", "light intensity shower rain"], ["reading_at", "2020-01-22 08:04:38"], ["created_at", "2020-01-22 07:56:44"], ["updated_at", "2020-01-22 07:56:44"]]
186
+  (0.1ms) RELEASE SAVEPOINT active_record_1
187
+  (0.1ms) SAVEPOINT active_record_1
188
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
189
+  (0.3ms) ROLLBACK
190
+  (0.1ms) BEGIN
191
+  (0.3ms) ROLLBACK
192
+  (71.5ms) DROP DATABASE IF EXISTS "orb_def_test"
193
+  (163.5ms) CREATE DATABASE "orb_def_test" ENCODING = 'utf8'
194
+ SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
195
+  (0.3ms) DROP TABLE IF EXISTS "orb_def_detection_types" CASCADE
196
+  (8.8ms) CREATE TABLE "orb_def_detection_types" ("id" bigserial primary key, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
197
+  (0.5ms) DROP TABLE IF EXISTS "orb_def_fires" CASCADE
198
+  (5.5ms) CREATE TABLE "orb_def_fires" ("id" bigserial primary key, "weather_station_id" bigint, "weather_reading_id" bigint, "detection_type_id" bigint, "latitude" float, "longitude" float, "brightness" float, "bright_t31" float, "bright_ti5" float, "bright_ti4" float, "scan" float, "track" float, "frp" float, "distance" integer, "scan_type" character varying, "identifier" character varying, "lat_long" character varying, "satellite" character varying, "confidence" character varying, "version" character varying, "day_night" character varying, "detected_at_weather_reading_id" bigint, "detected_at" timestamp, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
199
+  (1.7ms) CREATE INDEX "index_orb_def_fires_on_detected_at" ON "orb_def_fires" ("detected_at")
200
+  (1.4ms) CREATE INDEX "index_orb_def_fires_on_detection_type_id" ON "orb_def_fires" ("detection_type_id")
201
+  (1.5ms) CREATE INDEX "index_orb_def_fires_on_identifier" ON "orb_def_fires" ("identifier")
202
+  (1.4ms) CREATE INDEX "index_orb_def_fires_on_lat_long" ON "orb_def_fires" ("lat_long")
203
+  (1.4ms) CREATE INDEX "index_orb_def_fires_on_latitude" ON "orb_def_fires" ("latitude")
204
+  (1.6ms) CREATE INDEX "index_orb_def_fires_on_longitude" ON "orb_def_fires" ("longitude")
205
+  (1.6ms) CREATE INDEX "index_orb_def_fires_on_weather_reading_id" ON "orb_def_fires" ("weather_reading_id")
206
+  (1.7ms) CREATE INDEX "index_orb_def_fires_on_weather_station_id" ON "orb_def_fires" ("weather_station_id")
207
+  (0.3ms) DROP TABLE IF EXISTS "orb_def_weather_readings" CASCADE
208
+  (4.1ms) CREATE TABLE "orb_def_weather_readings" ("id" bigserial primary key, "weather_station_id" bigint, "identifier" character varying, "temperature" float, "pressure" float, "ground_level" float, "humidity" integer, "wind_speed" float, "wind_direction" float, "rain" float, "cloud" integer, "description" character varying, "reading_at" timestamp, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
209
+  (1.9ms) CREATE INDEX "index_orb_def_weather_readings_on_identifier" ON "orb_def_weather_readings" ("identifier")
210
+  (1.4ms) CREATE INDEX "index_orb_def_weather_readings_on_weather_station_id" ON "orb_def_weather_readings" ("weather_station_id")
211
+  (0.3ms) DROP TABLE IF EXISTS "orb_def_weather_stations" CASCADE
212
+  (6.3ms) CREATE TABLE "orb_def_weather_stations" ("id" bigserial primary key, "name" character varying, "latitude" float, "longitude" float, "identifier" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
213
+  (2.3ms) CREATE INDEX "index_orb_def_weather_stations_on_identifier" ON "orb_def_weather_stations" ("identifier")
214
+  (4.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
215
+  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
216
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES (20200428063630)
217
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES
218
+ (20200422073938),
219
+ (20200423064313),
220
+ (20200422073925);
221
+
222
+ 
223
+  (4.0ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
224
+ ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
225
+  (0.3ms) BEGIN
226
+ ActiveRecord::InternalMetadata Create (0.7ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "test"], ["created_at", "2020-05-08 14:27:50.532065"], ["updated_at", "2020-05-08 14:27:50.532065"]]
227
+  (0.6ms) COMMIT
228
+ ActiveRecord::InternalMetadata Load (0.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
229
+  (0.2ms) BEGIN
230
+  (0.2ms) COMMIT
231
+  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
232
+  (0.4ms) BEGIN
233
+  (0.2ms) ROLLBACK
234
+  (0.4ms) BEGIN
235
+  (0.2ms) SAVEPOINT active_record_1
236
+ OrbDef::DetectionType Exists (0.8ms) SELECT 1 AS one FROM "orb_def_detection_types" WHERE "orb_def_detection_types"."name" = $1 LIMIT $2 [["name", "Satellite"], ["LIMIT", 1]]
237
+ OrbDef::DetectionType Create (0.7ms) INSERT INTO "orb_def_detection_types" ("name", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["name", "Satellite"], ["created_at", "2020-05-08 14:27:50.680555"], ["updated_at", "2020-05-08 14:27:50.680555"]]
238
+  (0.1ms) RELEASE SAVEPOINT active_record_1
239
+  (1.0ms) SELECT COUNT(*) FROM "orb_def_fires"
240
+ Nasa::FirmsClient#fetch - Started
241
+ Nasa::FirmsClient#fetch - Completed
242
+ OrbDef::Fire Load (0.6ms) SELECT "orb_def_fires".* FROM "orb_def_fires" WHERE "orb_def_fires"."identifier" = $1 LIMIT $2 [["identifier", "ad019c89dafc50b63f903c11b492837ed5f280ce94f40344b21d4eb9c31f6c95"], ["LIMIT", 1]]
243
+ OrbDef::DetectionType Load (0.3ms) SELECT "orb_def_detection_types".* FROM "orb_def_detection_types" WHERE "orb_def_detection_types"."name" = $1 LIMIT $2 [["name", "Satellite"], ["LIMIT", 1]]
244
+  (0.3ms) SAVEPOINT active_record_1
245
+ OrbDef::DetectionType Load (0.3ms) SELECT "orb_def_detection_types".* FROM "orb_def_detection_types" WHERE "orb_def_detection_types"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]
246
+ OrbDef::Fire Exists (0.5ms) SELECT 1 AS one FROM "orb_def_fires" WHERE "orb_def_fires"."identifier" = $1 LIMIT $2 [["identifier", "ad019c89dafc50b63f903c11b492837ed5f280ce94f40344b21d4eb9c31f6c95"], ["LIMIT", 1]]
247
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
248
+ OrbDef::WeatherStation Load (2.1ms) SELECT "orb_def_weather_stations".* FROM "orb_def_weather_stations" WHERE (orb_def_weather_stations.latitude IS NOT NULL AND orb_def_weather_stations.longitude IS NOT NULL) AND (orb_def_weather_stations.latitude>-12.964850747578364 AND orb_def_weather_stations.latitude<-12.785149252421634 AND orb_def_weather_stations.longitude>142.2418320160664 AND orb_def_weather_stations.longitude<142.42616798393362) AND ((
249
+ (ACOS(least(1,COS(-0.2247111411942699)*COS(2.4841969375336093)*COS(RADIANS(orb_def_weather_stations.latitude))*COS(RADIANS(orb_def_weather_stations.longitude))+
250
+ COS(-0.2247111411942699)*SIN(2.4841969375336093)*COS(RADIANS(orb_def_weather_stations.latitude))*SIN(RADIANS(orb_def_weather_stations.longitude))+
251
+ SIN(-0.2247111411942699)*SIN(RADIANS(orb_def_weather_stations.latitude))))*6376.77271)
252
+ <= 10)) ORDER BY "orb_def_weather_stations"."id" ASC LIMIT $1 [["LIMIT", 1]]
253
+ OrbDef::WeatherStation Load (0.4ms) SELECT "orb_def_weather_stations".* FROM "orb_def_weather_stations" WHERE "orb_def_weather_stations"."identifier" = $1 LIMIT $2 [["identifier", "Weipa:AUS"], ["LIMIT", 1]]
254
+  (0.3ms) SAVEPOINT active_record_1
255
+ OrbDef::WeatherStation Exists (0.4ms) SELECT 1 AS one FROM "orb_def_weather_stations" WHERE "orb_def_weather_stations"."identifier" = $1 LIMIT $2 [["identifier", "Weipa:AUS"], ["LIMIT", 1]]
256
+ OrbDef::WeatherStation Create (1.0ms) INSERT INTO "orb_def_weather_stations" ("name", "latitude", "longitude", "identifier", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["name", "Weipa"], ["latitude", -12.88], ["longitude", 142.33], ["identifier", "Weipa:AUS"], ["created_at", "2020-01-22 07:56:44"], ["updated_at", "2020-01-22 07:56:44"]]
257
+  (0.3ms) RELEASE SAVEPOINT active_record_1
258
+ OrbDef::WeatherReading Load (0.8ms) SELECT "orb_def_weather_readings".* FROM "orb_def_weather_readings" WHERE "orb_def_weather_readings"."identifier" = $1 LIMIT $2 [["identifier", "Weipa:1579680278"], ["LIMIT", 1]]
259
+  (0.2ms) SAVEPOINT active_record_1
260
+ OrbDef::WeatherStation Load (0.2ms) SELECT "orb_def_weather_stations".* FROM "orb_def_weather_stations" WHERE "orb_def_weather_stations"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]
261
+ OrbDef::WeatherReading Exists (0.4ms) SELECT 1 AS one FROM "orb_def_weather_readings" WHERE "orb_def_weather_readings"."identifier" = $1 LIMIT $2 [["identifier", "Weipa:1579680278"], ["LIMIT", 1]]
262
+ OrbDef::WeatherReading Create (0.9ms) INSERT INTO "orb_def_weather_readings" ("weather_station_id", "identifier", "temperature", "pressure", "humidity", "wind_speed", "wind_direction", "description", "reading_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" [["weather_station_id", 1], ["identifier", "Weipa:1579680278"], ["temperature", 300.15], ["pressure", 1008.0], ["humidity", 78], ["wind_speed", 12.96], ["wind_direction", 270.0], ["description", "light intensity shower rain"], ["reading_at", "2020-01-22 08:04:38"], ["created_at", "2020-01-22 07:56:44"], ["updated_at", "2020-01-22 07:56:44"]]
263
+  (0.2ms) RELEASE SAVEPOINT active_record_1
264
+  (0.1ms) SAVEPOINT active_record_1
265
+ OrbDef::WeatherStation Load (0.2ms) SELECT "orb_def_weather_stations".* FROM "orb_def_weather_stations" WHERE "orb_def_weather_stations"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]
266
+ OrbDef::Fire Exists (0.4ms) SELECT 1 AS one FROM "orb_def_fires" WHERE "orb_def_fires"."identifier" = $1 LIMIT $2 [["identifier", "ad019c89dafc50b63f903c11b492837ed5f280ce94f40344b21d4eb9c31f6c95"], ["LIMIT", 1]]
267
+ OrbDef::Fire Create (1.5ms) INSERT INTO "orb_def_fires" ("weather_station_id", "detection_type_id", "latitude", "longitude", "brightness", "bright_t31", "scan", "track", "frp", "scan_type", "identifier", "lat_long", "satellite", "confidence", "version", "detected_at_weather_reading_id", "detected_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19) RETURNING "id" [["weather_station_id", 1], ["detection_type_id", 1], ["latitude", -12.875], ["longitude", 142.334], ["brightness", 309.8], ["bright_t31", 284.4], ["scan", 1.5], ["track", 1.2], ["frp", 9.2], ["scan_type", "modis"], ["identifier", "ad019c89dafc50b63f903c11b492837ed5f280ce94f40344b21d4eb9c31f6c95"], ["lat_long", "-12.875,142.334"], ["satellite", "T"], ["confidence", "17"], ["version", "6.0NRT"], ["detected_at_weather_reading_id", 1], ["detected_at", "2020-01-22 01:05:00"], ["created_at", "2020-01-22 07:56:44"], ["updated_at", "2020-01-22 07:56:44"]]
268
+  (0.3ms) RELEASE SAVEPOINT active_record_1
269
+  (0.1ms) SAVEPOINT active_record_1
270
+ OrbDef::Fire Exists (0.5ms) SELECT 1 AS one FROM "orb_def_fires" WHERE "orb_def_fires"."identifier" = $1 AND "orb_def_fires"."id" != $2 LIMIT $3 [["identifier", "ad019c89dafc50b63f903c11b492837ed5f280ce94f40344b21d4eb9c31f6c95"], ["id", 1], ["LIMIT", 1]]
271
+  (0.2ms) RELEASE SAVEPOINT active_record_1
272
+ OrbDef::Fire Load (0.4ms) SELECT "orb_def_fires".* FROM "orb_def_fires" WHERE "orb_def_fires"."identifier" = $1 LIMIT $2 [["identifier", "e26a88fc14c041bae14851f4d1b6f2d2771d719f4b01c0dae45c540d01e8e078"], ["LIMIT", 1]]
273
+ OrbDef::DetectionType Load (0.2ms) SELECT "orb_def_detection_types".* FROM "orb_def_detection_types" WHERE "orb_def_detection_types"."name" = $1 LIMIT $2 [["name", "Satellite"], ["LIMIT", 1]]
274
+  (0.1ms) SAVEPOINT active_record_1
275
+ OrbDef::DetectionType Load (0.4ms) SELECT "orb_def_detection_types".* FROM "orb_def_detection_types" WHERE "orb_def_detection_types"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]
276
+ OrbDef::Fire Exists (0.4ms) SELECT 1 AS one FROM "orb_def_fires" WHERE "orb_def_fires"."identifier" = $1 LIMIT $2 [["identifier", "e26a88fc14c041bae14851f4d1b6f2d2771d719f4b01c0dae45c540d01e8e078"], ["LIMIT", 1]]
277
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
278
+ OrbDef::WeatherStation Load (0.8ms) SELECT "orb_def_weather_stations".* FROM "orb_def_weather_stations" WHERE (orb_def_weather_stations.latitude IS NOT NULL AND orb_def_weather_stations.longitude IS NOT NULL) AND (orb_def_weather_stations.latitude>-12.967850747578366 AND orb_def_weather_stations.latitude<-12.788149252421633 AND orb_def_weather_stations.longitude>142.23483091286502 AND orb_def_weather_stations.longitude<142.41916908713497) AND ((
279
+ (ACOS(least(1,COS(-0.22476350107182974)*COS(2.4840747644859693)*COS(RADIANS(orb_def_weather_stations.latitude))*COS(RADIANS(orb_def_weather_stations.longitude))+
280
+ COS(-0.22476350107182974)*SIN(2.4840747644859693)*COS(RADIANS(orb_def_weather_stations.latitude))*SIN(RADIANS(orb_def_weather_stations.longitude))+
281
+ SIN(-0.22476350107182974)*SIN(RADIANS(orb_def_weather_stations.latitude))))*6376.77271)
282
+ <= 10)) ORDER BY "orb_def_weather_stations"."id" ASC LIMIT $1 [["LIMIT", 1]]
283
+ OrbDef::WeatherReading Load (0.6ms) SELECT "orb_def_weather_readings".* FROM "orb_def_weather_readings" WHERE "orb_def_weather_readings"."weather_station_id" = $1 ORDER BY "orb_def_weather_readings"."id" DESC LIMIT $2 [["weather_station_id", 1], ["LIMIT", 1]]
284
+ OrbDef::WeatherStation Load (1.0ms) SELECT "orb_def_weather_stations".* FROM "orb_def_weather_stations" WHERE "orb_def_weather_stations"."identifier" = $1 LIMIT $2 [["identifier", "Weipa:AUS"], ["LIMIT", 1]]
285
+ OrbDef::WeatherReading Load (0.3ms) SELECT "orb_def_weather_readings".* FROM "orb_def_weather_readings" WHERE "orb_def_weather_readings"."identifier" = $1 LIMIT $2 [["identifier", "Weipa:1579680278"], ["LIMIT", 1]]
286
+  (0.2ms) SAVEPOINT active_record_1
287
+ OrbDef::WeatherStation Load (0.4ms) SELECT "orb_def_weather_stations".* FROM "orb_def_weather_stations" WHERE "orb_def_weather_stations"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]
288
+ OrbDef::Fire Exists (0.4ms) SELECT 1 AS one FROM "orb_def_fires" WHERE "orb_def_fires"."identifier" = $1 LIMIT $2 [["identifier", "e26a88fc14c041bae14851f4d1b6f2d2771d719f4b01c0dae45c540d01e8e078"], ["LIMIT", 1]]
289
+ OrbDef::Fire Create (1.3ms) INSERT INTO "orb_def_fires" ("weather_station_id", "detection_type_id", "latitude", "longitude", "brightness", "bright_t31", "scan", "track", "frp", "scan_type", "identifier", "lat_long", "satellite", "confidence", "version", "detected_at_weather_reading_id", "detected_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19) RETURNING "id" [["weather_station_id", 1], ["detection_type_id", 1], ["latitude", -12.878], ["longitude", 142.327], ["brightness", 310.4], ["bright_t31", 283.9], ["scan", 1.5], ["track", 1.2], ["frp", 11.4], ["scan_type", "modis"], ["identifier", "e26a88fc14c041bae14851f4d1b6f2d2771d719f4b01c0dae45c540d01e8e078"], ["lat_long", "-12.878,142.327"], ["satellite", "T"], ["confidence", "44"], ["version", "6.0NRT"], ["detected_at_weather_reading_id", 1], ["detected_at", "2020-01-22 01:05:00"], ["created_at", "2020-01-22 07:56:44"], ["updated_at", "2020-01-22 07:56:44"]]
290
+  (0.2ms) RELEASE SAVEPOINT active_record_1
291
+  (0.2ms) SAVEPOINT active_record_1
292
+ OrbDef::Fire Exists (0.5ms) SELECT 1 AS one FROM "orb_def_fires" WHERE "orb_def_fires"."identifier" = $1 AND "orb_def_fires"."id" != $2 LIMIT $3 [["identifier", "e26a88fc14c041bae14851f4d1b6f2d2771d719f4b01c0dae45c540d01e8e078"], ["id", 2], ["LIMIT", 1]]
293
+  (0.3ms) RELEASE SAVEPOINT active_record_1
294
+ OrbDef::Fire Load (0.2ms) SELECT "orb_def_fires".* FROM "orb_def_fires" WHERE "orb_def_fires"."identifier" = $1 LIMIT $2 [["identifier", "78bc15a58abecf19b2bece870707ee773cefa7f5953d04251575b96ecd8b277b"], ["LIMIT", 1]]
295
+ OrbDef::DetectionType Load (0.2ms) SELECT "orb_def_detection_types".* FROM "orb_def_detection_types" WHERE "orb_def_detection_types"."name" = $1 LIMIT $2 [["name", "Satellite"], ["LIMIT", 1]]
296
+  (0.3ms) SAVEPOINT active_record_1
297
+ OrbDef::DetectionType Load (0.3ms) SELECT "orb_def_detection_types".* FROM "orb_def_detection_types" WHERE "orb_def_detection_types"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]
298
+ OrbDef::Fire Exists (0.5ms) SELECT 1 AS one FROM "orb_def_fires" WHERE "orb_def_fires"."identifier" = $1 LIMIT $2 [["identifier", "78bc15a58abecf19b2bece870707ee773cefa7f5953d04251575b96ecd8b277b"], ["LIMIT", 1]]
299
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
300
+ OrbDef::WeatherStation Load (0.6ms) SELECT "orb_def_weather_stations".* FROM "orb_def_weather_stations" WHERE (orb_def_weather_stations.latitude IS NOT NULL AND orb_def_weather_stations.longitude IS NOT NULL) AND (orb_def_weather_stations.latitude>-18.955850747578364 AND orb_def_weather_stations.latitude<-18.776149252421632 AND orb_def_weather_stations.longitude>139.2300482045209 AND orb_def_weather_stations.longitude<139.41995179547908) AND ((
301
+ (ACOS(least(1,COS(-0.32927381668125016)*COS(2.4316799803410993)*COS(RADIANS(orb_def_weather_stations.latitude))*COS(RADIANS(orb_def_weather_stations.longitude))+
302
+ COS(-0.32927381668125016)*SIN(2.4316799803410993)*COS(RADIANS(orb_def_weather_stations.latitude))*SIN(RADIANS(orb_def_weather_stations.longitude))+
303
+ SIN(-0.32927381668125016)*SIN(RADIANS(orb_def_weather_stations.latitude))))*6376.77271)
304
+ <= 10)) ORDER BY "orb_def_weather_stations"."id" ASC LIMIT $1 [["LIMIT", 1]]
305
+ OrbDef::WeatherStation Load (0.5ms) SELECT "orb_def_weather_stations".* FROM "orb_def_weather_stations" WHERE "orb_def_weather_stations"."identifier" = $1 LIMIT $2 [["identifier", "Burke:AUS"], ["LIMIT", 1]]
306
+  (0.2ms) SAVEPOINT active_record_1
307
+ OrbDef::WeatherStation Exists (0.4ms) SELECT 1 AS one FROM "orb_def_weather_stations" WHERE "orb_def_weather_stations"."identifier" = $1 LIMIT $2 [["identifier", "Burke:AUS"], ["LIMIT", 1]]
308
+ OrbDef::WeatherStation Create (0.3ms) INSERT INTO "orb_def_weather_stations" ("name", "latitude", "longitude", "identifier", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["name", "Burke"], ["latitude", -18.87], ["longitude", 139.32], ["identifier", "Burke:AUS"], ["created_at", "2020-01-22 07:56:44"], ["updated_at", "2020-01-22 07:56:44"]]
309
+  (0.2ms) RELEASE SAVEPOINT active_record_1
310
+ OrbDef::WeatherReading Load (0.3ms) SELECT "orb_def_weather_readings".* FROM "orb_def_weather_readings" WHERE "orb_def_weather_readings"."identifier" = $1 LIMIT $2 [["identifier", "Burke:1579680278"], ["LIMIT", 1]]
311
+  (0.2ms) SAVEPOINT active_record_1
312
+ OrbDef::WeatherStation Load (0.3ms) SELECT "orb_def_weather_stations".* FROM "orb_def_weather_stations" WHERE "orb_def_weather_stations"."id" = $1 LIMIT $2 [["id", 2], ["LIMIT", 1]]
313
+ OrbDef::WeatherReading Exists (0.2ms) SELECT 1 AS one FROM "orb_def_weather_readings" WHERE "orb_def_weather_readings"."identifier" = $1 LIMIT $2 [["identifier", "Burke:1579680278"], ["LIMIT", 1]]
314
+ OrbDef::WeatherReading Create (0.5ms) INSERT INTO "orb_def_weather_readings" ("weather_station_id", "identifier", "temperature", "pressure", "ground_level", "humidity", "wind_speed", "wind_direction", "rain", "description", "reading_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13) RETURNING "id" [["weather_station_id", 2], ["identifier", "Burke:1579680278"], ["temperature", 301.13], ["pressure", 1005.0], ["ground_level", 992.0], ["humidity", 72], ["wind_speed", 25.776], ["wind_direction", 322.0], ["rain", 0.25], ["description", "light rain"], ["reading_at", "2020-01-22 08:04:38"], ["created_at", "2020-01-22 07:56:44"], ["updated_at", "2020-01-22 07:56:44"]]
315
+  (0.2ms) RELEASE SAVEPOINT active_record_1
316
+  (0.2ms) SAVEPOINT active_record_1
317
+ OrbDef::WeatherStation Load (0.3ms) SELECT "orb_def_weather_stations".* FROM "orb_def_weather_stations" WHERE "orb_def_weather_stations"."id" = $1 LIMIT $2 [["id", 2], ["LIMIT", 1]]
318
+ OrbDef::Fire Exists (0.3ms) SELECT 1 AS one FROM "orb_def_fires" WHERE "orb_def_fires"."identifier" = $1 LIMIT $2 [["identifier", "78bc15a58abecf19b2bece870707ee773cefa7f5953d04251575b96ecd8b277b"], ["LIMIT", 1]]
319
+ OrbDef::Fire Create (0.6ms) INSERT INTO "orb_def_fires" ("weather_station_id", "detection_type_id", "latitude", "longitude", "brightness", "bright_t31", "scan", "track", "frp", "scan_type", "identifier", "lat_long", "satellite", "confidence", "version", "detected_at_weather_reading_id", "detected_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19) RETURNING "id" [["weather_station_id", 2], ["detection_type_id", 1], ["latitude", -18.866], ["longitude", 139.325], ["brightness", 335.1], ["bright_t31", 292.8], ["scan", 1.2], ["track", 1.1], ["frp", 33.8], ["scan_type", "modis"], ["identifier", "78bc15a58abecf19b2bece870707ee773cefa7f5953d04251575b96ecd8b277b"], ["lat_long", "-18.866,139.325"], ["satellite", "T"], ["confidence", "78"], ["version", "6.0NRT"], ["detected_at_weather_reading_id", 2], ["detected_at", "2020-01-22 01:10:00"], ["created_at", "2020-01-22 07:56:44"], ["updated_at", "2020-01-22 07:56:44"]]
320
+  (0.2ms) RELEASE SAVEPOINT active_record_1
321
+  (0.1ms) SAVEPOINT active_record_1
322
+ OrbDef::Fire Exists (0.3ms) SELECT 1 AS one FROM "orb_def_fires" WHERE "orb_def_fires"."identifier" = $1 AND "orb_def_fires"."id" != $2 LIMIT $3 [["identifier", "78bc15a58abecf19b2bece870707ee773cefa7f5953d04251575b96ecd8b277b"], ["id", 3], ["LIMIT", 1]]
323
+  (0.1ms) RELEASE SAVEPOINT active_record_1
324
+ Nasa::FirmsClient#fetch - Started
325
+ Nasa::FirmsClient#fetch - Failed: 404 Not Found - /api/v2/content/archives/FIRMS/viirs/Global/VIIRS_I_Global_VNP14IMGTDL_NRT_2020022
326
+ Nasa::FirmsImport#all - Failed to fetch virrs
327
+  (0.5ms) SELECT COUNT(*) FROM "orb_def_fires"
328
+  (0.3ms) ROLLBACK
329
+  (0.1ms) BEGIN
330
+  (0.4ms) ROLLBACK
@@ -0,0 +1 @@
1
+ 9ffc85a91167ce4ceeb82ec443621b1c849f06cefc9cff0d90e6ad8399848ca9f5e8fe32acca76f24059de733960c6eda397b1b0591dd6ff2e25a3ad7a1515d8
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orb_def
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Gascoigne-Taylor
@@ -320,6 +320,8 @@ files:
320
320
  - spec/dummy/config/spring.rb
321
321
  - spec/dummy/config/storage.yml
322
322
  - spec/dummy/db/schema.rb
323
+ - spec/dummy/log/development.log
324
+ - spec/dummy/log/test.log
323
325
  - spec/dummy/package.json
324
326
  - spec/dummy/public/404.html
325
327
  - spec/dummy/public/422.html
@@ -327,6 +329,7 @@ files:
327
329
  - spec/dummy/public/apple-touch-icon-precomposed.png
328
330
  - spec/dummy/public/apple-touch-icon.png
329
331
  - spec/dummy/public/favicon.ico
332
+ - spec/dummy/tmp/development_secret.txt
330
333
  - spec/factories/detection_type.rb
331
334
  - spec/fixtures/files/modis_c6.txt
332
335
  - spec/fixtures/nasa/firms/viirs.txt
@@ -421,6 +424,9 @@ test_files:
421
424
  - spec/dummy/public/apple-touch-icon-precomposed.png
422
425
  - spec/dummy/package.json
423
426
  - spec/dummy/db/schema.rb
427
+ - spec/dummy/log/test.log
428
+ - spec/dummy/log/development.log
429
+ - spec/dummy/tmp/development_secret.txt
424
430
  - spec/spec/vcr/cassettes/OrbitalDefenceEngine_OpenWeatherApi_WeatherByCoordinates/_fetch_weather_by_coordinates/returns_json_data_as_a_hash.yml
425
431
  - spec/spec/vcr/cassettes/OrbitalDefenceEngine_Nasa_FirmsImport/_all/when_request_successful/creates_fires.yml
426
432
  - spec/vcr/cassettes/OpenWeatherApi_WeatherByCoordinates/_fetch_weather_by_coordinates/returns_json_data_as_a_hash.yml