irfpy.jdc.fluxsimulator
¶
Flux and count rate simulator.
For preparatory, flux simulator is very useful.
-
class
irfpy.jdc.fluxsimulator.
SimpleSimulator
[source]¶ Bases:
object
Simulator class. Only single species support.
A simple simulator of the flux. No optimization, therefore, very slow, indeed.
Anyway, you can use as follows:
>>> sim = SimpleSimulator() >>> sim.set_species(32., 2.)
The above statement set the mass=32 charge=2 for the target atom. If you do not specify, oxygen singly charged ion (m=16, q=1) is used by default.
Then you should specify the distribution function, otherwise nan is returned.
Here, a simplest method is using
set_plasmaparameter()
. This will create Maxwell distribution from the given parameter.>>> sim.set_plasmaparameter(1e6, 0, 0, 5e3, 10e3)
More flexible way is to prepare an arbitorary function, that get (3,) shape array (velocity) returning the scalar (velocity distribution function), and use
set_velocitydistribution()
.Either the above, after setting the velocity distribution function, you can choose the energy, elevation and azimuthal index. (Index is defined in
irfpy.jdc.fov0
andirfpy.jdc.energy0
.)>>> print('%.2f' % sim.get_dflux(18, 5, 12)) 1148.71 >>> print('%.4f' % sim.get_countrate(18, 5, 12)) 2.8985
It returns the differential flux in #/cm2 sr eV s and count rate in #/s for the energy step 18, elevation index 5 and azimuthal index 12.
Initializer
-
set_plasmaparameter
(n, vx, vy, vz, vth)[source]¶ A special functin to set the single species Maxwellian.
- Parameters
n – Density in /m3
vx,vy,vz – Velocity in m/s
vth – Thermal velocity in m/s
-