Skip to content

Commit

Permalink
70-Refactor LDAR-Sim parameters (#91)
Browse files Browse the repository at this point in the history
feat: Refactor LDAR-Sim parameter structure.

Reason for change:
This changes is aimed at solving the issue of user confusion when
dealing with LDAR-Sim parameterization, specifically program level
parameters. Many program level parameters are not actually able to be
set at the program level as they are overwritten with the values set
for the baseline program for all other programs. This is misleading as
the parameters being at the program level implies that they can be set
per program.

Resolution:
The majority of program level parameters have been moved to a new
parameter file named virtual_world parameters. There will only exist
one virtual world parameters file per simulation set. This will
provide clarity on the intended purpose of parameters contained within
and enforce the that these parameters cannot be set on a per program
basis for valid LDAR-Sim results to be obtained.

Effect(s) of change:
BREAKING CHANGE - Previous parameter files will no longer be compatible
with the new version of LDAR-Sim. Functionally,
behavior inside the simulation should be unchanged.
  • Loading branch information
ThomasGalesloot committed Aug 1, 2023
1 parent 26bbe82 commit e9c542c
Show file tree
Hide file tree
Showing 132 changed files with 2,657 additions and 2,864 deletions.
2 changes: 1 addition & 1 deletion LDAR_Sim/external_sensors/METEC_NO_WIND.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def detect_emissions(self, site, covered_leaks, covered_equipment_rates, covered
self.state['t'],
self.config['label'],
self.id,
self.parameters
self.program_parameters
)
if is_new_leak:
site_measured_rate += meas_rate
Expand Down
6 changes: 3 additions & 3 deletions LDAR_Sim/simulations/M_OGI.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
parameter_level: method
version: '2.0'
version: "3.0"
label: OGI
deployment_type: mobile
measurement_scale: component
is_follow_up: False
sensor:
sensor:
type: default
MDL: [0.0362]
cost:
per_site: 600
coverage:
spatial: 0.9
temporal: 0.9
t_bw_sites:
t_bw_sites:
vals: [30]
RS: 2
time: 120
8 changes: 4 additions & 4 deletions LDAR_Sim/simulations/M_OGI_FU.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
parameter_level: method
version: '2.0'
version: "3.0"
label: OGI_FU
deployment_type: mobile
measurement_scale: component
is_follow_up: True
sensor:
sensor:
type: default
MDL: [0.0362]
cost:
per_site: 700
coverage:
spatial: 0.9
temporal: 0.9
t_bw_sites:
t_bw_sites:
vals: [45]
time: 120
time: 120
4 changes: 2 additions & 2 deletions LDAR_Sim/simulations/M_aircraft.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
parameter_level: method
version: '2.0'
version: "3.0"
label: aircraft
deployment_type: mobile
measurement_scale: equipment
is_follow_up: False
sensor:
sensor:
type: default
MDL: [1]
cost:
Expand Down
6 changes: 3 additions & 3 deletions LDAR_Sim/simulations/M_aircraft_ex_sensor.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
parameter_level: method
version: '2.0'
version: "3.0"
label: aircraft_ex_sensor
deployment_type: mobile
measurement_scale: equipment
is_follow_up: False
sensor:
sensor:
mod_loc: METEC_NO_WIND
MDL: [4,5,0]
MDL: [4, 5, 0]
cost:
per_site: 200
coverage:
Expand Down
8 changes: 4 additions & 4 deletions LDAR_Sim/simulations/M_drone.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
parameter_level: method
version: '2.0'
version: "3.0"
label: drone
deployment_type: mobile
measurement_scale: equipment
is_follow_up: False
sensor:
sensor:
type: default
MDL: [0.01]
cost:
per_site: 500
coverage:
spatial: 1.0
temporal: 0.9
t_bw_sites:
t_bw_sites:
vals: [30]
RS: 2
time: 20
time: 20
8 changes: 4 additions & 4 deletions LDAR_Sim/simulations/M_truck.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
parameter_level: method
version: '2.0'
version: "3.0"
label: truck
deployment_type: mobile
measurement_scale: equipment
is_follow_up: False
sensor:
sensor:
type: default
MDL: [0.01]
cost:
per_site: 400
coverage:
spatial: 0.7
temporal: 0.8
t_bw_sites:
t_bw_sites:
vals: [30]
RS: 2
time: 30
time: 30
4 changes: 2 additions & 2 deletions LDAR_Sim/simulations/P_OGI.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
program_name: P_OGI
parameter_level: program
version: '2.0'
version: "3.0"
method_labels:
- OGI
- OGI
6 changes: 3 additions & 3 deletions LDAR_Sim/simulations/P_aircraft.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
program_name: P_aircraft
parameter_level: program
version: '2.0'
version: "3.0"
method_labels:
- aircraft
- OGI_FU
- aircraft
- OGI_FU
6 changes: 3 additions & 3 deletions LDAR_Sim/simulations/P_aircraft_ex_sensor.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
program_name: P_aircraft_ex_sensor
parameter_level: program
version: '2.0'
version: "3.0"
method_labels:
- aircraft_ex_sensor
- OGI_FU
- aircraft_ex_sensor
- OGI_FU
6 changes: 3 additions & 3 deletions LDAR_Sim/simulations/P_drone.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
program_name: P_drone
parameter_level: program
version: '2.0'
version: "3.0"
method_labels:
- drone
- OGI_FU
- drone
- OGI_FU
2 changes: 1 addition & 1 deletion LDAR_Sim/simulations/P_none.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
program_name: P_none
parameter_level: program
version: '2.0'
version: "3.0"
method_labels: []
6 changes: 3 additions & 3 deletions LDAR_Sim/simulations/P_truck.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
program_name: P_truck
parameter_level: program
version: '2.0'
version: "3.0"
method_labels:
- truck
- OGI_FU
- truck
- OGI_FU
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

parameter_level: global
version: '2.0'
parameter_level: simulation_settings
version: "3.0"
pregenerate_leaks: True
reference_program: P_OGI
baseline_program: P_none
2 changes: 2 additions & 0 deletions LDAR_Sim/simulations/virtual_world.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version: "3.0"
parameter_level: "virtual_world"
4 changes: 2 additions & 2 deletions LDAR_Sim/src/campaigns/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from numpy import zeros, ones, tile, array


def setup_campaigns(campaigns, prog_params, n_sites, n_screening_rs_sets):
def setup_campaigns(campaigns, prog_params, virtual_world, n_sites, n_screening_rs_sets):
""" Setup Campaigns
Args:
Expand All @@ -19,7 +19,7 @@ def setup_campaigns(campaigns, prog_params, n_sites, n_screening_rs_sets):
days_in_campaign = int(floor(365/rs))
else:
days_in_campaign = 365
n_campaigns = int(ceil(prog_params['timesteps']/days_in_campaign)+1)
n_campaigns = int(ceil(virtual_world['timesteps']/days_in_campaign)+1)
min_followups = meth['follow_up']['min_followups']
min_FU_d_to_end = meth['follow_up'][
'min_followup_days_to_end']
Expand Down
16 changes: 0 additions & 16 deletions LDAR_Sim/src/default_parameters/g_default.yml

This file was deleted.

84 changes: 42 additions & 42 deletions LDAR_Sim/src/default_parameters/m_default.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
consider_daylight: False
parameter_level: "method"
version: "3.0"
label: "_placeholder_str_"
measurement_scale: "_placeholder_str_" # site/equipment/component
deployment_type: "_placeholder_str_" # mobile/stationary/orbit
sensor:
type: default # default/OGI_camera_zim(see User manual for MDL values)/OGI_camera_rk
QE: 0.0
MDL: [0.01]
mod_loc: "_placeholder_str_"
coverage:
spatial: 1.0 # 0.0 to 1.0
temporal: 1.0 # 0.0 to 1.0
cost:
per_day: 0
per_hour: 0
per_site: 0
upfront: 0
coverage:
spatial: 1.0 # 0.0 to 1.0
temporal: 1.0 # 0.0 to 1.0
deployment_type: '_placeholder_str_' # mobile/stationary/orbit
follow_up:
preferred_method: '_placeholder_str_'
delay: 0 # days
instant_threshold: '_placeholder_float_' # g/s
instant_threshold_type: 'absolute' # absolute/relative
interaction_priority: 'threshold' # threshold/proportion
min_followups: ['_placeholder_float_'] # list of values between 0.0 and 1.0
min_followup_type: 'annual' # annual/campaign
min_followup_days_to_end: 0 # days
proportion: 1.0 # 0 to 1.0
redundancy_filter: 'recent' # recent/max/average
threshold: 0.0 # g/s
threshold_type: 'absolute' # absolute/relative
is_follow_up: False # True/False
label: '_placeholder_str_'
max_workday: 8 # 1 to 23
measurement_scale: '_placeholder_str_' # site/equipment/component
n_crews: '_placeholder_int_' # whole numbers
parameter_level: 'method'
reporting_delay: 2 # days
n_crews: "_placeholder_int_" # whole numbers
consider_daylight: False
RS: "_placeholder_int_"
time: "_placeholder_int_" # minutes
max_workday: 8 # 1 to 23
reporting_delay: 2 # days
t_bw_sites:
file: "_placeholder_str_"
vals: [30.0] # minutes
scheduling:
deployment_months: [1,2,3,4,5,6,7,8,9,10,11,12]
deployment_years: ['_placeholder_int_']
deployment_months: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
deployment_years: ["_placeholder_int_"]
LDAR_crew_init_location: [-114.062, 51.044]
home_bases_files: 'Airport_AB_Coordinates.csv'
home_bases_files: "Airport_AB_Coordinates.csv"
route_planning: False # True/False
travel_speeds: ['_placeholder_int_']
min_time_bt_surveys: '_placeholder_int_'
sensor:
type: default # default/OGI_camera_zim(see User manual for MDL values)/OGI_camera_rk
QE: 0.0
MDL: [0.01]
mod_loc: '_placeholder_str_'
t_bw_sites:
file: '_placeholder_str_'
vals: [30.0] # minutes
travel_speeds: ["_placeholder_int_"]
min_time_bt_surveys: "_placeholder_int_"
weather_envs:
precip: [0.0, 0.5]
temp: [-40.0, 40.0]
wind: [0.0, 10.0]
version: '2.0'
RS: '_placeholder_int_'
time: '_placeholder_int_' # minutes
wind: [0.0, 10.0]
is_follow_up: False # True/False
follow_up:
preferred_method: "_placeholder_str_"
delay: 0 # days
instant_threshold: "_placeholder_float_" # g/s
instant_threshold_type: "absolute" # absolute/relative
interaction_priority: "threshold" # threshold/proportion
min_followups: ["_placeholder_float_"] # list of values between 0.0 and 1.0
min_followup_type: "annual" # annual/campaign
min_followup_days_to_end: 0 # days
proportion: 1.0 # 0 to 1.0
redundancy_filter: "recent" # recent/max/average
threshold: 0.0 # g/s
threshold_type: "absolute" # absolute/relative
27 changes: 2 additions & 25 deletions LDAR_Sim/src/default_parameters/p_default.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,7 @@
version: "2.0"
version: "3.0"
parameter_level: "program"
methods: {}
method_labels: []
program_name: "default"
weather_file: "weather_alberta.nc"
weather_is_hourly: True # True/False
infrastructure_file: "facilities_alberta.csv"
site_samples: 500
subtype_file: "_placeholder_str_"
consider_weather: False # True/False
repair_delay:
type: "default" # default/list/distribution
val: [14.0]
emissions:
consider_venting: False # True/False
leak_dist_params: [-2.776, 1.462]
leak_dist_type: "lognorm"
leak_file: "_placeholder_str_"
leak_file_use: "sample" # sample/fit
LPR: 0.0065
max_leak_rate: 100000.0
subtype_leak_dist_file: "_placeholder_str_"
units: ["kilogram", "hour"]
NRd: 365
n_init_leaks: "_placeholder_int_"
n_init_days: "_placeholder_int_"
method_labels: []
economics:
carbon_price_tonnesCO2e: 40.0
cost_CCUS: 20.0
Expand Down
15 changes: 15 additions & 0 deletions LDAR_Sim/src/default_parameters/simulation_settings_default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
parameter_level: "simulation_settings"
version: "3.0"
input_directory: "./inputs"
output_directory: "./outputs"
baseline_program: P_none
reference_program: P_OGI
n_processes: 6 # Recommend: 6
n_simulations: 2
start_date: [2023, 1, 1]
end_date: [2027, 12, 31]
make_plots: True # True/False
print_from_simulations: True # True/False
write_data: True # True/False
pregenerate_leaks: True # True/False
preseed_random: False # True/False

0 comments on commit e9c542c

Please sign in to comment.