@@ -146,7 +146,7 @@ def find_field(basis, coefficients, time=0, xyz=(0, 0, 0), property='dens',
146146 else :
147147 raise ValueError ("Invalid property specified. Possible values are 'dens', 'pot', and 'force'." )
148148
149- def spherical_avg_prop (basis , coefficients , time = 0 , radius = np .linspace (0.1 , 600 , 100 ), property = 'dens' ):
149+ def spherical_avg_prop (grid , basis , coefficients , time = 0 , radius = np .linspace (0.1 , 600 , 100 ), property = 'dens' ):
150150 """
151151 Computes the spherically averaged value of the specified property of the field over the given radii.
152152
@@ -174,53 +174,15 @@ def spherical_avg_prop(basis, coefficients, time=0, radius=np.linspace(0.1, 600,
174174 ValueError:
175175 If the property argument is not 'dens', 'pot', or 'force'.
176176 """
177+ Grid3D ()
178+ fields = pyEXP .field .FieldGenerator (times , mesh )
179+ points = field .points (basis , coefs )
180+
181+ return radius , profile
177182
178- coefficients .set_coefs (coefficients .getCoefStruct (time ))
179- field = [find_field (basis , np .hstack ([[rad ], [0 ], [0 ]]), property = property , include_monopole = True ) for rad in radius ]
180-
181- if property == 'force' :
182- return np .vstack (field ), radius
183-
184- return np .array (field ), radius
185-
186-
187- def make_grid (gridtype , gridspecs , rgrid , representation = 'cartesian' ):
188- """
189- Make a variety of grids in different coordinate representations
190183
191- Parameters
192- ----------
193- gridtype:
194- npoints:
195- rgrid:
196- representation:
197184
198185
199- Returns:
200- --------
201- coordinates
202-
203- """
204-
205- if gridtype == 'spherical' :
206- arcostheta = np .linspace (- 1 , 1 , gridspecs ['theta_bins' ])
207- phi = np .linspace (0 , 2 * np .pi , gridspecs ['phi_bins' ])
208- theta_mesh , phi_mesh = np .meshgrid (np .arccos (arcostheta ), phi )
209-
210- if representation == 'cartesian' :
211- x = rgrid * np .sin (theta_mesh ) * np .cos (phi_mesh )
212- y = rgrid * np .sin (theta_mesh ) * np .sin (phi_mesh )
213- z = rgrid * np .cos (theta_mesh )
214- ## TODO: fix this return to allow the user to chose what to return
215- return np .array ([x , y , z ]), theta_mesh , phi_mesh
216-
217- elif representation == 'spherical' :
218- return np .array ([theta_mesh , phi_mesh ])
219-
220- else :
221- print ('gridtype {} not implemented' .format (gridtype ))
222- return 0
223-
224186def return_fields_in_grid (basis , coefficients , times = [0 ],
225187 projection = '3D' , proj_plane = 0 ,
226188 grid_lim = 300 , npoints = 150 ,):
0 commit comments