Ejemplo n.º 1
0
def mock_get_input_datasets(data_sources, t0, dt, n_steps):
    for data in data_sources:
        connector = data.pop("connector")   # We don't have a connector, so ignore here.
        for station_id, sources in data.iteritems():
            for source, uid in sources.iteritems():
                if source == "radiation":
                    mock_data = create_mock_station_data(t0,  dt, n_steps)
Ejemplo n.º 2
0
def mock_station_data(bounding_box, n_x, n_y):
    geo_positions = []
    x_min, x_max, y_min, y_max = bounding_box
    dx = float(x_max - x_min)/n_x
    dy = float(y_max - y_min)/n_y

    data = []

    for i in xrange(n_x):
        x = x_min + (i + 0.5)*dx
        for j in xrange(n_y):
            y = y_min + (j + 0.5)*dy
            z = abs(1000*math.sin(x/10000.0 + y/10000.0))   # Crop at 1000 mas
            geo_positions.append([x, y, z])
            data.append(InputSource([x, y, z], create_mock_station_data(0, 3600, 10)))
    return data