Exemplo n.º 1
0
def test_ice_fields():
    """
    test that data is loaded
    checks there is non-zero motion.
    """

    pSpill = sample_sc_release(num_le, start_pos, rel_time)
    ice_mover = IceMover(ice_file, topology_file)
    vels = ice_mover.get_ice_velocities(test_time)
    frac, thick = ice_mover.get_ice_fields(test_time)

    # fraction values between 0 and 1
    assert (np.all(frac[:] <= 1) and np.all(frac[:] >= 0) and not np.all(frac[:] == 0))

    # thickness >= 0, < 10 in this example...
    assert (np.all(thick[:] <= 10) and np.all(thick[:] >= 0) and not np.all(thick[:] == 0))
Exemplo n.º 2
0
def test_ice_fields():
    """
    test that data is loaded
    checks there is non-zero motion.
    """

    pSpill = sample_sc_release(num_le, start_pos, rel_time)
    ice_mover = IceMover(ice_file, topology_file)
    vels = ice_mover.get_ice_velocities(test_time)
    frac, thick = ice_mover.get_ice_fields(test_time)

    # fraction values between 0 and 1
    assert (np.all(frac[:] <= 1) and np.all(frac[:] >= 0) and not np.all(frac[:] == 0))

    # thickness >= 0, < 10 in this example...
    assert (np.all(thick[:] <= 10) and np.all(thick[:] >= 0) and not np.all(thick[:] == 0))