def remove_variables_with_non_spatiotemporal_dimensions(variables,
    spatiotemporal_var_names):
    """
    Remove from a list of netCDF variables any which have dimensionality which is not in an approved list
    of valid spatial or temporal dimensions (e.g. sensor number, pseudo dimensions). CIS currently does not
    support variables with this dimensionality and will fail if they are used.

    :param variables: Dictionary of netCDF variable names : Variable objects. Variable names may be fully qualified
      NetCDF4 Hierarchical group variables in the form ``<group1>/<group2....>/<variable_name>``,
      e.g. ``AVHRR/Ch4CentralWavenumber``.
    :param spatiotemporal_var_names: List of valid spatiotemporal dimensions.
    :return: None
    """
    if spatiotemporal_var_names is not None:
        for var in list(variables.keys()):
            for dim in variables[var].dimensions:
                if dim not in spatiotemporal_var_names:
                    del variables[var]
                    break
