diff --git a/docs/workflows/v_inner_solver_workflow.ipynb b/docs/workflows/v_inner_solver_workflow.ipynb index f52d347223f..e1cf9507447 100644 --- a/docs/workflows/v_inner_solver_workflow.ipynb +++ b/docs/workflows/v_inner_solver_workflow.ipynb @@ -19,6 +19,14 @@ "config = Configuration.from_yaml('../tardis_example.yml')" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This code modifies the TARDIS example configuration to include convergence information for the inner boundary velocity solver.\n", + "Note that the number of shells is increased and the starting velocity is reduced to provide more granularity and a wider search window, respectively." + ] + }, { "cell_type": "code", "execution_count": null, diff --git a/tardis/workflows/v_inner_solver.py b/tardis/workflows/v_inner_solver.py index 039574b4bd9..2bf8af29ccf 100644 --- a/tardis/workflows/v_inner_solver.py +++ b/tardis/workflows/v_inner_solver.py @@ -112,38 +112,38 @@ def get_convergence_estimates(self, transport_state): return estimates - def reproject(self, a1, m1, a2, m2): + def reproject(self, array_one, mask_one, array_two, mask_two): """Reprojects two sub_arrays defined by a set of masks onto an array where the masks of both objects are true let A1, A2 be arrays of size gemetry.no_of_shells and - a1 = A1[m1], - a2 = A2[m2] + a1 = A1[mask_one], + a2 = A2[mask_two] find a1*, a2* s.t. - a1* = A1[m1 & m2], - a2* = A2[m1 & m2] + a1* = A1[mask_one & mask_two], + a2* = A2[mask_one & mask_two] this is equivalent to - a1* = A1[m1][m2[m1]] = a1[m2[m1]], - a2* = A2[m2][m1[m2]] = a2[m1[m2]] + a1* = A1[mask_one][mask_two[mask_one]] = a1[mask_two[mask_one]], + a2* = A2[mask_two][mask_one[mask_two]] = a2[mask_one[mask_two]] Parameters ---------- - a1 : np.ndarray + array1 : np.ndarray A sub array of an array with the shape of a geometry property - m1 : np.ndarray(bool) + mask_one : np.ndarray(bool) Mask such that the parrent array accessed at this mask gives a1 - a2 : np.ndarray + array_two : np.ndarray A sub array of an array with the shape of a geometry property - m2 : np.ndarray(bool) + mask_two : np.ndarray(bool) Mask such that the parrent array accessed at this mask gives a2 Returns ------- - a1* - reprojection of a1 onto m1 & m2 - a2* - reprojection of a2 onto m1 & m2 + array_one* + reprojection of array_one onto mask_one & mask_two + array_two* + reprojection of array_two onto mask_one & mask_two """ - return a1[m2[m1]], a2[m1[m2]] + return array_one[mask_two[mask_one]], array_two[mask_one[mask_two]] def print_mask(self, mask): return "".join([{True: "-", False: "X"}[m] for m in mask]).join("[]")