Repository: climate Updated Branches: refs/heads/master cff5b5459 -> 227b5de93
CLIMATE-552 - Drop unused private functions from local.py Project: http://git-wip-us.apache.org/repos/asf/climate/repo Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/99b57325 Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/99b57325 Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/99b57325 Branch: refs/heads/master Commit: 99b57325dbe9750f237f5b3ff32fabc92ab3e9f0 Parents: cff5b54 Author: Michael Joyce <[email protected]> Authored: Fri Nov 7 11:06:20 2014 -0800 Committer: Michael Joyce <[email protected]> Committed: Fri Nov 7 11:06:20 2014 -0800 ---------------------------------------------------------------------- ocw/data_source/local.py | 107 ------------------------------------------ 1 file changed, 107 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/climate/blob/99b57325/ocw/data_source/local.py ---------------------------------------------------------------------- diff --git a/ocw/data_source/local.py b/ocw/data_source/local.py index 260029e..b72cd70 100644 --- a/ocw/data_source/local.py +++ b/ocw/data_source/local.py @@ -92,107 +92,6 @@ def _get_netcdf_variable_name(valid_var_names, netcdf, netcdf_var): ) raise ValueError(error) - -def _get_lat_name(variable_names): - '''Find the latitude variable name - - :param variable_names: List of netCDF variables' name - :type variable_names: List - - :returns: Latitude variable name - :rtype: String - ''' - - common_name = set(['lat', 'lats', 'latitude', 'latitudes']).intersection(variable_names) - if len(common_name) !=1: - err = "Unable to autodetect latitude variable name." - raise ValueError(err) - else: - lat_variable_name = common_name.pop() - - return lat_variable_name - - -def _get_lon_name(variable_names): - '''Find the longitude variable name - - :param variable_names: List of netCDF variables' name - :type variable_names: List - - :returns: Longitude variable name - :rtype: String - ''' - - common_name = set(['lon', 'lons', 'longitude', 'longitudes']).intersection(variable_names) - if len(common_name) !=1: - err = "Unable to autodetect longitude variable name." - raise ValueError(err) - else: - lon_variable_name = common_name.pop() - - return lon_variable_name - - -def _get_time_name(variable_names): - '''Find the time variable name. - - :param: variableNameList: List of netCDF variables' name - :type variable_names: List - - :returns: Time variable name - :rtype: String - ''' - - common_name = set(['time', 'times', 'date', 'dates', 'julian']).intersection(variable_names) - - if len(common_name) !=1: - err = "Unable to autodetect time variable name. These option(s) found: {0} ".format([each for each in common_name]) - raise ValueError(err) - else: - time_variable_name = common_name.pop() - - return time_variable_name - - -def _get_level_name(variable_names): - '''Find the level variable name. - - :param variable_names: List of netCDF variables' name - type variable_names: List - - :returns: Level variable name - :rtype: String - ''' - - level_variable_name = None - common_name = set(['lev', 'level', 'levels', 'height', 'heights', 'elev', 'elevation', 'elevations']).intersection(variable_names) - if len(common_name) !=1: - pass - else: - level_variable_name = common_name.pop() - - return level_variable_name - - -def _get_value_name(possible_value_name): - '''Find the value variable name. - - :param possible_value_name: List of all value variable names - :type possible_value_name: List - - :returns: Value variable name - :rtype: String - ''' - - if len(possible_value_name) == 1: - value_variable_name = possible_value_name[0] - else: - err = "The given value variable name does not match with existing variables name." - raise ValueError(err) - - return value_variable_name - - def load_file(file_path, variable_name, elevation_index=0): '''Load netCDF file, get the all variables name and get the data. @@ -217,12 +116,6 @@ def load_file(file_path, variable_name, elevation_index=0): lon_name = _get_netcdf_variable_name(LON_NAMES, netcdf, variable_name) time_name = _get_netcdf_variable_name(TIME_NAMES, netcdf, variable_name) - #lat_variable_name = _get_lat_name(variable_names) - #lon_variable_name = _get_lon_name(variable_names) - #time_variable_name = _get_time_name(variable_names) - #level_variable_name = _get_level_name(variable_names) - - # Check returned variable dimensions. lats, lons, and times should be 1D # # Check dimensions of the values
