MCPcopy Create free account
hub / github.com/AMReX-Astro/Castro / get_width

Function get_width

Exec/science/flame_wave/analysis/plot_generator.py:160–180  ·  view source on GitHub ↗

Get the width of the plot.

(ds, xlim=None, ylim=None, zlim=None)

Source from the content-addressed store, hash-verified

158field = args.var
159
160def get_width(ds, xlim=None, ylim=None, zlim=None):
161 """ Get the width of the plot. """
162
163 if xlim is None: xlim = ds.domain_left_edge[0], ds.domain_right_edge[0]
164 else: xlim = xlim[0] * cm, xlim[1] * cm
165
166 if ylim is None: ylim = ds.domain_left_edge[1], ds.domain_right_edge[1]
167 else: ylim = ylim[0] * cm, ylim[1] * cm
168
169 xwidth = (xlim[1] - xlim[0]).in_cgs()
170 ywidth = (ylim[1] - ylim[0]).in_cgs()
171
172 if ds.domain_dimensions[2] == 1:
173 zwidth = 0.0
174 else:
175 if zlim is None: zlim = ds.domain_left_edge[2], ds.domain_right_edge[2]
176 else: zlim = zlim[0] * cm, zlim[1] * cm
177
178 zwidth = (zlim[1] - zlim[0]).in_cgs()
179
180 return xwidth, ywidth, zwidth
181
182def get_center(ds, xlim=None, ylim=None, zlim=None):
183 """ Get the coordinates of the center of the plot. """

Callers 1

plot_generator.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected