The source term of openmc

Hello everybody! I need some help in the openmc。
For openmc, can the source entries of a source be written as follows?
For example, the spatial distribution of the non-point source can be used by a custom source. At the same time, the particle type, energy and emission Angle of the non-point source can be used by openmc’s built-in functions。
For example:

source = openmc.Source()
source.space = openmc.stats.Point()
source.library = "/home/zengjie/openmc_workdir/libsource.so"  # spatial distribution 
source.angle = openmc.stats.Isotropic()
source.energy = openmc.stats.Tabular([0,
1.000E-03,
1.239E-03,

The spatial distribution of the sources is given by the custom source below:

#include <cmath> // for M_PI
#include <memory> // for unique_ptr

#include "openmc/random_lcg.h"
#include "openmc/source.h"
#include "openmc/particle.h"

class RingSource : public openmc::Source
{
  openmc::SourceSite sample(uint64_t* seed) const
  {
    openmc::SourceSite particle;
    // particle type
    particle.particle = openmc::ParticleType::neutron;
    // position
    double angle = 2.0 * M_PI * openmc::prn(seed);
    double radius = 3.0;
    particle.r.x = radius * std::cos(angle);
    particle.r.y = radius * std::sin(angle);
    particle.r.z = 0.0;
    return particle;
  }
};

// A function to create a unique pointer to an instance of this class when generated
// via a plugin call using dlopen/dlsym.
// You must have external C linkage here otherwise dlopen will not find the file
extern "C" std::unique_ptr<RingSource> openmc_create_source(std::string parameters)
{
  return std::make_unique<RingSource>();
}

thanks very mush!

At this time, it is not possible to use a compiled source only for the spatial distribution. If you use a compiled source library, it will use it for space, angle, and energy. The only way I could see achieving this is to either 1) modify the original compiled source to sample your desired angle and energy distribution or 2) write a second compiled source library that uses the spatial point sampled from the first source library and then chooses its own angle and energy.

thank you very mush!@paulromano
Is there an example of using PolarAzimuthal function to compile the emission Angle of particles in the custom source?
Is there an example of preparing the particle energy spectrum (giving the particle energy and probability respectively) in the custom source?
thanks a lot!