[yt-users] emission weighted temperature profile

Mateusz Ruszkowski mateuszr at umich.edu
Wed Jul 27 10:51:52 PDT 2016



Hi John,

Turns out this was just a typo in the name of the emissivity field: xray_emissivity_0.5_10_keV —> xray_emissivity_0.5_10.0_keV.

After making this switch I was able to generator profiles with and without emissivity weighting. But I noticed, that while the regular profiles weighted by cell_volume were smooth (i.e., data was valid), the ones weighted with xray_emissivity_0.5_10.0_keV had NaNs in a number of radial locations. 

Is there a way to boost the accuracy of the computation of emissivity to prevent this from happening? I suspect that this problem has to do with the temperatures being close to the peak in the cooling curve.

Thanks,
Mateusz


> On Jul 25, 2016, at 10:24 PM, John ZuHone <jzuhone at gmail.com> wrote:
> 
> Hi Mateusz,
> 
> What version of yt is this?
> 
> Have you tried querying the sphere itself to make sure it can load the field? Just trying to isolate a possible bug...
> 
> Also, I'm curious if there is a problem with the standard "temperature" field, which should just be an alias to the FLASH "temp" field.
> 
> John
> 
> Sent from John ZuHone's iPad
> 
>> On Jul 25, 2016, at 10:06 PM, Mateusz Ruszkowski <mateuszr at umich.edu> wrote:
>> 
>> 
>> 
>> 
>> 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.
>> 
>> 
>> 
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org




More information about the yt-users mailing list