[yt-dev] Issue #916: Geometric fields cannot be used in the definition of a fluid field (yt_analysis/yt)
Nathan Goldbaum
issues-reply at bitbucket.org
Sat Oct 4 15:07:02 PDT 2014
New issue 916: Geometric fields cannot be used in the definition of a fluid field
https://bitbucket.org/yt_analysis/yt/issue/916/geometric-fields-cannot-be-used-in-the
Nathan Goldbaum:
This causes an error in the way the FITS frontend is currently setup, minimally reproducible script is here:
```
#!python
import yt
import numpy as np
ds = yt.load("xray_fits/A2052_merged_0.3-2_match-core_tmap_bgecorr.fits",
auxiliary_files=["xray_fits/A2052_core_tmap_b1_m2000_.fits"])
def _counts(field, data):
exposure_time = data.get_field_parameter("exposure_time")
return data["flux"]*data["pixel"]*exposure_time
ds.add_field(name="counts", function=_counts, units="counts", take_log=False)
```
The problem is that the `('fits', 'pixel')` field depends on the `('index', 'ones')` field, which doesn't get generated until after the `pixel` field is created.
More information about the yt-dev
mailing list