Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
thorbjoernl committed Apr 25, 2024
1 parent e7aac0f commit 3b4fbeb
Showing 1 changed file with 0 additions and 67 deletions.
67 changes: 0 additions & 67 deletions pyaerocom/vert_coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,72 +393,5 @@ def _check_var_in_data_obj(self, var_name):
if std_name in self.data_obj:
self[var_name] = self.data_obj[std_name]

def check_altitude_access(self, **coord_info) -> bool:
"""Checks if altitude levels can be accessed
Parameters
----------
**coord_info
test coordinate specifications for extraction of 1D data object.
Passed to :func:`extract_1D_subset_from_data`.
Returns
-------
bool
True, if altitude access is provided, else False
"""
# 1. check if altitude or pressure field is available in data object as
# variable
for coord in self.coord_list:
if coord in self._checked_and_failed:
continue
elif self._check_altitude_access_helper(coord, **coord_info):
return True
self._checked_and_failed.append(coord)
return False

def _check_altitude_access_helper(self, coord_name, **coord_info) -> bool:
cstd_name = const.COORDINFO[coord_name].standard_name

if not self.search_aux_coords(coord_name):
if isinstance(cstd_name, str):
if not self.search_aux_coords(cstd_name):
return False

coord = VerticalCoordinate(cstd_name)
if coord.conversion_supported:
if self.search_aux_coords(coord.conversion_requires):
if self._verify_altitude_access(coord):
return True
return False

def _verify_altitude_access(self, coord, **coord_info) -> bool:
"""Verify access of altitude data
Parameters
----------
subset : GriddedData
1-dimensional subset of input data object
coord : VerticalCoordinate
instance of vertical coordinate that is used to specify requirements
for altitude computation
Returns
-------
bool
True, if altitude access was sueccessful, else False
"""
subset = self._subset1d
if subset is None:
subset = self.extract_1D_subset_from_data(**coord_info)

subset._update_coord_info()
cstd_name = coord.standard_name
if not subset[cstd_name].ndim == 1:
raise DataDimensionError(
f"Unexpected error: dimension of variable {cstd_name} should be 1"
)
raise NotImplementedError

def get_altitude(self, latitude, longitude):
raise NotImplementedError

0 comments on commit 3b4fbeb

Please sign in to comment.