Exemplo n.º 1
0
    obsz2 = radiopropa.ObserverSurface(
        radiopropa.Plane(radiopropa.Vector3d(0, 0, -300),
                         radiopropa.Vector3d(0, 0, 1)))
    obs.add(obsz2)
    obs2.setDeactivateOnDetection(True)
    sim.add(obs2)

    # Output
    output = radiopropa.HDF5Output('output_traj.h5',
                                   radiopropa.Output.Trajectory3D)
    output.setLengthScale(radiopropa.meter)
    #output.enable(radiopropa.Output.CurrentAmplitudeColumn)
    output.enable(radiopropa.Output.SerialNumberColumn)
    sim.add(output)

    # Source

    #Start rays from 0 - 90 deg
    for phi in np.linspace(0, 90):

        source = radiopropa.Source()
        source.add(radiopropa.SourcePosition(radiopropa.Vector3d(0, 0, -240.)))
        source.add(radiopropa.SourceAmplitude(1))
        source.add(radiopropa.SourceFrequency(1E6))
        z = np.cos(phi * radiopropa.deg)
        x = np.sin(phi * radiopropa.deg)
        source.add(radiopropa.SourceDirection(radiopropa.Vector3d(x, 0, z)))
        print('Ray Direction {} deg = ({}, 0, {})'.format(phi, x, z))
        sim.setShowProgress(True)
        sim.run(source, 1)
Exemplo n.º 2
0
    end_planes.add(end_plane_bottom)
    end_planes.add(end_plane_top)
    end_planes.add(end_plane_right)
    end_planes.setDeactivateOnDetection(True)
    sim.add(end_planes)

    #output
    output = radiopropa.HDF5Output('trajectory_atmosphere.h5',
                                   radiopropa.Output.Trajectory3D)
    output.setLengthScale(radiopropa.meter)
    output.enable(radiopropa.Output.SerialNumberColumn)
    sim.add(output)

    #Simulate rays from 0 to 90 degrees in 5 degree steps
    angles = np.arange(0, 90, 10)
    for phi in angles:
        sim.add(airBoundary)
        sim.add(radiopropa.MaximumTrajectoryLength(50000 * radiopropa.meter))

        source = radiopropa.Source()
        source.add(radiopropa.SourcePosition(radiopropa.Vector3d(0, 0, 0)))
        source.add(radiopropa.SourceAmplitude(1))
        source.add(radiopropa.SourceFrequency(50e6))

        z = np.cos(phi * radiopropa.deg)
        x = np.sin(phi * radiopropa.deg)
        source.add(radiopropa.SourceDirection(radiopropa.Vector3d(x, 0, z)))
        print('Ray Direction {} deg').format(phi)
        sim.setShowProgress(True)
        sim.run(source, 1)