Hello everyone! I am trying to create radial profile of a halo. I can create e.g. temperature, density, B profile but if I add a new field then it does not give me the profile; The code is here: ----------------- ds = yt.load('Dataset') dd = ds.all_data() Halo_ds = "catalog.h5" File = h5py.File(Halo_ds, 'r') n = 0 radius = File["virial_radius"][n]/float(ds.domain_width.in_units("cm")[0]) #code units x = File["particle_position_x"][n]/float(ds.domain_width.in_units("cm")[0]) #Code units y = File["particle_position_y"][n]/float(ds.domain_width.in_units("cm")[0]) z = File["particle_position_z"][n]/float(ds.domain_width.in_units("cm")[0]) center = ds.arr([x, y, z], 'code_length') rvir = radius sph = ds.sphere(center, rvir) #Define new field B = dd['gas','magnetic_field_magnitude'] B_f = B - B.mean() def _B_fluc(field, dd): return (B_f) ds.add_field(("gas", "B_fluc"), function=_B_fluc, units="gauss") prof = yt.create_profile(sph, ["radius"], fields=["B_fluc"], n_bins=64) -------------------------------------- The error is: "Profile fields must have same shape: ('index', 'radius') has shape (6530,) and ('gas', 'B_flucc') has shape (9533574,)." So, I am wondering, is there a way to define this added field only inside the sphere?