Ha, I oversaw a link in [1] linking to [2]. Ok, so I can just specify my own unit system in user-code with that. But anyhow, I can't assign it new symbols. Also, do all conversion factors need to go through CGS? Also, microns turns out to be .in_units("um") :) Axel [2] http://yt-project.org/docs/dev/analyzing/units/unit_systems.html On 05.01.2017 13:59, Axel Huebl wrote:
Hi yt-devs!
I have a quick user-question (sorry) and a devel question:
First, how to convert to a unit like microns (10^-6 meters) or pico-seconds? I can't find an example here [1]. I tried
.in_units("mum") .in_units("mu m) .in_units("1.e-6 m") .in_units("microns") .in_units("micro meter") .in_units("micro meters") .in_units("micro m") .in_units("μm")
and only .in_units("1.e-6 * m")
does not fail but looks ugly.
An orthogonal question: in our domain (laser-plasma physics) unit systems are scaled by something like the applied laser wavelength or the plasma density (and more to make a full set).
Following again [1] I would implement something like .in_base('plasma') or .in_base('laserplasma') but those are not scaled to "fixed" reference quantities as the other base systems but are depending on either user input [ length = ("$\lambda_0$", "800 nm"), time = ("$\omega_\text{pe}^{-1}$", "1.e-15 s"), ...] or alternatively scalings the data file already provided. (Ok, the symbol is always fixed per "in_base" but the value to scale with needs to be provided.)
Is that already possible or any ideas how we could implement that?
Thanks, Axel
[1] http://yt-project.org/docs/dev/analyzing/units/fields_and_unit_conversion.ht...
-- Axel Huebl Phone +49 351 260 3582 https://www.hzdr.de/crp Computational Radiation Physics Laser Particle Acceleration Division Helmholtz-Zentrum Dresden - Rossendorf e.V. Bautzner Landstrasse 400, 01328 Dresden POB 510119, D-01314 Dresden Vorstand: Prof. Dr.Dr.h.c. R. Sauerbrey Prof. Dr.Dr.h.c. P. Joehnk VR 1693 beim Amtsgericht Dresden