Exemple #1
0
def test_simulation_scattering_combined(scattering_solver):

    ice = ScatteringSpecies("ice", D14(-1.0, 2.0),
                            scattering_data = scattering_data,
                            scattering_meta_data = scattering_meta)
    ice.psd.t_min = 0.0
    ice.psd.t_max = 275.0

    ici = ICI(channel_indices = [0, -1], stokes_dimension = 1)
    ici.sensor_line_of_sight = np.array([[135.0]])
    ici.sensor_position = np.array([[600e3]])

    cs = CloudSat(stokes_dimension = 1)
    cs.range_bins = np.linspace(0, 30e3, 31)
    cs.sensor_line_of_sight = np.array([[135.0]])
    cs.sensor_position = np.array([[600e3]])

    atmosphere = Atmosphere1D(absorbers = [O2(), N2(), H2O()],
                              scatterers = [ice],
                              surface = Tessem())
    simulation = ArtsSimulation(atmosphere = atmosphere,
                                data_provider = DataProvider(),
                                sensors = [ici, cs])

    simulation.scattering_solver = scattering_solver()
    simulation.setup()
    simulation.run()
    y = np.copy(simulation.workspace.y)
    return y
Exemple #2
0
def test_simulation_telsem():
    atmosphere = Atmosphere1D(absorbers=[O2(), N2(), H2O()],
                              surface=Telsem("/home/simon/Downloads"))
    mwi = MWI()
    mwi.sensor_line_of_sight = np.array([[135.0]])
    mwi.sensor_position = np.array([[600e3]])

    data_provider = DataProvider()
    data_provider.surface_temperature = 280.0 * np.ones((1, 1))
    data_provider.latitude = 58.0
    data_provider.longitude = 12.0
    simulation = ArtsSimulation(atmosphere=atmosphere,
                                data_provider=data_provider,
                                sensors=[mwi])
    simulation.setup()
    simulation.run()
Exemple #3
0
def test_simulation_tessem():
    atmosphere = Atmosphere1D(absorbers=[O2(), N2(), H2O()], surface=Tessem())
    mwi = MWI()
    mwi.sensor_line_of_sight = np.array([[135.0]])
    mwi.sensor_position = np.array([[600e3]])

    simulation = ArtsSimulation(atmosphere=atmosphere,
                                data_provider=DataProvider(),
                                sensors=[mwi])
    simulation.setup()
    simulation.run()

    y1 = np.copy(mwi.y)

    simulation.run()
    y2 = np.copy(mwi.y)

    assert (np.all(np.isclose(y1, y2)))
Exemple #4
0
def test_simulation_absorption_jacobian():
    atmosphere = Atmosphere1D(absorbers = [O2(), N2(), H2O()],
                              surface = Tessem())
    o2, n2, h2o = atmosphere.absorbers

    ici = ICI(channel_indices = [0, -1])
    ici.sensor_line_of_sight = np.array([[135.0]])
    ici.sensor_position = np.array([[600e3]])

    simulation = ArtsSimulation(atmosphere = atmosphere,
                                data_provider = DataProvider(),
                                sensors = [ici])
    simulation.jacobian.add(o2)
    simulation.jacobian.add(n2)
    simulation.jacobian.add(h2o)
    simulation.setup()
    simulation.run()
    return np.copy(simulation.workspace.jacobian.value)
Exemple #5
0
def test_simulation_multiview():
    atmosphere = Atmosphere1D(absorbers = [O2(), N2(), H2O()],
                              surface = Tessem())
    lines_of_sight = np.array([[135.0],
                               [180.0]])
    positions = np.array([[600e3],
                          [600e3]])

    ici = ICI(lines_of_sight=lines_of_sight,
              positions=positions)

    simulation = ArtsSimulation(atmosphere = atmosphere,
                                data_provider = DataProvider(),
                                sensors = [ici])
    simulation.setup()
    simulation.run()

    y = np.copy(ici.y)
    assert(y.shape[0] == 2)
Exemple #6
0
def test_simulation_scattering(scattering_solver):

    ice = ScatteringSpecies("ice", D14(-1.0, 2.0),
                            scattering_data = scattering_data,
                            scattering_meta_data = scattering_meta)
    ice.psd.t_min = 0.0
    ice.psd.t_max = 275.0

    atmosphere = Atmosphere1D(absorbers = [O2(), N2(), H2O()],
                              scatterers = [ice],
                              surface = Tessem())
    ici = ICI(stokes_dimension = 1, channel_indices = [1, -1])
    ici.sensor_line_of_sight = np.array([[135.0]])
    ici.sensor_position = np.array([[600e3]])

    simulation = ArtsSimulation(atmosphere = atmosphere,
                                data_provider = DataProvider(),
                                sensors = [ici])
    simulation.scattering_solver = scattering_solver()
    simulation.setup()
    simulation.run()
Exemple #7
0
def test_simulation_combined():
    surface_1 = Tessem()
    surface_2 = Telsem("/home/simon/Downloads")
    surface = CombinedSurface(surface_1, surface_2)
    atmosphere = Atmosphere1D(absorbers=[O2(), N2(), H2O()], surface=surface)
    mwi = MWI()
    mwi.sensor_line_of_sight = np.array([[135.0]])
    mwi.sensor_position = np.array([[600e3]])

    data_provider = DataProvider()
    data_provider.surface_temperature = 280.0 * np.ones((1, 1))
    data_provider.surface_latitude = 58.0
    data_provider.surface_longitude = 12.0
    data_provider.surface_type = 0.0

    simulation = ArtsSimulation(atmosphere=atmosphere,
                                data_provider=data_provider,
                                sensors=[mwi])

    simulation.setup()
    simulation.run()
    y = np.copy(mwi.y)

    atmosphere_r = Atmosphere1D(absorbers=[O2(), N2(), H2O()],
                                surface=surface_1)
    simulation_r = ArtsSimulation(atmosphere=atmosphere_r,
                                  data_provider=data_provider,
                                  sensors=[mwi])
    simulation_r.setup()
    simulation_r.run()
    y_r = np.copy(mwi.y)

    assert (np.allclose(y, y_r))

    data_provider.surface_type = 1.0
    simulation.setup()
    simulation.run()
    y = np.copy(mwi.y)

    atmosphere_r = Atmosphere1D(absorbers=[O2(), N2(), H2O()],
                                surface=surface_2)
    simulation_r = ArtsSimulation(atmosphere=atmosphere_r,
                                  data_provider=data_provider,
                                  sensors=[mwi])
    simulation_r.setup()
    simulation_r.run()
    y_r = np.copy(mwi.y)

    assert (np.allclose(y, y_r))
Exemple #8
0
def test_simulation_scattering_jacobian():

    ice = ScatteringSpecies("ice", D14(-1.0, 2.0),
                            scattering_data = scattering_data,
                            scattering_meta_data = scattering_meta)
    ice.psd.t_min = 0.0
    ice.psd.t_max = 275.0

    atmosphere = Atmosphere1D(absorbers = [O2(), N2(), H2O()],
                              scatterers = [ice],
                              surface = Tessem())
    ici = ICI(channel_indices = [1, -1])
    ici.sensor_line_of_sight = np.array([[135.0]])
    ici.sensor_position = np.array([[600e3]])

    simulation = ArtsSimulation(atmosphere = atmosphere,
                                data_provider = DataProvider(),
                                sensors = [ici])
    simulation.jacobian.add(ice.mass_density)
    simulation.setup()
    simulation.run()
    print(simulation.workspace.particle_bulkprop_field.value)
    return np.copy(simulation.workspace.jacobian.value)
Exemple #9
0
                                data_provider = DataProvider(),
                                sensors = [cs])
    simulation.setup()
    simulation.run()

    y = np.copy(cs.y)
    assert(y.shape[0] == 2)
    assert(y.shape[-1] == 2)


ice = ScatteringSpecies("ice", D14(-1.0, 2.0),
                        scattering_data = scattering_data,
                        scattering_meta_data = scattering_meta)
ice.psd.t_min = 0.0
ice.psd.t_max = 275.0

atmosphere = Atmosphere1D(absorbers = [O2(), N2(), H2O()],
                            scatterers = [],
                            surface = Tessem())
ici = ICI(stokes_dimension = 1, channel_indices = [1, -1])
ici.sensor_line_of_sight = np.array([[135.0]])
ici.sensor_position = np.array([[600e3]])

simulation = ArtsSimulation(atmosphere = atmosphere,
                            data_provider = DataProvider(),
                            sensors = [ici])
simulation.scattering_solver = RT4()
simulation.setup()
for i in range(100):
    simulation.run()