[Yt-svn] commit/yt: 2 new changesets
Bitbucket
commits-noreply at bitbucket.org
Tue Jun 7 12:02:57 PDT 2011
2 new changesets in yt:
http://bitbucket.org/yt_analysis/yt/changeset/837062b38547/
changeset: 837062b38547
branch: yt
user: Cameron Hummels
date: 2011-06-07 21:02:41
summary: Providing more information to user during bugreport process.
affected #: 1 file (1.2 KB)
--- a/yt/utilities/command_line.py Mon Jun 06 12:00:56 2011 -0700
+++ b/yt/utilities/command_line.py Tue Jun 07 15:02:41 2011 -0400
@@ -652,13 +652,30 @@
print "Hi there! Welcome to the yt bugreport taker."
print
print "==============================================================="
+ print "At any time in advance of the upload of the bug, you should feel free"
+ print "to ctrl-C out and submit the bug report manually by going here:"
+ print " http://hg.enzotools.org/yt/issues/new"
+ print
+ print "Also, in order to submit a bug through this interface, you"
+ print "need a Bitbucket account. If you don't have one, exit this "
+ print "bugreport now and run the 'yt bootstrap_dev' command to create one."
print
- print "At any time in advance of the upload of the bug, you"
- print "should feel free to ctrl-C out and submit the bug "
- print "report manually by going here:"
- print " http://hg.enzotools.org/yt/issues/new"
+ print "Have you checked the existing bug reports to make"
+ print "sure your bug has not already been recorded by someone else?"
+ print " http://hg.enzotools.org/yt/issues?status=new&status=open"
print
- print "First off, how about a nice, pithy summary of the bug?"
+ print "Finally, are you sure that your bug is, in fact, a bug? It might"
+ print "simply be a misunderstanding that could be cleared up by"
+ print "visiting the yt irc channel or getting advice on the email list:"
+ print " http://yt.enzotools.org/irc.html"
+ print " http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org"
+ print
+ summary = raw_input("Press <enter> if you remain firm in your conviction to continue.")
+ print
+ print
+ print "Okay, sorry about that. How about a nice, pithy ( < 12 words )"
+ print "summary of the bug? (e.g. 'Particle overlay problem with parallel "
+ print "projections')"
print
try:
current_version = get_yt_version()
@@ -667,11 +684,12 @@
summary = raw_input("Summary? ")
bugtype = "bug"
data = dict(title = summary, type=bugtype)
+ print
print "Okay, now let's get a bit more information."
print
print "Remember that if you want to submit a traceback, you can run"
print "any script with --paste or --detailed-paste to submit it to"
- print "the pastebin."
+ print "the pastebin and then include the link in this bugreport."
if "EDITOR" in os.environ:
print
print "Press enter to spawn your editor, %s" % os.environ["EDITOR"]
@@ -728,7 +746,8 @@
print
print "==============================================================="
print
- print "Thanks for your bug report! You can view it here:"
+ print "Thanks for your bug report! Together we'll make yt totally bug free!"
+ print "You can view bug report here:"
print " %s" % url
print
print "Keep in touch!"
http://bitbucket.org/yt_analysis/yt/changeset/14c9a56086d0/
changeset: 14c9a56086d0
branch: yt
user: Cameron Hummels
date: 2011-06-07 21:02:53
summary: Merging.
affected #: 14 files (40.7 KB)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/yt/analysis_modules/absorption_spectrum/__init__.py Tue Jun 07 15:02:53 2011 -0400
@@ -0,0 +1,25 @@
+"""
+Import stuff for light cone generator.
+
+Author: Britton Smith <brittons at origins.colorado.edu>
+Affiliation: CASA/University of CO, Boulder
+Homepage: http://yt.enzotools.org/
+License:
+ Copyright (C) 2008-2011 Britton Smith. All Rights Reserved.
+
+ This file is part of yt.
+
+ yt is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+"""
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/yt/analysis_modules/absorption_spectrum/absorption_line.py Tue Jun 07 15:02:53 2011 -0400
@@ -0,0 +1,210 @@
+"""
+Absorption line generating functions.
+
+Author: Britton Smith <brittonsmith at gmail.com>
+Affiliation: Michigan State University
+Homepage: http://yt.enzotools.org/
+License:
+ Copyright (C) 2008-2011 Britton Smith. All Rights Reserved.
+
+ This file is part of yt.
+
+ yt is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+"""
+
+import numpy as na
+
+def voigt(a,u):
+ """
+ NAME:
+ VOIGT
+ PURPOSE:
+ Implementation of Voigt function
+ CATEGORY:
+ Math
+ CALLING SEQUENCE:
+ voigt=Voigt(a,u)
+ INPUTS:
+ A = Voigt "A" parameter.
+ U = Frequency in units of the Doppler frequency.
+
+ The line profile "Phi(v)", the doppler width
+ "Delv", the voigt parameter "a", and the frequency "u"
+ are given by:
+
+ Phi(v) = Voigt(a,u)/[ Delv * sqrt(pi) ]
+ Delv = Vo/c * sqrt[ 2kT/m ]
+ u = V - Vo / Delv
+ a = GAMMA / [ Delv * 4pi ]
+ Gamma = Gu + Gl + 2*Vcol
+ "Gu" and "Gl" are the widths of the upper and lower states
+ "Vcol" is the collisions per unit time
+ "Vo" is the line center frequency
+
+ OUTPUTS:
+ An array of the same type as u
+ RESTRICTIONS:
+ U must be an array, a should not be. Also this procedure is only valid
+ for the region a<1.0, u<4.0 or a<1.8(u+1), u>4, which should be most
+ astrophysical conditions (see the article below for further comments
+ PROCEDURE:
+ Follows procedure in Armstrong JQSRT 7, 85 (1967)
+ also the same as the intrinsic in the previous version of IDL
+ MODIFICATION HISTORY:
+ J. Murthy, Mar 1990 (adapted from the FORTRAN program of Armstrong)
+ Sep 1990 (better overflow checking)
+ """
+ x = na.asarray(u).astype(na.float64)
+ y = na.asarray(a).astype(na.float64)
+
+ w = na.array([0.462243670, 0.286675505, 0.109017206,
+ 0.0248105209, 0.00324377334, 0.000228338636,
+ 7.80255648e-6, 1.08606937e-7, 4.39934099e-10,
+ 2.22939365e-13])
+
+ t = na.array([0.245340708, 0.737473729, 1.23407622, 1.73853771,
+ 2.25497400, 2.78880606, 3.34785457, 3.94476404,
+ 4.60368245, 5.38748089])
+
+ # Hummer's Chebyshev Coefficients
+ c = ( 0.1999999999972224, -0.1840000000029998, 0.1558399999965025,
+ -0.1216640000043988, 0.0877081599940391, -0.0585141248086907,
+ 0.0362157301623914, -0.0208497654398036, 0.0111960116346270,
+ -0.56231896167109e-2, 0.26487634172265e-2, -0.11732670757704e-2,
+ 0.4899519978088e-3, -0.1933630801528e-3, 0.722877446788e-4,
+ -0.256555124979e-4, 0.86620736841e-5, -0.27876379719e-5,
+ 0.8566873627e-6, -0.2518433784e-6, 0.709360221e-7,
+ -0.191732257e-7, 0.49801256e-8, -0.12447734e-8,
+ 0.2997777e-9, -0.696450e-10, 0.156262e-10,
+ -0.33897e-11, 0.7116e-12, -0.1447e-12,
+ 0.285e-13, -0.55e-14, 0.10e-14,
+ -0.2e-15)
+
+ y2 = y * y
+
+ # limits are y<1., x<4 or y<1.8(x+1), x>4 (no checking performed)
+ u1 = na.exp(-x * x + y2) * na.cos(2. * x * y)
+
+ # Clenshaw's Algorithm
+ bno1 = na.zeros(x.shape)
+ bno2 = na.zeros(x.shape)
+ x1 = na.clip((x / 5.), -na.inf, 1.)
+ coef = 4. * x1 * x1 - 2.
+ for i in range(33, -1, -1):
+ bn = coef * bno1 - bno2 + c[i]
+ bno2 = na.copy(bno1)
+ bno1 = na.copy(bn)
+
+ f = x1 * (bn - bno2)
+ dno1 = 1. - 2. * x * f
+ dno2 = f
+
+ q = x > 5
+ if q.any():
+ x14 = na.power(na.clip(x[q], -na.inf, 500.), 14)
+ x12 = na.power(na.clip(x[q], -na.inf, 1000.), 12)
+ x10 = na.power(na.clip(x[q], -na.inf, 5000.), 10)
+ x8 = na.power(na.clip(x[q], -na.inf, 50000.), 8)
+ x6 = na.power(na.clip(x[q], -na.inf, 1.e6), 6)
+ x4 = na.power(na.clip(x[q], -na.inf, 1.e9), 4)
+ x2 = na.power(na.clip(x[q], -na.inf, 1.e18), 2)
+ dno1[q] = -(0.5 / x2 + 0.75 / x4 + 1.875 / x6 +
+ 6.5625 / x8 + 29.53125 / x10 +
+ 162.4218 / x12 + 1055.7421 / x14)
+ dno2[q] = (1. - dno1[q]) / (2. * x[q])
+
+ funct = y * dno1
+ if (y > 1.e-8).any():
+ q = 1.0
+ yn = y
+ for i in range(2, 51):
+ dn = (x * dno1 + dno2) * (-2. / i)
+ dno2 = dno1
+ dno1 = dn
+ if (i % 2) == 1:
+ q = -q
+ yn = yn * y2
+ g = dn.astype(na.float64) * yn
+ funct = funct + q * g
+ if na.max(na.abs(g / funct)) <= 1.e-8: break
+
+ k1 = u1 - 1.12837917 * funct
+ k1 = k1.astype(na.float64).clip(0)
+ return k1
+
+def tau_profile(lam0, fval, gamma, vkms, column_density,
+ deltav=None, delta_lambda=None,
+ lambda_bins=None, n_lambda=12000, dlambda=0.01):
+ """
+ Create an optical depth vs. wavelength profile for an
+ absorption line using a voigt profile.
+ :param lam0 (float): central wavelength (angstroms).
+ :param fval (float): f-value.
+ :param gamma (float): gamma value.
+ :param vkms (float): doppler b-parameter.
+ :param column_density (float): column density (cm^-2).
+ :param deltav (float): velocity offset from lam0 (km/s).
+ Default: None (no shift).
+ :param delta_lambda (float): wavelength offset in angstroms.
+ Default: None (no shift).
+ :param lambda_bins (array): array of wavelengths in angstroms.
+ Default: None
+ :param n_lambda (float): size of lambda bins to create
+ array if lambda_bins is None. Default: 12000
+ :param dlambda (float): lambda bin width if lambda_bins is
+ None. Default: 0.01
+ """
+
+ ## constants
+ me = 1.6726231e-24 / 1836. # grams mass electron
+ e = 4.8032e-10 # esu
+ c = 2.99792456e5 # km/s
+ ccgs = c * 1.e5 # cm/s
+
+ ## shift lam0 by deltav
+ if deltav is not None:
+ lam1 = lam0 * (1 + deltav / c)
+ elif delta_lambda is not None:
+ lam1 = lam0 + delta_lambda
+ else:
+ lam1 = lam0
+
+ ## conversions
+ vdop = vkms * 1.e5 # in cm/s
+ lam0cgs = lam0 / 1.e8 # rest wavelength in cm
+ lam1cgs = lam1 / 1.e8 # line wavelength in cm
+ nu1 = ccgs / lam1cgs # line freq in Hz
+ nudop = vdop / ccgs * nu1 # doppler width in Hz
+ lamdop = vdop / ccgs * lam1 # doppler width in Ang
+
+ ## create wavelength
+ if lambda_bins is None:
+ lambda_bins = lam1 + \
+ na.arange(n_lambda, dtype=na.float) * dlambda - \
+ n_lambda * dlambda / 2 # wavelength vector (angstroms)
+ nua = ccgs / (lambda_bins / 1.e8) # frequency vector (Hz)
+
+ ## tau_0
+ tau_X = na.sqrt(na.pi) * e**2 / (me * ccgs) * \
+ column_density * fval / vdop
+ tau1 = tau_X * lam1cgs
+ tau0 = tau_X * lam0cgs
+
+ # dimensionless frequency offset in units of doppler freq
+ x = (nua - nu1) / nudop
+ a = gamma / (4 * na.pi * nudop) # damping parameter
+ phi = voigt(a, x) # profile
+ tauphi = tau0 * phi # profile scaled with tau0
+
+ return (lambda_bins, tauphi)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/yt/analysis_modules/absorption_spectrum/absorption_spectrum.py Tue Jun 07 15:02:53 2011 -0400
@@ -0,0 +1,285 @@
+"""
+AbsorptionSpectrum class and member functions.
+
+Author: Britton Smith <brittonsmith at gmail.com>
+Affiliation: Michigan State University
+Homepage: http://yt.enzotools.org/
+License:
+ Copyright (C) 2008-2011 Britton Smith. All Rights Reserved.
+
+ This file is part of yt.
+
+ yt is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+"""
+
+import h5py
+import numpy as na
+
+from absorption_line import tau_profile
+
+from yt.funcs import get_pbar
+from yt.utilities.physical_constants import \
+ amu_cgs, boltzmann_constant_cgs, \
+ speed_of_light_cgs, km_per_cm
+
+speed_of_light_kms = speed_of_light_cgs * km_per_cm
+
+class AbsorptionSpectrum(object):
+ def __init__(self, lambda_min, lambda_max, n_lambda):
+ """
+ Create an absorption spectrum object.
+ :param lambda_min (float): lower wavelength bound in angstroms.
+ :param lambda_max (float): upper wavelength bound in angstroms.
+ :param n_lambda (float): number of wavelength bins.
+ """
+
+ self.n_lambda = n_lambda
+ self.tau_field = None
+ self.flux_field = None
+ self.spectrum_line_list = None
+ self.lambda_bins = na.linspace(lambda_min, lambda_max, n_lambda)
+ self.bin_width = (lambda_max - lambda_min) / float(n_lambda - 1)
+ self.line_list = []
+ self.continuum_list = []
+
+ def add_line(self, label, field_name, wavelength,
+ f_value, gamma, atomic_mass,
+ label_threshold=None):
+ """
+ Add an absorption line to the list of lines included in the spectrum.
+ :param label (string): label for the line.
+ :param field_name (string): field name from ray data for column densities.
+ :param wavelength (float): line rest wavelength in angstroms.
+ :param f_value (float): line f-value.
+ :param gamma (float): line gamme value.
+ :param atomic_mass (float): mass of atom in amu.
+ """
+
+ self.line_list.append({'label': label, 'field_name': field_name,
+ 'wavelength': wavelength, 'f_value': f_value,
+ 'gamma': gamma, 'atomic_mass': atomic_mass,
+ 'label_threshold': label_threshold})
+
+ def add_continuum(self, label, field_name, wavelength,
+ normalization, index):
+ """
+ Add a continuum feature that follows a power-law.
+ :param label (string): label for the feature.
+ :param field_name (string): field name from ray data for column densities.
+ :param wavelength (float): line rest wavelength in angstroms.
+ :param normalization (float): the column density normalization.
+ :param index (float): the power-law index for the wavelength dependence.
+ """
+
+ self.continuum_list.append({'label': label, 'field_name': field_name,
+ 'wavelength': wavelength,
+ 'normalization': normalization,
+ 'index': index})
+
+ def make_spectrum(self, input_file, output_file='spectrum.h5',
+ line_list_file='lines.txt',
+ use_peculiar_velocity=True):
+ """
+ Make spectrum from ray data using the line list.
+ :param input_file (string): path to input ray data.
+ :param output_file (string): path for output file.
+ File formats are chosen based on the filename extension.
+ - .h5: hdf5.
+ - .fits: fits.
+ - anything else: ascii.
+ :param use_peculiar_velocity (bool): if True, include line of sight
+ velocity for shifting lines.
+ """
+
+ input_fields = ['dl', 'redshift', 'Temperature']
+ field_data = {}
+ if use_peculiar_velocity: input_fields.append('los_velocity')
+ for feature in self.line_list + self.continuum_list:
+ if not feature['field_name'] in input_fields:
+ input_fields.append(feature['field_name'])
+
+ input = h5py.File(input_file, 'r')
+ for field in input_fields:
+ field_data[field] = input[field].value
+ input.close()
+
+ self.tau_field = na.zeros(self.lambda_bins.size)
+ self.spectrum_line_list = []
+
+ self._add_lines_to_spectrum(field_data, use_peculiar_velocity)
+ self._add_continua_to_spectrum(field_data, use_peculiar_velocity)
+
+ self.flux_field = na.exp(-self.tau_field)
+
+ if output_file.endswith('.h5'):
+ self._write_spectrum_hdf5(output_file)
+ elif output_file.endswith('.fits'):
+ self._write_spectrum_fits(output_file)
+ else:
+ self._write_spectrum_ascii(output_file)
+ self._write_spectrum_line_list(line_list_file)
+
+ del field_data
+ return (self.lambda_bins, self.flux_field)
+
+ def _add_continua_to_spectrum(self, field_data, use_peculiar_velocity):
+ """
+ Add continuum features to the spectrum.
+ """
+ # Only add continuum features down to tau of 1.e-4.
+ tau_min = 1.e-4
+
+ for continuum in self.continuum_list:
+ column_density = field_data[continuum['field_name']] * field_data['dl']
+ delta_lambda = continuum['wavelength'] * field_data['redshift']
+ if use_peculiar_velocity:
+ delta_lambda += continuum['wavelength'] * field_data['los_velocity'] / \
+ speed_of_light_cgs
+ this_wavelength = delta_lambda + continuum['wavelength']
+ right_index = na.digitize(this_wavelength, self.lambda_bins).clip(0, self.n_lambda)
+ left_index = na.digitize((this_wavelength *
+ na.power((tau_min * continuum['normalization'] /
+ column_density), (1. / continuum['index']))),
+ self.lambda_bins).clip(0, self.n_lambda)
+
+ valid_continuua = na.where(((column_density /
+ continuum['normalization']) > tau_min) &
+ (right_index - left_index > 1))[0]
+ pbar = get_pbar("Adding continuum feature - %s [%f A]: " % \
+ (continuum['label'], continuum['wavelength']),
+ valid_continuua.size)
+ for i, lixel in enumerate(valid_continuua):
+ line_tau = na.power((self.lambda_bins[left_index[lixel]:right_index[lixel]] /
+ this_wavelength[lixel]), continuum['index']) * \
+ column_density[lixel] / continuum['normalization']
+ self.tau_field[left_index[lixel]:right_index[lixel]] += line_tau
+ pbar.update(i)
+ pbar.finish()
+
+ def _add_lines_to_spectrum(self, field_data, use_peculiar_velocity):
+ """
+ Add the absorption lines to the spectrum.
+ """
+ # Only make voigt profile for slice of spectrum that is 10 times the line width.
+ spectrum_bin_ratio = 5
+
+ for line in self.line_list:
+ column_density = field_data[line['field_name']] * field_data['dl']
+ delta_lambda = line['wavelength'] * field_data['redshift']
+ if use_peculiar_velocity:
+ delta_lambda += line['wavelength'] * field_data['los_velocity'] / \
+ speed_of_light_cgs
+ thermal_b = km_per_cm * na.sqrt((2 * boltzmann_constant_cgs *
+ field_data['Temperature']) /
+ (amu_cgs * line['atomic_mass']))
+ center_bins = na.digitize((delta_lambda + line['wavelength']),
+ self.lambda_bins)
+
+ # ratio of line width to bin width
+ width_ratio = (line['wavelength'] + delta_lambda) * \
+ thermal_b / speed_of_light_kms / self.bin_width
+
+ # do voigt profiles for a subset of the full spectrum
+ left_index = (center_bins -
+ spectrum_bin_ratio * width_ratio).astype(int).clip(0, self.n_lambda)
+ right_index = (center_bins +
+ spectrum_bin_ratio * width_ratio).astype(int).clip(0, self.n_lambda)
+
+ # loop over all lines wider than the bin width
+ valid_lines = na.where((width_ratio >= 1.0) &
+ (right_index - left_index > 1))[0]
+ pbar = get_pbar("Adding line - %s [%f A]: " % (line['label'], line['wavelength']),
+ valid_lines.size)
+ for i, lixel in enumerate(valid_lines):
+ lambda_bins, line_tau = \
+ tau_profile(line['wavelength'], line['f_value'],
+ line['gamma'], thermal_b[lixel],
+ column_density[lixel],
+ delta_lambda=delta_lambda[lixel],
+ lambda_bins=self.lambda_bins[left_index[lixel]:right_index[lixel]])
+ self.tau_field[left_index[lixel]:right_index[lixel]] += line_tau
+ if line['label_threshold'] is not None and \
+ column_density[lixel] >= line['label_threshold']:
+ if use_peculiar_velocity:
+ peculiar_velocity = km_per_cm * field_data['los_velocity'][lixel]
+ else:
+ peculiar_velocity = 0.0
+ self.spectrum_line_list.append({'label': line['label'],
+ 'wavelength': (line['wavelength'] +
+ delta_lambda[lixel]),
+ 'column_density': column_density[lixel],
+ 'b_thermal': thermal_b[lixel],
+ 'redshift': field_data['redshift'][lixel],
+ 'v_pec': peculiar_velocity})
+ pbar.update(i)
+ pbar.finish()
+
+ del column_density, delta_lambda, thermal_b, \
+ center_bins, width_ratio, left_index, right_index
+
+ def _write_spectrum_line_list(self, filename):
+ """
+ Write out list of spectral lines.
+ """
+ print "Writing spectral line list: %s." % filename
+ self.spectrum_line_list.sort(key=lambda obj: obj['wavelength'])
+ f = open(filename, 'w')
+ f.write('#%-14s %-14s %-12s %-12s %-12s %-12s\n' %
+ ('Wavelength', 'Line', 'N [cm^-2]', 'b [km/s]', 'z', 'v_pec [km/s]'))
+ for line in self.spectrum_line_list:
+ f.write('%-14.6f %-14ls %e %e %e %e.\n' % (line['wavelength'], line['label'],
+ line['column_density'], line['b_thermal'],
+ line['redshift'], line['v_pec']))
+ f.close()
+
+ def _write_spectrum_ascii(self, filename):
+ """
+ Write spectrum to an ascii file.
+ """
+ print "Writing spectrum to ascii file: %s." % filename
+ f = open(filename, 'w')
+ f.write("# wavelength[A] tau flux\n")
+ for i in xrange(self.lambda_bins.size):
+ f.write("%e %e %e\n" % (self.lambda_bins[i],
+ self.tau_field[i], self.flux_field[i]))
+ f.close()
+
+ def _write_spectrum_fits(self, filename):
+ """
+ Write spectrum to a fits file.
+ """
+ try:
+ import pyfits
+ except:
+ print "Could not import the pyfits module. Please install pyfits."
+ return
+
+ print "Writing spectrum to fits file: %s." % filename
+ col1 = pyfits.Column(name='wavelength', format='E', array=self.lambda_bins)
+ col2 = pyfits.Column(name='flux', format='E', array=self.flux_field)
+ cols = pyfits.ColDefs([col1, col2])
+ tbhdu = pyfits.new_table(cols)
+ tbhdu.writeto(filename, clobber=True)
+
+ def _write_spectrum_hdf5(self, filename):
+ """
+ Write spectrum to an hdf5 file.
+
+ """
+ print "Writing spectrum to hdf5 file: %s." % filename
+ output = h5py.File(filename, 'w')
+ output.create_dataset('wavelength', data=self.lambda_bins)
+ output.create_dataset('tau', data=self.tau_field)
+ output.create_dataset('flux', data=self.flux_field)
+ output.close()
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/yt/analysis_modules/absorption_spectrum/api.py Tue Jun 07 15:02:53 2011 -0400
@@ -0,0 +1,32 @@
+"""
+API for absorption_spectrum
+
+Author: Matthew Turk <matthewturk at gmail.com>
+Affiliation: UCSD
+Author: J.S. Oishi <jsoishi at gmail.com>
+Affiliation: KIPAC/SLAC/Stanford
+Author: Britton Smith <brittonsmith at gmail.com>
+Affiliation: MSU
+Homepage: http://yt.enzotools.org/
+License:
+ Copyright (C) 2010-2011 Matthew Turk. All Rights Reserved.
+
+ This file is part of yt.
+
+ yt is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+"""
+
+from .absorption_spectrum import \
+ AbsorptionSpectrum
--- a/yt/analysis_modules/api.py Tue Jun 07 15:02:41 2011 -0400
+++ b/yt/analysis_modules/api.py Tue Jun 07 15:02:53 2011 -0400
@@ -28,6 +28,9 @@
"""
+from .absorption_spectrum.api import \
+ AbsorptionSpectrum
+
from .coordinate_transformation.api import \
spherical_regrid
--- a/yt/analysis_modules/light_cone/light_cone.py Tue Jun 07 15:02:41 2011 -0400
+++ b/yt/analysis_modules/light_cone/light_cone.py Tue Jun 07 15:02:53 2011 -0400
@@ -49,25 +49,29 @@
set_parameters=None, output_dir='LC', output_prefix='LightCone', **kwargs):
"""
Initialize a LightCone object.
- :param initial_redshift (float): the initial (highest) redshift for the light cone. Default: 1.0.
- :param final_redshift (float): the final (lowest) redshift for the light cone. Default: 0.0.
+ :param initial_redshift (float): the initial (highest) redshift for the light cone.
+ Default: 1.0.
+ :param final_redshift (float): the final (lowest) redshift for the light cone.
+ Default: 0.0.
:param observer_redshift (float): the redshift of the observer. Default: 0.0.
- :param field_of_view_in_arcminutes (float): the field of view of the image in units of arcminutes.
- Default: 600.0.
- :param image_resolution_in_arcseconds (float): the size of each image pixel in units of arcseconds.
- Default: 60.0.
- :param use_minimum_datasets (bool): if True, the minimum number of datasets is used to connect the
- initial and final redshift. If false, the light cone solution will contain as many entries
- as possible within the redshift interval. Default: True.
- :param deltaz_min (float): specifies the minimum :math:`\Delta z` between consecutive datasets in
- the returned list. Default: 0.0.
- :param minimum_coherent_box_fraction (float): used with use_minimum_datasets set to False, this
- parameter specifies the fraction of the total box size to be traversed before rerandomizing
- the projection axis and center. This was invented to allow light cones with thin slices to
- sample coherent large scale structure, but in practice does not work so well. Try setting
- this parameter to 1 and see what happens. Default: 0.0.
- :param set_parameters (dict): dictionary of parameters to attach to pf.parameters. Default: None.
- :param output_dir (str): the directory in which images and data files will be written. Default: 'LC'.
+ :param field_of_view_in_arcminutes (float): the field of view of the image in units of
+ arcminutes. Default: 600.0.
+ :param image_resolution_in_arcseconds (float): the size of each image pixel in units of
+ arcseconds. Default: 60.0.
+ :param use_minimum_datasets (bool): if True, the minimum number of datasets is used to
+ connect the initial and final redshift. If false, the light cone solution will contain
+ as many entries as possible within the redshift interval. Default: True.
+ :param deltaz_min (float): specifies the minimum :math:`\Delta z` between consecutive
+ datasets in the returned list. Default: 0.0.
+ :param minimum_coherent_box_fraction (float): used with use_minimum_datasets set to
+ False, this parameter specifies the fraction of the total box size to be traversed before
+ rerandomizing the projection axis and center. This was invented to allow light cones with
+ thin slices to sample coherent large scale structure, but in practice does not work so
+ well. Try setting this parameter to 1 and see what happens. Default: 0.0.
+ :param set_parameters (dict): dictionary of parameters to attach to pf.parameters.
+ Default: None.
+ :param output_dir (str): the directory in which images and data files will be written.
+ Default: 'LC'.
:param output_prefix (str): the prefix of all images and data files. Default: 'LightCone'.
"""
--- a/yt/analysis_modules/light_ray/light_ray.py Tue Jun 07 15:02:41 2011 -0400
+++ b/yt/analysis_modules/light_ray/light_ray.py Tue Jun 07 15:02:53 2011 -0400
@@ -46,13 +46,39 @@
from yt.convenience import load
class LightRay(EnzoSimulation):
- def __init__(self, EnzoParameterFile, FinalRedshift, InitialRedshift,
+ def __init__(self, enzo_parameter_file, final_redshift, initial_redshift,
deltaz_min=0.0, use_minimum_datasets=True,
minimum_coherent_box_fraction=0.0, **kwargs):
+ """
+ Create a LightRay object. A light ray is much like a light cone, in that
+ it stacks together multiple datasets in order to extend a redshift interval.
+ Unlike a light cone, which does randomly oriented projections for each dataset,
+ a light ray consists of randomly oriented single rays. The purpose of these
+ is to create synthetic QSO lines of sight.
- EnzoSimulation.__init__(self, EnzoParameterFile,
- initial_redshift=InitialRedshift,
- final_redshift=FinalRedshift, links=True,
+ Once the LightRay object is set up, use LightRay.make_light_ray to begin making
+ rays. Different randomizations can be created with a single object by providing
+ different random seeds to make_light_ray.
+
+ :param enzo_parameter_file (string): path to simulation parameter file.
+ :param final_redshift (float): lower bound of the ray redshift interval.
+ :param initial_redshift (float): upper bound of the ray redshift interval.
+ :param deltaz_min (float): minimum delta z between consecutive datasets.
+ Default: 0.0.
+ :param use_minimum_datasets (bool): if True, the minimum number of datasets is
+ used to connect the initial and final redshift. If false, the light ray
+ solution will contain as many entries as possible within the redshift interval.
+ Default: True.
+ minimum_coherent_box_fraction (float): used with use_minimum_datasets set to False,
+ this parameter specifies the fraction of the total box size to be traversed before
+ rerandomizing the projection axis and center. This was invented to allow light cones
+ with thin slices to sample coherent large scale structure, but in practice does not
+ work so well. It is not very clear what this will do to a light ray. Default: 0.0.
+ """
+
+ EnzoSimulation.__init__(self, enzo_parameter_file,
+ initial_redshift=initial_redshift,
+ final_redshift=final_redshift, links=True,
enzo_parameters={'CosmologyComovingBoxSize':float},
**kwargs)
@@ -85,7 +111,7 @@
for q in range(len(self.light_ray_solution)):
if (q == len(self.light_ray_solution) - 1):
- z_next = self.FinalRedshift
+ z_next = self.final_redshift
else:
z_next = self.light_ray_solution[q+1]['redshift']
@@ -130,16 +156,65 @@
boxFractionUsed += self.light_ray_solution[q]['TraversalBoxFraction']
if filename is not None:
- self._write_light_ray_solution(filename, \
- extra_info={'EnzoParameterFile':self.EnzoParameterFile,
- 'RandomSeed':seed,
- 'InitialRedshift':self.InitialRedshift,
- 'FinalRedshift':self.FinalRedshift})
+ self._write_light_ray_solution(filename,
+ extra_info={'enzo_parameter_file':self.enzo_parameter_file,
+ 'RandomSeed':seed,
+ 'initial_redshift':self.initial_redshift,
+ 'final_redshift':self.final_redshift})
def make_light_ray(self, seed=None, fields=None,
solution_filename=None, data_filename=None,
get_nearest_galaxy=False, get_los_velocity=False, **kwargs):
- "Create a light ray and get field values for each lixel."
+ """
+ Create a light ray and get field values for each lixel. A light ray consists of
+ a list of field values for cells intersected by the ray and the path length of
+ the ray through those cells. Light ray data can be written out to an hdf5 file.
+
+ :param seed (int): seed for the random number generator. Default: None.
+ :param fields (list): a list of fields for which to get data. Default: None.
+ :param solution_filename (string): path to a text file where the trajectories of each
+ subray is written out. Default: None.
+ :param data_filename (string): path to output file for ray data. Default: None.
+ :param get_nearest_galaxy (bool): if True, the HaloProfiler will be used to calculate
+ the distance and mass of the nearest halo for each point in the ray. This option
+ requires additional information to be included. See below for an example.
+ Default: False.
+ :param get_los_velocity (bool): if True, the line of sight velocity is calculated for
+ each point in the ray. Default: False.
+
+ GETTING THE NEAREST GALAXIES
+ The light ray tool will use the HaloProfiler to calculate the distance and mass
+ of the nearest halo to that pixel. In order to do this, four additional keyword
+ arguments must be supplied to tell the HaloProfiler what to do.
+
+ :param halo_profiler_kwargs (dict): a dictionary of standard HaloProfiler keyword
+ arguments and values to be given to the HaloProfiler.
+ EXAMPLE: halo_profiler_kwargs = {'halo_list_format': {'id':0,
+ 'center':[4, 5, 6]},
+ 'TotalMassMsun':1},
+ 'halo_list_file': 'HopAnalysis.out'}
+
+ :param halo_profiler_actions (list): a list of actions to be performed by the
+ HaloProfiler. Each item in the list should be a dictionary with the following
+ entries: "function", "args", and "kwargs", for the function to be performed,
+ the arguments supplied to that function, and the keyword arguments.
+ EXAMPLE: halo_profiler_actions = [{'function': make_profiles,
+ 'args': None,
+ 'kwargs': {'filename': 'VirializedHalos.out'}},
+ {'function': add_halo_filter,
+ 'args': VirialFilter,
+ 'kwargs': {'overdensity_field': 'ActualOverdensity',
+ 'virial_overdensity': 200,
+ 'virial_filters': [['TotalMassMsun','>=','1e14']],
+ 'virial_quantities': ['TotalMassMsun','RadiusMpc']}}]
+
+ :param halo_list (string): 'all' to use the full halo list, or 'filtered' to use
+ the filtered halo list created after calling make_profiles.
+ EXAMPLE: halo_list = 'filtered'
+
+ :param halo_mass_field (string): the field from the halo list to use for mass.
+ Default: 'TotalMassMsun_200'.
+ """
# Calculate solution.
self._calculate_light_ray_solution(seed=seed, filename=solution_filename)
@@ -163,7 +238,7 @@
mylog.info("Proc %04d: creating ray segment at z = %f." %
(my_rank, segment['redshift']))
if segment['next'] is None:
- next_redshift = self.FinalRedshift
+ next_redshift = self.final_redshift
else:
next_redshift = segment['next']['redshift']
@@ -276,7 +351,8 @@
return new_data
def _get_halo_list(self, dataset, halo_profiler_kwargs=None,
- halo_profiler_actions=None, halo_list='all'):
+ halo_profiler_actions=None, halo_list='all',
+ halo_mass_field='TotalMassMsun_200'):
"Load a list of halos for the dataset."
if halo_profiler_kwargs is None: halo_profiler_kwargs = {}
@@ -299,7 +375,8 @@
del hp
return return_list
- def _get_nearest_galaxy_distance(self, data, halo_list):
+ def _get_nearest_galaxy_distance(self, data, halo_list,
+ halo_mass_field='TotalMassMsun_200'):
"""
Calculate distance to nearest object in halo list for each lixel in data.
Return list of distances and masses of nearest objects.
@@ -307,7 +384,7 @@
# Create position array from halo list.
halo_centers = na.array(map(lambda halo: halo['center'], halo_list))
- halo_mass = na.array(map(lambda halo: halo['TotalMassMsun'], halo_list))
+ halo_mass = na.array(map(lambda halo: halo[halo_mass_field], halo_list))
nearest_distance = na.zeros(data['x'].shape)
nearest_mass = na.zeros(data['x'].shape)
--- a/yt/analysis_modules/setup.py Tue Jun 07 15:02:41 2011 -0400
+++ b/yt/analysis_modules/setup.py Tue Jun 07 15:02:53 2011 -0400
@@ -6,6 +6,7 @@
config = Configuration('analysis_modules',parent_package,top_path)
config.make_config_py() # installs __config__.py
config.make_svn_version_py()
+ config.add_subpackage("absorption_spectrum")
config.add_subpackage("coordinate_transformation")
config.add_subpackage("halo_finding")
config.add_subpackage("halo_mass_function")
--- a/yt/frontends/ramses/_ramses_reader.pyx Tue Jun 07 15:02:41 2011 -0400
+++ b/yt/frontends/ramses/_ramses_reader.pyx Tue Jun 07 15:02:53 2011 -0400
@@ -457,6 +457,8 @@
if self.snapshot_name != NULL: del self.snapshot_name
if self.rsnap != NULL: del self.rsnap
+ @cython.boundscheck(False)
+ @cython.wraparound(False)
def count_zones(self):
# We need to do simulation domains here
@@ -468,10 +470,9 @@
# All the loop-local pointers must be declared up here
- cell_count = []
+ cdef np.ndarray[np.int64_t, ndim=1] cell_count
+ cell_count = np.zeros(self.rsnap.m_header.levelmax + 1, 'int64')
cdef int local_count = 0
- for ilevel in range(self.rsnap.m_header.levelmax + 1):
- cell_count.append(0)
for idomain in range(1, self.rsnap.m_header.ncpu + 1):
local_tree = new RAMSES_tree(deref(self.rsnap), idomain,
self.rsnap.m_header.levelmax, 0)
@@ -545,6 +546,9 @@
return header_info
+ @cython.cdivision(True)
+ @cython.boundscheck(False)
+ @cython.wraparound(False)
def fill_hierarchy_arrays(self,
np.ndarray[np.int32_t, ndim=1] top_grid_dims,
np.ndarray[np.float64_t, ndim=2] left_edges,
@@ -575,8 +579,8 @@
cdef np.int32_t rr
cdef int i
- cell_count = []
- level_cell_counts = {}
+ cdef np.ndarray[np.int64_t, ndim=1] level_cell_counts
+ level_cell_counts = np.zeros(self.rsnap.m_header.levelmax + 1, 'int64')
for idomain in range(1, self.rsnap.m_header.ncpu + 1):
local_tree = new RAMSES_tree(deref(self.rsnap), idomain,
self.rsnap.m_header.levelmax, 0)
--- a/yt/utilities/_amr_utils/QuadTree.pyx Tue Jun 07 15:02:41 2011 -0400
+++ b/yt/utilities/_amr_utils/QuadTree.pyx Tue Jun 07 15:02:53 2011 -0400
@@ -147,6 +147,8 @@
total += self.count_total_cells(root.children[i][j])
return total + 1
+ @cython.boundscheck(False)
+ @cython.wraparound(False)
cdef int fill_buffer(self, QuadTreeNode *root, int curpos,
np.ndarray[np.int32_t, ndim=1] refined,
np.ndarray[np.float64_t, ndim=2] values,
@@ -164,6 +166,8 @@
refined, values, wval)
return curpos
+ @cython.boundscheck(False)
+ @cython.wraparound(False)
cdef int unfill_buffer(self, QuadTreeNode *root, int curpos,
np.ndarray[np.int32_t, ndim=1] refined,
np.ndarray[np.float64_t, ndim=2] values,
@@ -186,6 +190,8 @@
return curpos
+ @cython.boundscheck(False)
+ @cython.wraparound(False)
def frombuffer(self, np.ndarray[np.int32_t, ndim=1] refined,
np.ndarray[np.float64_t, ndim=2] values,
np.ndarray[np.float64_t, ndim=1] wval):
@@ -197,6 +203,8 @@
curpos = self.unfill_buffer(self.root_nodes[i][j], curpos,
refined, values, wval)
+ @cython.boundscheck(False)
+ @cython.wraparound(False)
def tobuffer(self):
cdef int total = 0
for i in range(self.top_grid_dims[0]):
@@ -226,7 +234,7 @@
int level, np.int64_t pos[2],
np.float64_t *val,
np.float64_t weight_val):
- cdef int i, j
+ cdef int i, j, L
cdef QuadTreeNode *node
node = self.find_on_root_level(pos, level)
cdef np.int64_t fac
@@ -240,6 +248,7 @@
node = node.children[i][j]
QTN_add_value(node, val, weight_val)
+ @cython.cdivision(True)
cdef QuadTreeNode *find_on_root_level(self, np.int64_t pos[2], int level):
# We need this because the root level won't just have four children
# So we find on the root level, then we traverse the tree.
@@ -266,6 +275,7 @@
pos[0] = pxs[p]
pos[1] = pys[p]
self.add_to_position(level, pos, vals, pweight_vals[p])
+ return
def add_grid_to_tree(self, int level,
np.ndarray[np.int64_t, ndim=1] start_index,
--- a/yt/utilities/command_line.py Tue Jun 07 15:02:41 2011 -0400
+++ b/yt/utilities/command_line.py Tue Jun 07 15:02:53 2011 -0400
@@ -89,9 +89,9 @@
help="Desired units"),
center = dict(short="-c", long="--center",
action="store", type="float",
- dest="center", default=[0.5, 0.5, 0.5],
+ dest="center", default=None,
nargs=3,
- help="Center (-1,-1,-1 for max)"),
+ help="Center, command separated (-1 -1 -1 for max)"),
bn = dict(short="-b", long="--basename",
action="store", type="string",
dest="basename", default=None,
@@ -478,6 +478,8 @@
if opts.center == (-1,-1,-1):
mylog.info("No center fed in; seeking.")
v, center = pf.h.find_max("Density")
+ elif opts.center is None:
+ center = 0.5*(pf.domain_left_edge + pf.domain_right_edge)
center = na.array(center)
pc=PlotCollection(pf, center=center)
if opts.axis == 4:
--- a/yt/utilities/physical_constants.py Tue Jun 07 15:02:41 2011 -0400
+++ b/yt/utilities/physical_constants.py Tue Jun 07 15:02:53 2011 -0400
@@ -5,6 +5,7 @@
# Masses
mass_hydrogen_cgs = 1.67e-24 # g
mass_electron_cgs = 9.11e-28 # g
+amu_cgs = 1.66053886e-24 # g
# Velocities
speed_of_light_cgs = 2.99792458e10 # cm/s, exact
@@ -24,7 +25,7 @@
mass_mean_atomic_cosmology = 1.22
mass_mean_atomic_galactic = 2.3
-# Conversion Factors: X au * mpc_per_au = Y au
+# Conversion Factors: X au * mpc_per_au = Y mpc
# length
mpc_per_mpc = 1
mpc_per_kpc = 1e-3
--- a/yt/visualization/_colormap_data.py Tue Jun 07 15:02:41 2011 -0400
+++ b/yt/visualization/_colormap_data.py Tue Jun 07 15:02:53 2011 -0400
@@ -974,3 +974,185 @@
1., 1., 1., 1., 1., 1., 1., 1., 1.]),
)
+### kamae ###
+
+color_map_luts['kamae'] = \
+ (
+array([ 0.10189667, 0.11463894, 0.12755761, 0.1405963 , 0.15373037,
+ 0.16694395, 0.18022534, 0.1935652 , 0.2069557 , 0.22039001,
+ 0.23386204, 0.24736623, 0.26089743, 0.27445076, 0.28802162,
+ 0.30160555, 0.31519826, 0.32879554, 0.34239328, 0.35598743,
+ 0.36957396, 0.38314889, 0.39670823, 0.41024801, 0.42376423,
+ 0.43725291, 0.45071 , 0.46413146, 0.47751319, 0.49085107,
+ 0.5041409 , 0.51737848, 0.53055952, 0.54367968, 0.55673458,
+ 0.56971976, 0.58263072, 0.59546287, 0.60821158, 0.62087213,
+ 0.63343975, 0.6459096 , 0.65827678, 0.6705363 , 0.68268311,
+ 0.69471212, 0.70661814, 0.71839593, 0.73004018, 0.74154553,
+ 0.75290655, 0.76411775, 0.7751736 , 0.7860685 , 0.79679679,
+ 0.8073528 , 0.81773078, 0.82792495, 0.83792951, 0.8477386 ,
+ 0.85734636, 0.86674688, 0.87593426, 0.88490256, 0.89364586,
+ 0.90215822, 0.9104337 , 0.9184664 , 0.92625041, 0.93377986,
+ 0.94104891, 0.94805175, 0.95478263, 0.96123586, 0.9674058 ,
+ 0.97328689, 0.97887365, 0.98416071, 0.98914277, 0.99381466,
+ 0.99817132, 0.9998451 , 1. , 1. , 1. ,
+ 1. , 1. , 1. , 1. , 1. ,
+ 1. , 1. , 1. , 1. , 1. ,
+ 1. , 1. , 1. , 1. , 1. ,
+ 1. , 1. , 1. , 1. , 0.99786575,
+ 0.99359386, 0.98863281, 0.98330578, 0.97761561, 0.97156558,
+ 0.96515943, 0.95840133, 0.95129595, 0.94384841, 0.93606432,
+ 0.92794977, 0.91951136, 0.91075617, 0.90169178, 0.8923263 ,
+ 0.88266832, 0.87272695, 0.86251183, 0.85203309, 0.84130138,
+ 0.83032786, 0.81912419, 0.80770256, 0.79607564, 0.78425658,
+ 0.77225906, 0.76009721, 0.74778563, 0.7353394 , 0.72277404,
+ 0.71010551, 0.69735019, 0.68452487, 0.67164675, 0.65873339,
+ 0.6458027 , 0.63287295, 0.6199627 , 0.60709082, 0.59427645,
+ 0.58153897, 0.56889796, 0.55637322, 0.54398469, 0.53175245,
+ 0.51969665, 0.50783755, 0.4961954 , 0.48479047, 0.47364299,
+ 0.46277308, 0.45220078, 0.44194595, 0.43202827, 0.42246716,
+ 0.41328178, 0.40449095, 0.39611313, 0.38816637, 0.38066827,
+ 0.3736359 , 0.36708582, 0.36103397, 0.35549565, 0.3504855 ,
+ 0.34601741, 0.34210448, 0.33875902, 0.33599244, 0.33381526,
+ 0.33223703, 0.33126631, 0.3309106 , 0.33117634, 0.33206882,
+ 0.33359218, 0.33574936, 0.33854206, 0.3419707 , 0.34603442,
+ 0.35073099, 0.35605684, 0.362007 , 0.36857511, 0.37575334,
+ 0.38353244, 0.39190166, 0.4008488 , 0.41036015, 0.42042051,
+ 0.43101317, 0.44211993, 0.4537211 , 0.46579548, 0.47832042,
+ 0.49127178, 0.504624 , 0.51835009, 0.53242166, 0.54680899,
+ 0.561481 , 0.57640533, 0.59154841, 0.60687543, 0.62235047,
+ 0.63793653, 0.65359557, 0.66928861, 0.68497576, 0.70061634,
+ 0.71616893, 0.73159144, 0.74684123, 0.76187518, 0.77664977,
+ 0.79112121, 0.80524551, 0.81897859, 0.83227639, 0.84509499,
+ 0.85739069, 0.86912016, 0.88024052, 0.8907095 , 0.9004855 ,
+ 0.90952776, 0.91779647, 0.92525286, 0.93185938, 0.93757975,
+ 0.94237913, 0.94622424, 0.94908343, 0.95092687, 0.9517266 ,
+ 0.95145666, 0.95009324, 0.94761471, 0.9440018 , 0.93923763,
+ 0.93330785, 0.92620073, 0.9179072 , 0.90842097, 0.89773857,
+ 0.88585945, 0.87278601, 0.85852366, 0.84308084, 0.8264691 ,
+ 0.80870311]),
+array([ 0.09276197, 0.12828558, 0.14148276, 0.15073629, 0.15792564,
+ 0.16377875, 0.16867726, 0.17285336, 0.17646219, 0.17961453,
+ 0.18239341, 0.18486353, 0.18707683, 0.18907613, 0.19089745,
+ 0.19257166, 0.19412563, 0.19558306, 0.1969651 , 0.19829085,
+ 0.19957764, 0.2008414 , 0.20209683, 0.20335757, 0.20463637,
+ 0.20594518, 0.20729526, 0.20869724, 0.21016118, 0.21169665,
+ 0.21331273, 0.21501809, 0.21682099, 0.2187293 , 0.22075054,
+ 0.22289189, 0.2251602 , 0.22756199, 0.23010349, 0.23279061,
+ 0.23562896, 0.23862389, 0.24178042, 0.24510329, 0.24859697,
+ 0.25226561, 0.25611312, 0.26014306, 0.26435875, 0.2687632 ,
+ 0.27335911, 0.27814891, 0.28313472, 0.28831836, 0.29370134,
+ 0.29928488, 0.30506987, 0.31105692, 0.31724629, 0.32363796,
+ 0.33023158, 0.33702647, 0.34402165, 0.35121581, 0.35860731,
+ 0.3661942 , 0.37397421, 0.38194473, 0.39010283, 0.39844526,
+ 0.40696847, 0.41566854, 0.42454128, 0.43358216, 0.44278633,
+ 0.45214864, 0.46166362, 0.47132551, 0.48112825, 0.49106545,
+ 0.50113048, 0.51131639, 0.52161595, 0.53202168, 0.54252581,
+ 0.55312033, 0.56379697, 0.57454721, 0.58536232, 0.59623332,
+ 0.60715103, 0.61810606, 0.62908884, 0.64008959, 0.65109838,
+ 0.66210512, 0.67309958, 0.68407136, 0.69500998, 0.70590484,
+ 0.71674524, 0.7275204 , 0.73821948, 0.74883161, 0.75934584,
+ 0.76975124, 0.78003687, 0.79019179, 0.80020509, 0.81006592,
+ 0.81976349, 0.82928706, 0.83862603, 0.84776989, 0.85670824,
+ 0.86543087, 0.87392769, 0.88218883, 0.8902046 , 0.89796551,
+ 0.90546232, 0.91268605, 0.91962797, 0.92627962, 0.93263287,
+ 0.93867988, 0.94441315, 0.94982552, 0.95491021, 0.95966079,
+ 0.96407124, 0.96813594, 0.97184967, 0.97520769, 0.97820564,
+ 0.98083967, 0.98310638, 0.98500283, 0.98652659, 0.98767574,
+ 0.98844883, 0.98884498, 0.98886377, 0.98850537, 0.98777045,
+ 0.98666024, 0.98517652, 0.98332159, 0.98109835, 0.97851023,
+ 0.9755612 , 0.97225582, 0.9685992 , 0.96459698, 0.96025538,
+ 0.95558116, 0.95058161, 0.94526459, 0.93963846, 0.93371212,
+ 0.92749498, 0.92099698, 0.91422853, 0.90720053, 0.89992437,
+ 0.89241189, 0.88467538, 0.87672756, 0.86858155, 0.86025091,
+ 0.85174954, 0.84309173, 0.8342921 , 0.8253656 , 0.81632747,
+ 0.80719325, 0.79797873, 0.78869994, 0.7793731 , 0.77001465,
+ 0.76064116, 0.75126936, 0.74191609, 0.73259824, 0.7233328 ,
+ 0.71413676, 0.70502712, 0.69602085, 0.68713487, 0.678386 ,
+ 0.66979095, 0.6613663 , 0.65312845, 0.64509359, 0.63727769,
+ 0.62969646, 0.6223653 , 0.61529933, 0.60851328, 0.60202154,
+ 0.59583809, 0.58997647, 0.58444976, 0.57927057, 0.574451 ,
+ 0.5700026 , 0.56593638, 0.56226276, 0.55899154, 0.55613191,
+ 0.5536924 , 0.55168088, 0.55010452, 0.54896977, 0.5482824 ,
+ 0.54804739, 0.54826898, 0.54895066, 0.5500951 , 0.55170422,
+ 0.5537791 , 0.55632002, 0.55932646, 0.56279704, 0.56672959,
+ 0.57112109, 0.57596767, 0.58126467, 0.58700657, 0.59318702,
+ 0.59979888, 0.60683417, 0.61428411, 0.62213911, 0.63038884,
+ 0.63902214, 0.64802713, 0.65739119, 0.66710095, 0.67714237,
+ 0.68750069, 0.69816052, 0.70910582, 0.72031994, 0.73178563,
+ 0.74348511, 0.75540005, 0.76751163, 0.77980056, 0.79224712,
+ 0.80483118, 0.81753226, 0.83032956, 0.84320195, 0.85612808,
+ 0.86908639]),
+array([ 0.03921569, 0.14755333, 0.15484709, 0.15910372, 0.16221813,
+ 0.164691 , 0.16675074, 0.16852161, 0.17007905, 0.17147245,
+ 0.17273603, 0.17389454, 0.17496647, 0.17596607, 0.17690456,
+ 0.17779096, 0.17863263, 0.1794357 , 0.1802053 , 0.18094581,
+ 0.18166101, 0.18235416, 0.18302812, 0.18368543, 0.18432833,
+ 0.18495885, 0.18557879, 0.1861898 , 0.1867934 , 0.18739095,
+ 0.18798372, 0.18857288, 0.18915953, 0.18974468, 0.19032928,
+ 0.19091421, 0.19150034, 0.19208844, 0.19267928, 0.19327356,
+ 0.19387199, 0.1944752 , 0.19508383, 0.19569847, 0.19631971,
+ 0.1969481 , 0.19758419, 0.19822848, 0.1988815 , 0.19954371,
+ 0.20021562, 0.20089767, 0.20159031, 0.202294 , 0.20300915,
+ 0.2037362 , 0.20447555, 0.20522761, 0.20599277, 0.20677142,
+ 0.20756395, 0.20837073, 0.20919213, 0.21002852, 0.21088026,
+ 0.21174769, 0.21263118, 0.21353106, 0.21444767, 0.21538136,
+ 0.21633245, 0.21730128, 0.21828817, 0.21929344, 0.22031742,
+ 0.22136043, 0.22242277, 0.22350476, 0.22460671, 0.22572894,
+ 0.22687174, 0.22803542, 0.22922029, 0.23042665, 0.2316548 ,
+ 0.23290505, 0.23417769, 0.23547304, 0.23679141, 0.23813309,
+ 0.2394984 , 0.24088767, 0.24230121, 0.24373936, 0.24520245,
+ 0.24669084, 0.2482049 , 0.24974502, 0.25131159, 0.25290506,
+ 0.25452588, 0.25617456, 0.25785162, 0.25955767, 0.26129335,
+ 0.26305936, 0.26485651, 0.26668567, 0.26854783, 0.27044409,
+ 0.27237568, 0.27434399, 0.2763506 , 0.27839725, 0.28048592,
+ 0.28261885, 0.28479853, 0.28702776, 0.28930969, 0.29164781,
+ 0.29404606, 0.29650878, 0.29904082, 0.30164751, 0.30433477,
+ 0.30710909, 0.3099776 , 0.31294808, 0.31602901, 0.31922957,
+ 0.3225597 , 0.32603009, 0.32965219, 0.33343823, 0.33740118,
+ 0.34155475, 0.34591336, 0.35049209, 0.3553066 , 0.36037309,
+ 0.36570818, 0.37132881, 0.37725211, 0.38349527, 0.39007533,
+ 0.39700904, 0.40431267, 0.41200173, 0.42009082, 0.42859331,
+ 0.43752115, 0.44688456, 0.45669178, 0.46694881, 0.47765913,
+ 0.48882341, 0.50043933, 0.51250128, 0.52500019, 0.53792329,
+ 0.55125402, 0.56497186, 0.57905222, 0.59346649, 0.60818194,
+ 0.62316185, 0.6383656 , 0.65374881, 0.66926358, 0.68485877,
+ 0.70048031, 0.71607158, 0.73157387, 0.7469268 , 0.76206891,
+ 0.77693813, 0.79147243, 0.80561039, 0.81929181, 0.83245833,
+ 0.84505406, 0.85702617, 0.86832547, 0.87890699, 0.88873043,
+ 0.89776066, 0.90596815, 0.91332926, 0.91982658, 0.92544909,
+ 0.93019232, 0.93405839, 0.937056 , 0.93920033, 0.94051286,
+ 0.94102111, 0.94075835, 0.93976317, 0.93807909, 0.93575405,
+ 0.93283987, 0.92939168, 0.92546733, 0.92112679, 0.91643153,
+ 0.91144386, 0.9062264 , 0.90084141, 0.89535028, 0.88981297,
+ 0.88428753, 0.87882965, 0.87349223, 0.86832508, 0.86337457,
+ 0.85868342, 0.8542905 , 0.85023073, 0.84653492, 0.84322986,
+ 0.84033823, 0.83787874, 0.83586622, 0.83431172, 0.83322277,
+ 0.83260351, 0.83245497, 0.83277526, 0.83355988, 0.83480196,
+ 0.83649253, 0.83862079, 0.84117439, 0.84413967, 0.84750191,
+ 0.8512456 , 0.85535461, 0.85981245, 0.86460243, 0.86970782,
+ 0.87511204, 0.88079878, 0.88675211, 0.89295658, 0.89939731,
+ 0.90606008, 0.91293132, 0.91999822, 0.92724869, 0.93467142,
+ 0.94225589, 0.94999229, 0.9578716 , 0.96588553, 0.97402646,
+ 0.98228749]),
+array([ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
+ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
+ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
+ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
+ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
+ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
+ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
+ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
+ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
+ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
+ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
+ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
+ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
+ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
+ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
+ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
+ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
+ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
+ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
+ 1., 1., 1., 1., 1., 1., 1., 1., 1.]),
+ )
+
--- a/yt/visualization/image_writer.py Tue Jun 07 15:02:41 2011 -0400
+++ b/yt/visualization/image_writer.py Tue Jun 07 15:02:53 2011 -0400
@@ -291,7 +291,8 @@
return mapped.copy("C")
def strip_colormap_data(fn = "color_map_data.py",
- cmaps = ("jet", "algae", "hot", "gist_stern", "RdBu")):
+ cmaps = ("jet", "algae", "hot", "gist_stern", "RdBu",
+ "kamae")):
import pprint
import color_maps as rcm
f = open(fn, "w")
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list