Exemplo n.º 1
0
    def generate(self):
        print('Gauss generation requested')
        Nx, Ny, Nz = [b.value() for b in NspinBoxes]
        Lx, Ly, Lz = [b.value() for b in LspinBoxes]
        a = self.aSpinBox.value()

        if self.covRB.isChecked():
            gen = generator.HomogeneousGenerator(
                Nx,
                Ny,
                Nz,
                Lx,
                Ly,
                Lz,
                covariance=lambda x, y, z: np.exp(-(x * x + y * y + z * z) /
                                                  (a * a)))
        elif self.specRB.isChecked():
            gen = generator.HomogeneousGenerator(
                Nx,
                Ny,
                Nz,
                Lx,
                Ly,
                Lz,
                spectrum=lambda kx, ky, kz: a**3 / 8 / np.pi**
                (3 / 2) * np.exp(-a * a * (kx * kx + ky * ky + kz * kz) / 4))
        else:
            print('Select covariance or spectrum')
            return

        volumetricPlot.setData(Nx, Ny, Nz, Lx, Ly, Lz, gen.get_current_field())
        del gen
Exemplo n.º 2
0
 def generate(self):
   print('Treuhaft & Lanyi generation requested')
   Nx,Ny,Nz = [b.value() for b in NspinBoxes]
   Lx,Ly,Lz = [b.value() for b in LspinBoxes]
   
   L = self.LSpinBox.value()
   
   gen = generator.HomogeneousGenerator(Nx,Ny,Nz,Lx,Ly,Lz,
       covariance=generator.TreuhaftLanyiCovariance(1, L))
   
   volumetricPlot.setData(Nx,Ny,Nz,Lx,Ly,Lz,gen.get_current_field())
   del gen
Exemplo n.º 3
0
 def generate(self):
   print('Ishimaru generation requested')
   Nx,Ny,Nz = [b.value() for b in NspinBoxes]
   Lx,Ly,Lz = [b.value() for b in LspinBoxes]
   
   Lmin = self.LminSpinBox.value()
   L0 = self.L0SpinBox.value()
   
   gen = generator.HomogeneousGenerator(Nx,Ny,Nz,Lx,Ly,Lz,
       spectrum=generator.IshimaruSpectrum(1, L0, 1/Lmin if Lmin != 0 else np.inf))
   
   volumetricPlot.setData(Nx,Ny,Nz,Lx,Ly,Lz,gen.get_current_field())
   del gen
Exemplo n.º 4
0
        #objects.append(Cone(elevation=el,azimuth=az,origin=(0,0,0),hpbw=3))
        objects.append(
            Line(elevation=el,
                 azimuth=az,
                 origin=(Lx / 2 + 0.1, Ly / 2 + 0.1, 0)))

# 2a) Create the appropriate object
# Spatial specification
Cn2 = 1e-14
L = 1e3
H = 3e3
gen = generator.HomogeneousGenerator(
    Nx,
    Ny,
    Nz,
    Lx,
    Ly,
    Lz,
    covariance=generator.TreuhaftLanyiCovariance(Cn2, L),
    inhomogeneity=lambda z: np.exp(-z / H))

# Configure time evolution
wind_x = Lx / Nx  # 1 square per unit time
wind_y = 0.1 * wind_x
updaters = []
updaters.append(updater.FrozenFieldUpdate(wind_x, wind_y))
updaters.append(
    updater.IntrinsicUpdater(
        gen, updater.frequencyToAvoidPeriodicity(gen, wind_x, wind_y)))

# Creates a directory with output, caches and log files