[yt-users] emission weighted temperature profile

Mateusz Ruszkowski mateuszr at umich.edu
Mon Jul 25 19:06:32 PDT 2016




Hi,

[apologies if you received this twice; I have problems with my e-mail[

I am trying to plot an emission-weighted temperature profile. The relevant part of my script and the error message are attached below. Does anybody have an idea why this is not working?

Thanks,
Mateusz


——— part of yt script ———	


from yt.analysis_modules.spectral_integrator.api import add_xray_emissivity_field

[…]

  def my_temp(field, data):
    return data['flash', 'temp']

  ds=yt.load("/nobackupnfs2/mruszkow/halo_hdf5_plt_cnt_%04i"%i)
  xray_fields = add_xray_emissivity_field(ds, with_metals=False, constant_metallicity=1.0, e_min=0.5, e_max=10.0, filename="apec_emissivity.h5")

  ds.add_field(("flash", "my_temp"),  units="code_temperature", function=my_temp)

  sp = ds.sphere([0.0,0.0,0.0], rmax)
  prof = yt.Profile1D(sp, "radius", xbins, prof_min, prof_max, True, weight_field="xray_emissivity_0.5_10_keV")  #"cell_mass")                   
  prof.add_fields(["my_temp"])


——— error message ——— 

yt : [INFO     ] 2016-07-25 17:20:54,022 Parameters: cosmological_simulation   = 0.0
yt : [INFO     ] 2016-07-25 17:20:54,023 Loading emissivity data from apec_emissivity.h5.
yt : [INFO     ] 2016-07-25 17:20:54,023 b'X-ray emissivity data calculated with APEC v. 2.0.2 on 06/24/2014 by John ZuHone.'
yt : [INFO     ] 2016-07-25 17:20:54,023 X-ray emissivity data version: 1.
yt : [WARNING  ] 2016-07-25 17:20:56,114 Could not find a field for "H_number_density". Assuming primordial H mass fraction.
Traceback (most recent call last):
 File "temperature2.py", line 64, in <module>
   prof = yt.Profile1D(sp, "radius", xbins, prof_min, prof_max, True, weight_field="xray_emissivity_0.5_10_keV")  #"cell_mass")
 File "/home3/mruszkow/yt/yt/data_objects/profiles.py", line 410, in __init__
   super(Profile1D, self).__init__(data_source, weight_field)
 File "/home3/mruszkow/yt/yt/data_objects/profiles.py", line 92, in __init__
   weight_field = self.data_source._determine_fields(weight_field)[0]
 File "/home3/mruszkow/yt/yt/data_objects/data_containers.py", line 985, in _determine_fields
   finfo = self.ds._get_field_info("unknown", fname)
 File "/home3/mruszkow/yt/yt/data_objects/static_output.py", line 616, in _get_field_info
   raise YTFieldNotFound((ftype, fname), self)
yt.utilities.exceptions.YTFieldNotFound: Could not find field '('io', 'xray_emissivity_0.5_10_keV')' in halo_hdf5_plt_cnt_0010.





More information about the yt-users mailing list