Skip to content

Commit

Permalink
Change MontecarloRunner so it doesn't depend on a Configuration object.
Browse files Browse the repository at this point in the history
  • Loading branch information
ftsamis committed Jul 26, 2016
1 parent 37e480a commit b5854bc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tardis/montecarlo/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ def _initialize_estimator_arrays(self, no_of_shells, tau_sobolev_shape):
self.Edotlu_estimator = np.zeros(tau_sobolev_shape)


def _initialize_geometry_arrays(self, structure):
def _initialize_geometry_arrays(self, model):
"""
Generate the cgs like geometry arrays for the montecarlo part
Parameters
----------
structure: ~ConfigurationNameSpace
model : model.Radial1DModel
"""
self.r_inner_cgs = structure.r_inner.to('cm').value
self.r_outer_cgs = structure.r_outer.to('cm').value
self.v_inner_cgs = structure.v_inner.to('cm/s').value
self.r_inner_cgs = model.r_inner.to('cm').value
self.r_outer_cgs = model.r_outer.to('cm').value
self.v_inner_cgs = model.v_inner.to('cm/s').value

def _initialize_packets(self, T, no_of_packets, no_of_virtual_packets=None):
nus, mus, energies = self.packet_source.create_packets(T, no_of_packets)
Expand Down Expand Up @@ -123,10 +123,10 @@ def run(self, model, no_of_packets, no_of_virtual_packets=0, nthreads=1,last_run
:return:
"""
self.time_of_simulation = model.time_of_simulation
self.volume = model.tardis_config.structure.volumes
self.volume = model.volume
self._initialize_estimator_arrays(self.volume.shape[0],
model.plasma.tau_sobolevs.shape)
self._initialize_geometry_arrays(model.tardis_config.structure)
self._initialize_geometry_arrays(model)

self._initialize_packets(model.t_inner.value,
no_of_packets)
Expand Down

0 comments on commit b5854bc

Please sign in to comment.