User-compiled sources (SourceType="USER") have a function called
user_create_ray which is called with a pointer to ray properties
(direction, time, and energy). All ray properties used to be undefined before
calling this function and the user function could return -1 for energy and
time to have |marx| assign energy and time. Now, energy is initialized
beforeuser_create_ray is called, to allow user code that assigns
locations based on the ray energy. With this change, marx.par must contain a
valid specification for the source spectrum, since an energy will be drawn,
even if the user source later assigns a different value. For
backwards-compatibility, if user_create_ray sets the energy to a negative
value, |marx| will assign the energy drawn before to the variable again.
User-compiled sources (
SourceType="USER"
) have a function calleduser_create_ray
which is called with a pointer to ray properties (direction, time, and energy). All ray properties used to be undefined before calling this function and the user function could return-1
for energy and time to have |marx| assign energy and time. Now,energy
is initialized beforeuser_create_ray
is called, to allow user code that assigns locations based on the ray energy. With this change, marx.par must contain a valid specification for the source spectrum, since an energy will be drawn, even if the user source later assigns a different value. For backwards-compatibility, ifuser_create_ray
sets the energy to a negative value, |marx| will assign the energy drawn before to the variable again.closes #38