Ah yes, you are right that will always give me the same shape for that field. The thing is that I have tried before what you said but then I don't get the field in 3D. For example:
def _create_elec_den(ds): def _elec_den(field,data): N_A = 1/1.6726219e-24 X = 0.70 return ((data['gas','density'])*N_A*(1+X)/2/ds.quan(1,'g')) ds.add_field(('gas','elec_den'), function=_elec_den, units='1/cm**3', force_override=True)
and then: _create_elec_den(ds) cutout_obj['elec_den']
will have a shape: (85852,) and not e.g.(44,44,44). So, probably there is a proper way of doing it..
Thank you, Salome