aemo 0.1.22 → 0.1.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aemo/nem12.rb +8 -39
- data/lib/aemo/nmi.rb +3 -1
- data/lib/aemo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b20ce4d815543d07216701db47a72312737db305
|
4
|
+
data.tar.gz: fdfc8776f7fa87f93e1610577e8fe3676ab1f43d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51800d16c005e07a0be7fd05de0ccda4224b1aed8159fa148a16d994fac919ff068fec769bedac7f319a0264087ed57471de7e62c8e10e622c0bba0963af5732
|
7
|
+
data.tar.gz: c48aaa496f7796c066229953d4a95b667819bd608bfed1ccb854487c006d171c4ccf06cc6d9bf9694bee28d880e6d902485190c2e07567045714a2ef4d330855
|
data/lib/aemo/nem12.rb
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
require 'csv'
|
2
2
|
require 'time'
|
3
|
+
|
3
4
|
module AEMO
|
4
|
-
|
5
|
+
# Namespace for classes and modules that handle AEMO Gem NEM12 interactions
|
6
|
+
# @since 0.1.4
|
7
|
+
module NEM12
|
5
8
|
# As per AEMO NEM12 Specification
|
6
9
|
# http://www.aemo.com.au/Consultations/National-Electricity-Market/Open/~/media/Files/Other/consultations/nem/Meter%20Data%20File%20Format%20Specification%20NEM12_NEM13/MDFF_Specification_NEM12_NEM13_Final_v102_clean.ashx
|
7
10
|
RECORD_INDICATORS = {
|
@@ -223,45 +226,11 @@ module AEMO
|
|
223
226
|
|
224
227
|
}
|
225
228
|
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
'D' => { :stream => 'Average', :description => 'Export', :units => 'kWh' },
|
230
|
-
'J' => { :stream => 'Average', :description => 'Import', :units => 'kVArh' },
|
231
|
-
'P' => { :stream => 'Average', :description => 'Export', :units => 'kVArh' },
|
232
|
-
'S' => { :stream => 'Average', :description => '', :units => 'kVAh' },
|
233
|
-
# Master Data Streams
|
234
|
-
'B' => { :stream => 'Master', :description => 'Import', :units => 'kWh' },
|
235
|
-
'E' => { :stream => 'Master', :description => 'Export', :units => 'kWh' },
|
236
|
-
'K' => { :stream => 'Master', :description => 'Import', :units => 'kVArh' },
|
237
|
-
'Q' => { :stream => 'Master', :description => 'Export', :units => 'kVArh' },
|
238
|
-
'T' => { :stream => 'Master', :description => '', :units => 'kVAh' },
|
239
|
-
'G' => { :stream => 'Master', :description => 'Power Factor', :units => 'PF' },
|
240
|
-
'H' => { :stream => 'Master', :description => 'Q Metering', :units => 'Qh' },
|
241
|
-
'M' => { :stream => 'Master', :description => 'Par Metering', :units => 'parh' },
|
242
|
-
'V' => { :stream => 'Master', :description => 'Volts or V2h or Amps or A2h', :units => '' },
|
243
|
-
# Check Meter Streams
|
244
|
-
'C' => { :stream => 'Check', :description => 'Import', :units => 'kWh' },
|
245
|
-
'F' => { :stream => 'Check', :description => 'Export', :units => 'kWh' },
|
246
|
-
'L' => { :stream => 'Check', :description => 'Import', :units => 'kVArh' },
|
247
|
-
'R' => { :stream => 'Check', :description => 'Export', :units => 'kVArh' },
|
248
|
-
'U' => { :stream => 'Check', :description => '', :units => 'kVAh' },
|
249
|
-
'Y' => { :stream => 'Check', :description => 'Q Metering', :units => 'Qh' },
|
250
|
-
'W' => { :stream => 'Check', :description => 'Par Metering Path', :units => '' },
|
251
|
-
'Z' => { :stream => 'Check', :description => 'Volts or V2h or Amps or A2h', :units => '' },
|
252
|
-
# Net Meter Streams
|
253
|
-
# AEMO: NOTE THAT D AND J ARE PREVIOUSLY DEFINED
|
254
|
-
# 'D' => { :stream => 'Net', :description => 'Net', :units => 'kWh' },
|
255
|
-
# 'J' => { :stream => 'Net', :description => 'Net', :units => 'kVArh' }
|
256
|
-
}
|
257
|
-
|
258
|
-
@nmi = nil
|
259
|
-
@data_details = []
|
260
|
-
@interval_data = []
|
261
|
-
@interval_events = []
|
229
|
+
@file_contents = nil
|
230
|
+
@header = nil
|
231
|
+
@nmi_data_details = []
|
262
232
|
|
263
|
-
attr_accessor :
|
264
|
-
attr_reader :data_details, :interval_data, :interval_events
|
233
|
+
attr_accessor :file_contents, :header, :nmi_data_details
|
265
234
|
|
266
235
|
# Initialize a NEM12 file
|
267
236
|
def initialize(nmi,options={})
|
data/lib/aemo/nmi.rb
CHANGED
@@ -648,7 +648,9 @@ module AEMO
|
|
648
648
|
def dlfc_values(start = DateTime.now, finish=DateTime.now)
|
649
649
|
raise 'No DLF set, ensure that you have set the value either via the update_from_msats! function or manually' if @dlf.nil?
|
650
650
|
raise 'DLF is invalid' unless DLF_CODES.keys.include?(@dlf)
|
651
|
-
raise 'Invalid
|
651
|
+
raise 'Invalid start' unless [DateTime,Time].include?(start.class)
|
652
|
+
raise 'Invalid finish' unless [DateTime,Time].include?(finish.class)
|
653
|
+
raise 'start cannot be after finish' if start > finish
|
652
654
|
DLF_CODES[@dlf].reject{|x| start > DateTime.parse(x['ToDate']) || finish < DateTime.parse(x['FromDate']) }.map{|x| { 'start' => x['FromDate'], 'finish' => x['ToDate'], 'value' => x['Value'].to_f}}
|
653
655
|
end
|
654
656
|
|
data/lib/aemo/version.rb
CHANGED