Ejemplo n.º 1
0
output.setLengthScale(radiopropa.meter)
#output.enableProperty('frequency', 0., 'Frequency for RadioPropa')

#obs.onDetection(output)
#obs.setDeactivateOnDetection(True)
sim.add(output)

source = radiopropa.Source()

source.add(radiopropa.SourcePosition(radiopropa.Vector3d(0, 0, 0)))
source.add(radiopropa.SourceParticleType(radiopropa.nucleusId(1, 1)))
source.add(radiopropa.SourceAmplitude(1))

#source.add(radiopropa.SourceIsotropicEmission())
source.add(radiopropa.SourceDirection(radiopropa.Vector3d(.3, 0, 1.)))

# Not constructiong this outside the add method will cause segfault
source.add(radiopropa.SourceFrequency(1E6))

#Two transmissive layers at +/- 10 m

sim.add(radiopropa.MinimumAmplitude(1E-2))
sim.add(radiopropa.MaximumTrajectoryLength(2000))

#boundary = radiopropa.SphericalBoundary(radiopropa.Vector3d(0, 0, 0), 100*radiopropa.meter)
#sim.add(boundary)

sim.setShowProgress(True)
sim.run(source, 1)
#print rf
Ejemplo n.º 2
0
    radiopropa.Plane(radiopropa.Vector3d(0, 0, 0),
                     radiopropa.Vector3d(0, 0, 1)), 1.5, 1.)
firnLayer = radiopropa.Discontinuity(
    radiopropa.Plane(radiopropa.Vector3d(0, 0, -10.),
                     radiopropa.Vector3d(0, 0, 1)),
    iceModel.getValue(radiopropa.Vector3d(0, 0, -10.001)), 1.5)

if __name__ == "__main__":
    # simulation setup
    sim = radiopropa.ModuleList()
    sim.add(radiopropa.PropagationCK(iceModel, 1E-8, .001, 1.))

    sim.add(airBoundary)
    sim.add(firnLayer)

    sim.add(radiopropa.MinimumAmplitude(.05))
    sim.add(radiopropa.MaximumTrajectoryLength(1500 * radiopropa.meter))

    # Observer to stop imulation at = 30m and z=300m
    obs = radiopropa.Observer()
    obsz = radiopropa.ObserverSurface(
        radiopropa.Plane(radiopropa.Vector3d(0, 0, 30),
                         radiopropa.Vector3d(0, 0, 1)))
    obs.add(obsz)
    obs.setDeactivateOnDetection(True)
    sim.add(obs)

    obs2 = radiopropa.Observer()
    obsz2 = radiopropa.ObserverSurface(
        radiopropa.Plane(radiopropa.Vector3d(0, 0, -300),
                         radiopropa.Vector3d(0, 0, 1)))