From e9ea6495b88f2e611ed45854d1a07aa14647a58d Mon Sep 17 00:00:00 2001 From: mlietzow Date: Mon, 19 Feb 2024 11:00:12 +0100 Subject: [PATCH] cleanup of polaristools --- tools/polaris_tools_modules/base.py | 18 ------------------ tools/polaris_tools_modules/model.py | 28 ---------------------------- 2 files changed, 46 deletions(-) diff --git a/tools/polaris_tools_modules/base.py b/tools/polaris_tools_modules/base.py index 8475873..98b90bb 100644 --- a/tools/polaris_tools_modules/base.py +++ b/tools/polaris_tools_modules/base.py @@ -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. diff --git a/tools/polaris_tools_modules/model.py b/tools/polaris_tools_modules/model.py index 910ceca..7b09eeb 100755 --- a/tools/polaris_tools_modules/model.py +++ b/tools/polaris_tools_modules/model.py @@ -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