Skip to content

Commit

Permalink
started re-implementing planet phi position by rotating results
Browse files Browse the repository at this point in the history
  • Loading branch information
TomHilder committed Jul 23, 2023
1 parent b668d63 commit 1a692fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/wakeflow/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,17 +605,6 @@ def _add_non_linear_perturbations(self, NonLinearPerts : _NonLinearPerts, rho_ba
"""

nonlin = NonLinearPerts

# # Copy 2d non-linear results
# vr_2d = copy(nonlin.vr)
# vphi_2d = copy(nonlin.vphi)
# rho_2d = copy(nonlin.rho)

# # Rotate the grid as desired by the user
# if self.p.phi_planet != 0:
# vr_2d = rotate_planet(vr_2d)
# vphi_2d = rotate_planet(vphi_2d)
# rho_2d = rotate_planet(rho_2d)

# Add velocities, identical at all heights for now
nl_vr = nonlin.vr [:, np.newaxis, :]
Expand Down Expand Up @@ -702,6 +691,9 @@ def _merge_grids(self, grid_to_merge : "_Grid") -> None:
# update info
self.info["Contains"] += " AND " + g.info["Contains"]

def rotate(self, rho_background : "_Grid.rho") -> None:
pass

def _smooth_box_old(self, big_box_grid: "_Grid") -> None:
"""Under development. Smooths the solution between the linear and non-linear regimes. Currently
only smooths in v_r (it would be easy to extend to the other components if you need it).
Expand Down
4 changes: 4 additions & 0 deletions src/wakeflow/wakeflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,10 @@ def _run_wakeflow(self, params: _Parameters) -> None:
# merge grids for result
if params.include_linear:
grid_nonlin_perts._merge_grids(grid_lin_perts)

# rotate results if desired
if params.rot_interp is True:
grid_nonlin_perts.rotate(grid_background.rho)

# merge grids for results
grid_background._merge_grids(grid_nonlin_perts)
Expand Down

0 comments on commit 1a692fa

Please sign in to comment.