Commits

Britton Smith  committed 53e777a

Added script to get absorber dn/dz.

  • Participants
  • Parent commits 443e5b4

Comments (0)

Files changed (2)

File get_absorbers.py

-from light_ray_tools import *
    files = glob("%s/*.h5" % data_dir)
    # Resolution here is the spectral resolution.  This will determine 
    # the number of ray elements blended together to form one absorber.
    # Range is the range in log column densities to be included. 
    # Format for range is, for example, range=[14, 20].
    # If range is set to None, as it is now, all absorbers are included.
    all_absorbers(files, field, range=range,
                  resolution=5000,
                  filename=filename, **kwargs)
       mean_fields=mean_fields,
       variance_fields=variance_fields, 
       filename=output_file)
+from light_ray_tools import *
    files = glob("%s/*.h5" % data_dir)
    # Resolution here is the spectral resolution.  This will determine 
    # the number of ray elements blended together to form one absorber.
    # Range is the range in log column densities to be included. 
    # Format for range is, for example, range=[14, 20].
    # If range is set to None, as it is now, all absorbers are included.
    all_absorbers(files, field, range=range,
                  resolution=5000,
                  filename=filename, **kwargs)
       mean_fields=mean_fields,
       variance_fields=variance_fields, 
       filename=output_file)
+from lightraytools import *
    files = glob("%s/*.h5" % data_dir)
    # Resolution here is the spectral resolution.  This will determine 
    # the number of ray elements blended together to form one absorber.
    # Range is the range in log column densities to be included. 
    # Format for range is, for example, range=[14, 20].
    # If range is set to None, as it is now, all absorbers are included.
    dn, dn_bins, total_rays, total_path, field_stats = dndl_rays(files, field, bins=bins, 
                                                                 path='dz', resolution=5000,
                                                                 stats_fields=stats_fields,
                                                                 filename=filename)
    output_file = "%s/%s.h5" % (data_dir, field)
    # This is the field in the ray data that has the ion fraction.
    fraction_field = "%sIon_Fraction" % (field[0:field.find('NumberDensity')])
    # Call the above wrapper for getting dn/dz.
    # stats_fields is a list of fields for which we want the mean properties for each column density bin.
    get_dndz(data_dir, field, bins=bins, stats_fields=['Metallicity', 'Temperature', 'Density', fraction_field],
             filename=output_file)