[pp_params] rename disk.pos_star in disk.center, in box units

This commit is contained in:
Noe Brucy
2021-04-01 16:19:36 +02:00
parent 5f57429972
commit 69c685ba14
2 changed files with 12 additions and 22 deletions
+11 -21
View File
@@ -463,7 +463,7 @@ class PostProcessor(HDF5Container):
Returns the position in normalized units centered on the position of the star
"""
pos = dset.get_cell_centers()
pos = pos - (np.array(self.pp_params.disk.pos_star) / self.lbox)
pos = pos - np.array(self.pp_params.disk.center)
return pos
def oct_getter_vect_r(self, dset, name_vect):
@@ -891,23 +891,15 @@ class PostProcessor(HDF5Container):
# Get coordinates
im_extent = np.array(self.save.root.maps._v_attrs.im_extent) * self.lbox
map_size = self.pp_params.pymses.map_size
pos_star = self.pp_params.disk.pos_star
center = self.pp_params.disk.center * self.lbox
# Physical size of cells
dx = (im_extent[1] - im_extent[0]) / map_size
dy = (im_extent[3] - im_extent[2]) / map_size
# Physical coordinates of the center of the cells
x = (
np.linspace(im_extent[0], im_extent[1], map_size)
+ 0.5 * dx
- pos_star[0]
)
y = (
np.linspace(im_extent[2], im_extent[3], map_size)
+ 0.5 * dy
- pos_star[1]
)
x = np.linspace(im_extent[0], im_extent[1], map_size) + 0.5 * dx - center[0]
y = np.linspace(im_extent[2], im_extent[3], map_size) + 0.5 * dy - center[1]
xx, yy = np.meshgrid(x, y)
rr = np.sqrt(xx ** 2 + yy ** 2)
@@ -926,14 +918,12 @@ class PostProcessor(HDF5Container):
"""
Computes radial bins (for disk)
"""
pos_star = self.pp_params.disk.pos_star
center = self.pp_params.disk.center * self.lbox
im_extent = np.array(self.save.root.maps._v_attrs.im_extent) * self.lbox
# radius of the corner of the box plus a margin
rad_of_box = (
np.sqrt(
(im_extent[1] - pos_star[0]) ** 2 + (im_extent[3] - pos_star[1]) ** 2
)
np.sqrt((im_extent[1] - center[0]) ** 2 + (im_extent[3] - center[1]) ** 2)
+ 0.1
)
@@ -969,7 +959,7 @@ class PostProcessor(HDF5Container):
"""
im_extent = np.array(self.save.root.maps._v_attrs.im_extent) * self.lbox
map_size = self.pp_params.pymses.map_size
pos_star = self.pp_params.disk.pos_star
center = self.pp_params.disk.center * self.lbox
# Physical size of cells
dx = (im_extent[1] - im_extent[0]) / map_size
@@ -982,7 +972,7 @@ class PostProcessor(HDF5Container):
xx, yy = np.meshgrid(x, y)
# Physical radius
rr = np.sqrt((xx - pos_star[0]) ** 2 + (yy - pos_star[1]) ** 2)
rr = np.sqrt((xx - center[0]) ** 2 + (yy - center[1]) ** 2)
return rr
def _bins_on_map(self, ax_los="z"):
@@ -1306,15 +1296,15 @@ class PostProcessor(HDF5Container):
# Get coordinates
im_extent = np.array(self.save.root.maps._v_attrs.im_extent) * self.lbox
map_size = self.pp_params.pymses.map_size
pos_star = self.pp_params.disk.pos_star
center = self.pp_params.disk.center * self.lbox
# Physical size of cells
dx = (im_extent[1] - im_extent[0]) / map_size
dy = (im_extent[3] - im_extent[2]) / map_size
# Physical coordinates of the center of the cells
x = np.linspace(im_extent[0], im_extent[1], map_size) + 0.5 * dx - pos_star[0]
y = np.linspace(im_extent[2], im_extent[3], map_size) + 0.5 * dy - pos_star[1]
x = np.linspace(im_extent[0], im_extent[1], map_size) + 0.5 * dx - center[0]
y = np.linspace(im_extent[2], im_extent[3], map_size) + 0.5 * dy - center[1]
xx, yy = np.meshgrid(x, y)
rr = np.sqrt(xx ** 2 + yy ** 2)