From 68bd014e91b6007a0b8899631f3667e88ccb78b5 Mon Sep 17 00:00:00 2001 From: Ran Livneh Date: Tue, 19 Jun 2018 10:36:08 +0300 Subject: [PATCH 1/9] Fix NLTE Normalization - issue #784 --- tardis/plasma/properties/partition_function.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tardis/plasma/properties/partition_function.py b/tardis/plasma/properties/partition_function.py index a9c08a161ea..88739e163f1 100644 --- a/tardis/plasma/properties/partition_function.py +++ b/tardis/plasma/properties/partition_function.py @@ -124,7 +124,7 @@ def __init__(self, plasma_parent): def _main_nlte_calculation( self, atomic_data, nlte_data, t_electrons, j_blues, beta_sobolevs, general_level_boltzmann_factor, - previous_electron_densities): + previous_electron_densities, g): """ The core of the NLTE calculation, used with all possible config. options. @@ -190,7 +190,7 @@ def _main_nlte_calculation( else: raise e general_level_boltzmann_factor[i].ix[species] = \ - level_boltzmann_factor + level_boltzmann_factor * g[species][0] / level_boltzmann_factor[0] return general_level_boltzmann_factor def _calculate_classical_nebular( @@ -232,7 +232,7 @@ def _calculate_coronal_approximation( def _calculate_general( self, t_electrons, lines, atomic_data, nlte_data, general_level_boltzmann_factor, j_blues, - previous_beta_sobolev, previous_electron_densities): + previous_beta_sobolev, previous_electron_densities, g): """ Full NLTE calculation without approximations. """ @@ -244,7 +244,7 @@ def _calculate_general( general_level_boltzmann_factor = self._main_nlte_calculation( atomic_data, nlte_data, t_electrons, j_blues, beta_sobolevs, general_level_boltzmann_factor, - previous_electron_densities) + previous_electron_densities, g) return general_level_boltzmann_factor From b54f34b5ebe6e22426d94265e8236528fabd9764 Mon Sep 17 00:00:00 2001 From: Ran Livneh Date: Tue, 19 Jun 2018 20:58:39 +0300 Subject: [PATCH 2/9] Fix NLTE Normalization - issue #784 g.loc --- tardis/plasma/properties/partition_function.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tardis/plasma/properties/partition_function.py b/tardis/plasma/properties/partition_function.py index 88739e163f1..9dfb99db645 100644 --- a/tardis/plasma/properties/partition_function.py +++ b/tardis/plasma/properties/partition_function.py @@ -190,7 +190,7 @@ def _main_nlte_calculation( else: raise e general_level_boltzmann_factor[i].ix[species] = \ - level_boltzmann_factor * g[species][0] / level_boltzmann_factor[0] + level_boltzmann_factor * g.loc[species][0] / level_boltzmann_factor[0] return general_level_boltzmann_factor def _calculate_classical_nebular( From d243f4cfe10168ce1dd06b78d30e2a358e1c9b48 Mon Sep 17 00:00:00 2001 From: Ran Livneh Date: Tue, 19 Jun 2018 21:54:03 +0300 Subject: [PATCH 3/9] Fix NLTE Normalization - issue #784 some more gs --- tardis/plasma/properties/partition_function.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tardis/plasma/properties/partition_function.py b/tardis/plasma/properties/partition_function.py index 9dfb99db645..c6ab3219f48 100644 --- a/tardis/plasma/properties/partition_function.py +++ b/tardis/plasma/properties/partition_function.py @@ -210,7 +210,7 @@ def _calculate_classical_nebular( j_blues, beta_sobolevs, general_level_boltzmann_factor, - previous_electron_densities) + previous_electron_densities, g) return general_level_boltzmann_factor def _calculate_coronal_approximation( @@ -226,7 +226,7 @@ def _calculate_coronal_approximation( general_level_boltzmann_factor = self._main_nlte_calculation( atomic_data, nlte_data, t_electrons, j_blues, beta_sobolevs, general_level_boltzmann_factor, - previous_electron_densities) + previous_electron_densities, g) return general_level_boltzmann_factor def _calculate_general( From 03c7acd1d2b9d97091753f199b39b13ef5da550f Mon Sep 17 00:00:00 2001 From: Ran Livneh Date: Tue, 19 Jun 2018 21:56:51 +0300 Subject: [PATCH 4/9] Flip g_ratio in NLTE collision matrix to fit new atomic data - issue #784 --- tardis/io/atomic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tardis/io/atomic.py b/tardis/io/atomic.py index 143c0fd6c44..c62ea261b70 100644 --- a/tardis/io/atomic.py +++ b/tardis/io/atomic.py @@ -442,7 +442,7 @@ def _create_collision_coefficient_matrix(self): C_ul_matrix[level_number_lower, level_number_upper, :] = line.values[2:] delta_E_matrix[level_number_lower, level_number_upper] = line['delta_e'] #TODO TARDISATOMIC fix change the g_ratio to be the otherway round - I flip them now here. - g_ratio_matrix[level_number_lower, level_number_upper] = line['g_ratio'] + g_ratio_matrix[level_number_lower, level_number_upper] = 1/line['g_ratio'] self.C_ul_interpolator[species] = interpolate.interp1d( self.atom_data.collision_data_temperatures, C_ul_matrix) From dff362ebde3aefce7f8fe73acce23bf64752b046 Mon Sep 17 00:00:00 2001 From: Ran Livneh Date: Tue, 19 Jun 2018 22:33:45 +0300 Subject: [PATCH 5/9] Fix NLTE Normalization - issue #784 even more gs --- tardis/plasma/properties/partition_function.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tardis/plasma/properties/partition_function.py b/tardis/plasma/properties/partition_function.py index c6ab3219f48..8a07949f7cf 100644 --- a/tardis/plasma/properties/partition_function.py +++ b/tardis/plasma/properties/partition_function.py @@ -196,7 +196,7 @@ def _main_nlte_calculation( def _calculate_classical_nebular( self, t_electrons, lines, atomic_data, nlte_data, general_level_boltzmann_factor, j_blues, - previous_electron_densities): + previous_electron_densities, g): """ Performs NLTE calculations using the classical nebular treatment. All beta sobolev values taken as 1. @@ -216,7 +216,7 @@ def _calculate_classical_nebular( def _calculate_coronal_approximation( self, t_electrons, lines, atomic_data, nlte_data, general_level_boltzmann_factor, - previous_electron_densities): + previous_electron_densities, g): """ Performs NLTE calculations using the coronal approximation. All beta sobolev values taken as 1 and j_blues taken as 0. From f8010395da466967b9fba91bd8cb658d432d61c1 Mon Sep 17 00:00:00 2001 From: chvogl Date: Mon, 29 Apr 2019 22:57:58 +0200 Subject: [PATCH 6/9] Add possibility to bias vpacket emission based on optical depth (#919) * Add possibility to bias vpacket emission based on optical depth * Make use of vpacket biasing optional * Fix cmontecarlo unit tests --- tardis/io/schemas/spectrum.yml | 5 +++++ tardis/montecarlo/montecarlo.pyx | 14 +++++++++++++ tardis/montecarlo/src/cmontecarlo.c | 31 ++++++++++++++++++++++++++--- tardis/montecarlo/src/cmontecarlo.h | 4 ++++ tardis/montecarlo/src/rpacket.c | 1 + tardis/montecarlo/src/rpacket.h | 1 + tardis/montecarlo/src/storage.h | 2 ++ tardis/montecarlo/struct.py | 9 +++++++-- tardis/montecarlo/tests/conftest.py | 8 +++++++- 9 files changed, 69 insertions(+), 6 deletions(-) diff --git a/tardis/io/schemas/spectrum.yml b/tardis/io/schemas/spectrum.yml index 0987b995b4f..8439e75c041 100644 --- a/tardis/io/schemas/spectrum.yml +++ b/tardis/io/schemas/spectrum.yml @@ -45,3 +45,8 @@ properties: type: number default: 0.0 description: Probability for not terminating the packet path + enable_biasing: + type: boolean + default: False + description: If True bias v-packet emission based on the electron + scattering optical depth diff --git a/tardis/montecarlo/montecarlo.pyx b/tardis/montecarlo/montecarlo.pyx index 81663e1b657..e3ac6e42f58 100644 --- a/tardis/montecarlo/montecarlo.pyx +++ b/tardis/montecarlo/montecarlo.pyx @@ -120,6 +120,8 @@ cdef extern from "src/cmontecarlo.h": int full_relativity double survival_probability double tau_russian + double *tau_bias + int enable_biasing void montecarlo_main_loop(storage_model_t * storage, int_type_t virtual_packet_flag, int nthreads, unsigned long seed) @@ -259,6 +261,18 @@ cdef initialize_storage_model(model, plasma, runner, storage_model_t *storage): storage.tau_russian = runner.v_packet_settings['tau_russian'] storage.survival_probability = runner.v_packet_settings['survival_probability'] + storage.enable_biasing = runner.v_packet_settings['enable_biasing'] + + if runner.v_packet_settings['enable_biasing']: + # Calculate the integrated electron scattering optical depth + # at all cell interfaces. + runner.tau_bias = np.zeros(len(runner.r_inner_cgs) + 1) + runner.tau_bias[:-1] = ( + ((runner.r_outer_cgs - runner.r_inner_cgs) * + plasma.electron_densities.values * + runner.sigma_thomson.cgs.value)[::-1].cumsum()[::-1] + ) + storage.tau_bias = PyArray_DATA(runner.tau_bias) # Data for continuum implementation cdef np.ndarray[double, ndim=1] t_electrons = plasma.t_electrons diff --git a/tardis/montecarlo/src/cmontecarlo.c b/tardis/montecarlo/src/cmontecarlo.c index 06cf29e53bf..41441d8d363 100644 --- a/tardis/montecarlo/src/cmontecarlo.c +++ b/tardis/montecarlo/src/cmontecarlo.c @@ -832,7 +832,7 @@ montecarlo_thomson_scatter (rpacket_t * packet, storage_model_t * storage, if (rpacket_get_virtual_packet_flag (packet) > 0) { - montecarlo_one_packet (storage, packet, 1, mt_state); + create_vpacket (storage, packet, mt_state); } } @@ -1011,7 +1011,7 @@ line_emission (rpacket_t * packet, storage_model_t * storage, int64_t emission_l // QUESTIONABLE!!! bool old_close_line = rpacket_get_close_line (packet); rpacket_set_close_line (packet, virtual_close_line); - montecarlo_one_packet (storage, packet, 1, mt_state); + create_vpacket (storage, packet, mt_state); rpacket_set_close_line (packet, old_close_line); virtual_close_line = false; } @@ -1052,7 +1052,7 @@ continuum_emission (rpacket_t * packet, storage_model_t * storage, rk_state *mt_ if (rpacket_get_virtual_packet_flag (packet) > 0) { - montecarlo_one_packet (storage, packet, 1, mt_state); + create_vpacket (storage, packet, mt_state); } } @@ -1264,3 +1264,28 @@ montecarlo_main_loop(storage_model_t * storage, int64_t virtual_packet_flag, int print_progress(storage->no_of_packets, storage->no_of_packets); fprintf(stderr,"\n"); } + +void +create_vpacket (storage_model_t * storage, rpacket_t * packet, + rk_state *mt_state) +{ + if (storage->enable_biasing) + { + int64_t shell_id = rpacket_get_current_shell_id(packet); + double tau_bias = (storage->tau_bias[shell_id + 1] + + (storage->tau_bias[shell_id] - storage->tau_bias[shell_id + 1]) * + (storage->r_outer[shell_id] - rpacket_get_r (packet)) / + (storage->r_outer[shell_id] - storage->r_inner[shell_id])); + double vpacket_prob = exp(-tau_bias); + double event_random = rk_double (mt_state); + if (event_random < vpacket_prob) + { + packet->vpacket_weight = 1. / vpacket_prob; + montecarlo_one_packet (storage, packet, 1, mt_state); + } + } + else + { + montecarlo_one_packet (storage, packet, 1, mt_state); + } +} diff --git a/tardis/montecarlo/src/cmontecarlo.h b/tardis/montecarlo/src/cmontecarlo.h index c4521ca28eb..767017b7303 100644 --- a/tardis/montecarlo/src/cmontecarlo.h +++ b/tardis/montecarlo/src/cmontecarlo.h @@ -152,4 +152,8 @@ double sample_nu_free_bound(const rpacket_t * packet, const storage_model_t * st void continuum_emission(rpacket_t * packet, storage_model_t * storage, rk_state *mt_state, pt2sample_nu sample_nu_continuum, int64_t emission_type_id); +void +create_vpacket (storage_model_t * storage, rpacket_t * packet, + rk_state *mt_state); + #endif // TARDIS_CMONTECARLO_H diff --git a/tardis/montecarlo/src/rpacket.c b/tardis/montecarlo/src/rpacket.c index 0ca33211af4..cb52cddc698 100644 --- a/tardis/montecarlo/src/rpacket.c +++ b/tardis/montecarlo/src/rpacket.c @@ -50,5 +50,6 @@ rpacket_init (rpacket_t * packet, storage_model_t * storage, int packet_index, rpacket_set_virtual_packet_flag (packet, virtual_packet_flag); packet->chi_bf_tmp_partial = chi_bf_tmp_partial; packet->compute_chi_bf = true; + packet->vpacket_weight = 1.0; return ret_val; } diff --git a/tardis/montecarlo/src/rpacket.h b/tardis/montecarlo/src/rpacket.h index e6138fdd707..2a30546a837 100644 --- a/tardis/montecarlo/src/rpacket.h +++ b/tardis/montecarlo/src/rpacket.h @@ -60,6 +60,7 @@ typedef struct RPacket double *chi_bf_tmp_partial; int64_t macro_atom_activation_level; bool compute_chi_bf; + double vpacket_weight; } rpacket_t; static inline double rpacket_get_nu (const rpacket_t * packet) diff --git a/tardis/montecarlo/src/storage.h b/tardis/montecarlo/src/storage.h index b47f7af6b20..a408a9f7bc2 100644 --- a/tardis/montecarlo/src/storage.h +++ b/tardis/montecarlo/src/storage.h @@ -95,6 +95,8 @@ typedef struct StorageModel int full_relativity; double survival_probability; double tau_russian; + double *tau_bias; + int enable_biasing; } storage_model_t; #endif // TARDIS_STORAGE_H diff --git a/tardis/montecarlo/struct.py b/tardis/montecarlo/struct.py index 9e3054aa039..80f4b95c015 100644 --- a/tardis/montecarlo/struct.py +++ b/tardis/montecarlo/struct.py @@ -34,7 +34,8 @@ class RPacket(Structure): ('chi_bf', c_double), ('chi_bf_tmp_partial', POINTER(c_double)), ('macro_atom_activation_level', c_int64), - ('compute_chi_bf', c_bool) + ('compute_chi_bf', c_bool), + ('vpacket_weight', c_double) ] @@ -126,7 +127,11 @@ class StorageModel(Structure): ('bf_heating_estimator', POINTER(c_double)), ('ff_heating_estimator', POINTER(c_double)), ('stim_recomb_cooling_estimator', POINTER(c_double)), - ('full_relativity', c_int) + ('full_relativity', c_int), + ('survival_probability',c_double), + ('tau_russian', c_double), + ('tau_bias', POINTER(c_double)), + ('enable_biasing', c_int) ] diff --git a/tardis/montecarlo/tests/conftest.py b/tardis/montecarlo/tests/conftest.py index 792cb35a8ce..13cca00085e 100644 --- a/tardis/montecarlo/tests/conftest.py +++ b/tardis/montecarlo/tests/conftest.py @@ -46,7 +46,8 @@ def packet(): id=0, chi_cont=6.652486e-16, chi_bf_tmp_partial=(c_double * 2)(), - compute_chi_bf=True + compute_chi_bf=True, + vpacket_weight=1.0 ) @@ -120,6 +121,11 @@ def model(): bf_treatment=BoundFreeTreatment.LIN_INTERPOLATION.value, ff_heating_estimator=(c_double * 2)(*([0.0] * 2)), cont_edge2macro_level=(c_int64 * 6)(*([1] * 6)), + + survival_probability=0.0, + tau_russian=10.0, + tau_bias=(c_double * 3)(*([5.0, 0.5, 0.0])), + enable_biasing=0 ) From de83a13509ef5c90630df694e50b5bb76ecf6d72 Mon Sep 17 00:00:00 2001 From: Wolfgang Kerzendorf Date: Mon, 29 Apr 2019 17:19:34 -0400 Subject: [PATCH 7/9] add changes builder to travis process (#921) --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8487864eef6..cf227eb9146 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,6 +53,9 @@ script: - echo CC=$COMPILER python setup.py $SETUP_CMD - CC=$COMPILER python setup.py $SETUP_CMD - set -e + - conda install -y -c conda-forge nodejs + - npm install -g github-changes + - github-changes -o tardis-sn -r tardis --only-pulls --use-commit-body -f CHANGELOG.rst -k $GITHUB_CHANGES_OAUTH - python setup.py build_docs - pip install doctr - git lfs uninstall From fd57afc26546a9ae9c7fbe3d2c7b14e794c7b560 Mon Sep 17 00:00:00 2001 From: Wolfgang Kerzendorf Date: Mon, 29 Apr 2019 17:28:08 -0400 Subject: [PATCH 8/9] Fix nlte normalization (#920) * Fix NLTE Normalization - issue #784 * Fix NLTE Normalization - issue #784 g.loc * Fix NLTE Normalization - issue #784 some more gs * Flip g_ratio in NLTE collision matrix to fit new atomic data - issue #784 * Fix NLTE Normalization - issue #784 even more gs --- tardis/io/atomic.py | 2 +- tardis/plasma/properties/partition_function.py | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tardis/io/atomic.py b/tardis/io/atomic.py index a76174036a6..3ab59be373a 100644 --- a/tardis/io/atomic.py +++ b/tardis/io/atomic.py @@ -452,7 +452,7 @@ def _create_collision_coefficient_matrix(self): C_ul_matrix[level_number_lower, level_number_upper, :] = line.values[2:] delta_E_matrix[level_number_lower, level_number_upper] = line['delta_e'] #TODO TARDISATOMIC fix change the g_ratio to be the otherway round - I flip them now here. - g_ratio_matrix[level_number_lower, level_number_upper] = line['g_ratio'] + g_ratio_matrix[level_number_lower, level_number_upper] = 1/line['g_ratio'] self.C_ul_interpolator[species] = interpolate.interp1d( self.atom_data.collision_data_temperatures, C_ul_matrix) diff --git a/tardis/plasma/properties/partition_function.py b/tardis/plasma/properties/partition_function.py index 058dcb17bd1..cb209a123b2 100644 --- a/tardis/plasma/properties/partition_function.py +++ b/tardis/plasma/properties/partition_function.py @@ -124,7 +124,7 @@ def __init__(self, plasma_parent): def _main_nlte_calculation( self, atomic_data, nlte_data, t_electrons, j_blues, beta_sobolevs, general_level_boltzmann_factor, - previous_electron_densities): + previous_electron_densities, g): """ The core of the NLTE calculation, used with all possible config. options. @@ -189,14 +189,14 @@ def _main_nlte_calculation( 'collision data?') else: raise e - general_level_boltzmann_factor[i].loc[species] = \ - level_boltzmann_factor + general_level_boltzmann_factor[i].ix[species] = \ + level_boltzmann_factor * g.loc[species][0] / level_boltzmann_factor[0] return general_level_boltzmann_factor def _calculate_classical_nebular( self, t_electrons, lines, atomic_data, nlte_data, general_level_boltzmann_factor, j_blues, - previous_electron_densities): + previous_electron_densities, g): """ Performs NLTE calculations using the classical nebular treatment. All beta sobolev values taken as 1. @@ -210,13 +210,13 @@ def _calculate_classical_nebular( j_blues, beta_sobolevs, general_level_boltzmann_factor, - previous_electron_densities) + previous_electron_densities, g) return general_level_boltzmann_factor def _calculate_coronal_approximation( self, t_electrons, lines, atomic_data, nlte_data, general_level_boltzmann_factor, - previous_electron_densities): + previous_electron_densities, g): """ Performs NLTE calculations using the coronal approximation. All beta sobolev values taken as 1 and j_blues taken as 0. @@ -226,13 +226,13 @@ def _calculate_coronal_approximation( general_level_boltzmann_factor = self._main_nlte_calculation( atomic_data, nlte_data, t_electrons, j_blues, beta_sobolevs, general_level_boltzmann_factor, - previous_electron_densities) + previous_electron_densities, g) return general_level_boltzmann_factor def _calculate_general( self, t_electrons, lines, atomic_data, nlte_data, general_level_boltzmann_factor, j_blues, - previous_beta_sobolev, previous_electron_densities): + previous_beta_sobolev, previous_electron_densities, g): """ Full NLTE calculation without approximations. """ @@ -244,7 +244,7 @@ def _calculate_general( general_level_boltzmann_factor = self._main_nlte_calculation( atomic_data, nlte_data, t_electrons, j_blues, beta_sobolevs, general_level_boltzmann_factor, - previous_electron_densities) + previous_electron_densities, g) return general_level_boltzmann_factor From 6ecdd1e98cd3e5ff4a78fbacfd0a7e3caf0ec30e Mon Sep 17 00:00:00 2001 From: Wolfgang Kerzendorf Date: Mon, 29 Apr 2019 17:31:53 -0400 Subject: [PATCH 9/9] Revert "Fix nlte normalization (#920)" (#922) This reverts commit fd57afc26546a9ae9c7fbe3d2c7b14e794c7b560. --- tardis/io/atomic.py | 2 +- tardis/plasma/properties/partition_function.py | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tardis/io/atomic.py b/tardis/io/atomic.py index 3ab59be373a..a76174036a6 100644 --- a/tardis/io/atomic.py +++ b/tardis/io/atomic.py @@ -452,7 +452,7 @@ def _create_collision_coefficient_matrix(self): C_ul_matrix[level_number_lower, level_number_upper, :] = line.values[2:] delta_E_matrix[level_number_lower, level_number_upper] = line['delta_e'] #TODO TARDISATOMIC fix change the g_ratio to be the otherway round - I flip them now here. - g_ratio_matrix[level_number_lower, level_number_upper] = 1/line['g_ratio'] + g_ratio_matrix[level_number_lower, level_number_upper] = line['g_ratio'] self.C_ul_interpolator[species] = interpolate.interp1d( self.atom_data.collision_data_temperatures, C_ul_matrix) diff --git a/tardis/plasma/properties/partition_function.py b/tardis/plasma/properties/partition_function.py index cb209a123b2..058dcb17bd1 100644 --- a/tardis/plasma/properties/partition_function.py +++ b/tardis/plasma/properties/partition_function.py @@ -124,7 +124,7 @@ def __init__(self, plasma_parent): def _main_nlte_calculation( self, atomic_data, nlte_data, t_electrons, j_blues, beta_sobolevs, general_level_boltzmann_factor, - previous_electron_densities, g): + previous_electron_densities): """ The core of the NLTE calculation, used with all possible config. options. @@ -189,14 +189,14 @@ def _main_nlte_calculation( 'collision data?') else: raise e - general_level_boltzmann_factor[i].ix[species] = \ - level_boltzmann_factor * g.loc[species][0] / level_boltzmann_factor[0] + general_level_boltzmann_factor[i].loc[species] = \ + level_boltzmann_factor return general_level_boltzmann_factor def _calculate_classical_nebular( self, t_electrons, lines, atomic_data, nlte_data, general_level_boltzmann_factor, j_blues, - previous_electron_densities, g): + previous_electron_densities): """ Performs NLTE calculations using the classical nebular treatment. All beta sobolev values taken as 1. @@ -210,13 +210,13 @@ def _calculate_classical_nebular( j_blues, beta_sobolevs, general_level_boltzmann_factor, - previous_electron_densities, g) + previous_electron_densities) return general_level_boltzmann_factor def _calculate_coronal_approximation( self, t_electrons, lines, atomic_data, nlte_data, general_level_boltzmann_factor, - previous_electron_densities, g): + previous_electron_densities): """ Performs NLTE calculations using the coronal approximation. All beta sobolev values taken as 1 and j_blues taken as 0. @@ -226,13 +226,13 @@ def _calculate_coronal_approximation( general_level_boltzmann_factor = self._main_nlte_calculation( atomic_data, nlte_data, t_electrons, j_blues, beta_sobolevs, general_level_boltzmann_factor, - previous_electron_densities, g) + previous_electron_densities) return general_level_boltzmann_factor def _calculate_general( self, t_electrons, lines, atomic_data, nlte_data, general_level_boltzmann_factor, j_blues, - previous_beta_sobolev, previous_electron_densities, g): + previous_beta_sobolev, previous_electron_densities): """ Full NLTE calculation without approximations. """ @@ -244,7 +244,7 @@ def _calculate_general( general_level_boltzmann_factor = self._main_nlte_calculation( atomic_data, nlte_data, t_electrons, j_blues, beta_sobolevs, general_level_boltzmann_factor, - previous_electron_densities, g) + previous_electron_densities) return general_level_boltzmann_factor