Art data not implemented

18 views
Skip to first unread message

Raziq Noorali

unread,
Sep 4, 2020, 11:17:39 AM9/4/20
to trident-project-users
Hi there!

I'm trying to run the annotated example (slightly modified to include ion species) and I am getting a "NotImplementedError:". Can I get some insight on whether this is something that either I can modify or something that I would need to wait for (I don't have experience going through this code but I can give it a shot)? 

Thanks!

--
Raziq Noorali
(He/Him/His)

P.S.: If this is not the proper place for this, please let me know! On the trident webpage the Slack link is broken, but I can also create an issue on Github. 

Code: 

import yt # Version 3.7.dev0

import trident # Stable version 1.2.3

import numpy as np

from astropy.table import Table

import derived_field_CII # Just adds some custom functions

ds = yt.load(<art_data_file>)

trident.add_ion_fields(ds,ions='all')

actual_ray = trident.make_simple_ray(ds,start_position = ds.domain_left_edge,end_position = ds.domain_right_edge,data_filename="mray.h5",lines=['H'],ftype='gas')

sg = trident.SpectrumGenerator('COS-G130M')

sg.make_spectrum(actual_ray,lines=['H'])

%hist

Full Error Report: 

---------------------------------------------------------------------------

NotImplementedError                       Traceback (most recent call last)

<ipython-input-6-b8fc25231f0f> in <module>

----> 1 sg.make_spectrum(actual_ray,lines=['H'])


~/.conda/envs/ytnick/lib/python3.8/site-packages/trident/spectrum_generator.py in make_spectrum(self, ray, lines, output_file, output_absorbers_file, use_peculiar_velocity, observing_redshift, ly_continuum, store_observables, min_tau, njobs)

    430             self.add_continuum('Ly C', H_lines[0].field, 912.32336, 1.6e17, 3.0)

    431 

--> 432         AbsorptionSpectrum.make_spectrum(self, ad,

    433                                          output_file=None,

    434                                          line_list_file=None,


~/.conda/envs/ytnick/lib/python3.8/site-packages/trident/absorption_spectrum/absorption_spectrum.py in make_spectrum(self, input_object, output_file, line_list_file, output_absorbers_file, use_peculiar_velocity, store_observables, subgrid_resolution, observing_redshift, min_tau, njobs)

    485 

    486         mylog.info("Creating spectrum")

--> 487         self._add_lines_to_spectrum(field_data, use_peculiar_velocity,

    488                                     output_absorbers_file,store_observables,

    489                                     subgrid_resolution=subgrid_resolution,


~/.conda/envs/ytnick/lib/python3.8/site-packages/trident/absorption_spectrum/absorption_spectrum.py in _add_lines_to_spectrum(self, field_data, use_peculiar_velocity, output_absorbers_file, store_observables, subgrid_resolution, observing_redshift, njobs, min_tau)

    705         for store, line in parallel_objects(self.line_list, njobs=njobs,

    706                                             storage=self.line_observables_dict):

--> 707             column_density = field_data[line['field_name']] * field_data['dl']

    708             if (column_density < 0).any():

    709                 mylog.warning(


~/.conda/envs/ytnick/lib/python3.8/site-packages/yt/data_objects/data_containers.py in __getitem__(self, key)

    254                 return self.field_data[f]

    255             else:

--> 256                 self.get_data(f)

    257         # fi.units is the unit expression string. We depend on the registry

    258         # hanging off the dataset to define this unit object.


~/.conda/envs/ytnick/lib/python3.8/site-packages/yt/data_objects/data_containers.py in get_data(self, fields)

   1569         # disk, and return a dict of those fields along with the fields that

   1570         # need to be generated.

-> 1571         read_fluids, gen_fluids = self.index._read_fluid_fields(

   1572                                         fluids, self, self._current_chunk)

   1573         for f, v in read_fluids.items():


~/.conda/envs/ytnick/lib/python3.8/site-packages/yt/geometry/geometry_handler.py in _read_fluid_fields(self, fields, dobj, chunk)

    238         else:

    239             chunk_size = chunk.data_size

--> 240         fields_to_return = self.io._read_fluid_selection(

    241             self._chunk_io(dobj),

    242             selector,


~/.conda/envs/ytnick/lib/python3.8/site-packages/yt/frontends/ytdata/io.py in _read_fluid_selection(self, chunks, selector, fields, size)

    182 

    183     def _read_fluid_selection(self, chunks, selector, fields, size):

--> 184         raise NotImplementedError

    185 

    186     def _read_particle_coords(self, chunks, ptf):


NotImplementedError: 




Raziq Noorali

unread,
Sep 4, 2020, 1:25:01 PM9/4/20
to trident-project-users
Also, as I am going through this, I tested the enzo_cosmology_plus data from yt, which is used in the annotated example, which gives the following error when I try to make a simple ray: 

YTFieldNotFound: Could not find field '('gas', 'density')' in RD0009.

Thoughts?


Matthew Turk

unread,
Sep 4, 2020, 2:08:27 PM9/4/20
to Raziq Noorali, trident-project-users
Hi Raziq,

*This* one is odd.  My reading of the first issue you described was that you might have been using a DM-only ART dataset, but enzo_cosmology_plus should definitely have density.

What happens if you -- in a clean session -- look at the output of:

ds = yt.load("enzo_cosmology_plus/RD0009/RD0009") # or whatever the right fn is
ds.index
print(ds.field_list)


It should have ("gas", "density") along with ("enzo", "Density") in the list.

--
You received this message because you are subscribed to the Google Groups "trident-project-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trident-project-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trident-project-users/e19664e3-7ac5-4a50-8196-a3eda482ea7en%40googlegroups.com.

Raziq Noorali

unread,
Sep 4, 2020, 3:31:34 PM9/4/20
to trident-project-users
Hey Matthew,

Regarding the first issue, the data I'm using isn't DM-only, so at least we can rule that out, and with the second, the dataset has ("enzo", "Density") but not gas. In fact, there's no gas fields at all. I'm not sure what happened here actually.

In hindsight, I should have put this as two separate issues so it is easier to keep track of, which I can still do if you'd like. 

Thanks!

--
Raziq Noorali
(He/Him/His) 

Matthew Turk

unread,
Sep 4, 2020, 3:33:25 PM9/4/20
to Raziq Noorali, trident-project-users
It occurs to me that "gas", "density" might only show up in ds.derived_field_list ...

Raziq Noorali

unread,
Sep 4, 2020, 3:37:59 PM9/4/20
to trident-project-users
Ah yup. It exists in there. Sorry I thought I checked that I already. So  ("gas", "density") and  ("enzo", "density") exist in the dataset

Raziq Noorali

unread,
Sep 4, 2020, 3:39:58 PM9/4/20
to trident-project-users
Wait hang on, I think I think I figured something out. I think some of my custom derived fields are conflicting. Let me see if that fixes anything

Raziq Noorali

unread,
Sep 4, 2020, 4:08:31 PM9/4/20
to trident-project-users
Alright I figured out what was happening and I think I figured it out. Long story short, some of my derived fields were conflicting. Now I have a different problem but I think I can work from here. Thanks! I appreciate your time lol
Reply all
Reply to author
Forward
0 new messages