Skip to content

Commit

Permalink
cleanup of polaristools
Browse files Browse the repository at this point in the history
  • Loading branch information
mlietzow committed Feb 19, 2024
1 parent 354898e commit e9ea649
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 46 deletions.
18 changes: 0 additions & 18 deletions tools/polaris_tools_modules/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,24 +188,6 @@ def get_dz(self, radius):
"""
return 10. * self.get_scale_height(radius) / self.cylindrical_parameter['n_z']

def adjust_extent(self, sidelength_x, sidelength_y):
"""Adjust the extent of the model.
Args:
sidelength_x (float): New x-axis extent.
sidelength_y (float): New y-axis extent.
"""
factor_x = (0.5 * sidelength_x) / self.tmp_parameter['radius_x_m']
factor_y = (0.5 * sidelength_y) / self.tmp_parameter['radius_y_m']
self.tmp_parameter['radius_x_m'] *= factor_x
self.tmp_parameter['radius_y_m'] *= factor_y
self.tmp_parameter['radius_x_arcsec'] *= factor_x
self.tmp_parameter['radius_y_arcsec'] *= factor_y
self.tmp_parameter['radius_x_au'] *= factor_x
self.tmp_parameter['radius_y_au'] *= factor_y
self.tmp_parameter['radius_x_pc'] *= factor_x
self.tmp_parameter['radius_y_pc'] *= factor_y

def adjust(self, value, name):
"""Adjust a parameter of the model.
Expand Down
28 changes: 0 additions & 28 deletions tools/polaris_tools_modules/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,34 +110,6 @@ def get_module(self):
if model.cylindrical_parameter['z_max'] is None:
model.cylindrical_parameter['z_max'] = model.parameter['outer_radius']

# Convert radius in various units
if model.parameter['grid_type'] == 'octree':
model.tmp_parameter['radius_x_m'] = model.octree_parameter['sidelength'] / 2.
model.tmp_parameter['radius_y_m'] = model.octree_parameter['sidelength'] / 2.
elif model.parameter['grid_type'] == 'spherical':
model.tmp_parameter['radius_x_m'] = model.spherical_parameter['outer_radius']
model.tmp_parameter['radius_y_m'] = model.spherical_parameter['outer_radius']
elif model.parameter['grid_type'] == 'cylindrical':
model.tmp_parameter['radius_x_m'] = model.cylindrical_parameter['outer_radius']
model.tmp_parameter['radius_y_m'] = model.cylindrical_parameter['outer_radius']
else:
raise ValueError('Grid type not known!')

model.tmp_parameter['radius_x_arcsec'] = self.math.length_conv(
model.tmp_parameter['radius_x_m'], 'arcsec', model.parameter['distance'])
model.tmp_parameter['radius_y_arcsec'] = self.math.length_conv(
model.tmp_parameter['radius_y_m'], 'arcsec', model.parameter['distance'])
model.tmp_parameter['radius_x_pc'] = self.math.length_conv(
model.tmp_parameter['radius_x_m'], 'pc')
model.tmp_parameter['radius_y_pc'] = self.math.length_conv(
model.tmp_parameter['radius_y_m'], 'pc')
model.tmp_parameter['radius_x_au'] = self.math.length_conv(
model.tmp_parameter['radius_x_m'], 'au')
model.tmp_parameter['radius_y_au'] = self.math.length_conv(
model.tmp_parameter['radius_y_m'], 'au')
model.tmp_parameter['radius_x_ae'] = model.tmp_parameter['radius_x_au']
model.tmp_parameter['radius_y_ae'] = model.tmp_parameter['radius_y_au']

return model


Expand Down

0 comments on commit e9ea649

Please sign in to comment.