[yt-dev] Issue #1232: Absorption Spectrum Error (Gizmo file type)? (yt_analysis/yt)

Anonymous issues-reply at bitbucket.org
Thu Jun 16 18:11:41 PDT 2016


New issue 1232: Absorption Spectrum Error (Gizmo file type)?
https://bitbucket.org/yt_analysis/yt/issues/1232/absorption-spectrum-error-gizmo-file-type

Anonymous:

I tried using the cookbook code for creating an absorption spectrum (http://yt-project.org/docs/dev/cookbook/cosmological_analysis.html#creating-and-fitting-absorption-spectra) for a Gizmo type cosmological simulation file.  I created a light ray successfully, create and absorption spectrum via sp = AbsorptionSpectrum(900.0, 1400.0, 50000), and add a HI line to 
the spectrum, following the cookbook.  But whenever I get to the line: 

wavelength, flux = sp.make_spectrum('lightray.h5',
                                    output_file='spectrum.h5',
                                    line_list_file='lines.txt',
                                    use_peculiar_velocity=True)


I get the following error:

absorption_spectrum.pyc in _add_lines_to_spectrum(self, field_data, use_peculiar_velocity, output_absorbers_file, subgrid_resolution, observing_redshift, njobs):
    444                     # edges (ie the wings), then widen the wavelength
    445                     # window and repeat process.
--> 446                     if (vtau[0] < min_tau and vtau[-1] < min_tau):
    447                         break
    448                     window_width_in_bins *= 2

IndexError: index 0 is out of bounds for axis 0 with size 0

I've looked at the source code but I can't figure out what's causing the problem.  If I do not try to add any lines to my absorption spectrum at all, then it doesn't error.  But since I'm following the cookbook code, I'm not sure what could be going wrong...

Help?  

Thanks,
Kyle Stewart




More information about the yt-dev mailing list