Exemple #1
0
def _append_height(ceilo: Union[ClCeilo, Ct25k, LufftCeilo],
                   site_altitude: float) -> None:
    """Finds height above mean sea level."""
    tilt_angle = np.median(ceilo.metadata['tilt_angle'])
    height = utils.range_to_height(ceilo.range, float(tilt_angle))
    height += float(site_altitude)
    ceilo.data['height'] = CloudnetArray(np.array(height), 'height')
    ceilo.data['altitude'] = CloudnetArray(site_altitude, 'altitude')
Exemple #2
0
 def add_height(self):
     if 'altitude' in self.data:
         try:
             elevation = ma.median(self.data['elevation'].data)
             tilt_angle = 90 - elevation
         except RuntimeError:
             logging.warning('Assuming 90 deg elevation')
             tilt_angle = 0
         height = utils.range_to_height(self.data['range'].data, tilt_angle)
         height += float(self.data['altitude'].data)
         self.data['height'] = CloudnetArray(height, 'height')
Exemple #3
0
 def prepare_data(self):
     """Add common additional data / metadata and convert into CloudnetArrays."""
     zenith_angle = self.data["zenith_angle"]
     self.data["height"] = np.array(
         self.site_meta["altitude"] +
         utils.range_to_height(self.data["range"], zenith_angle))
     for key in ("time", "range"):
         self.data[key] = np.array(self.data[key])
     self.data["wavelength"] = float(self.instrument.wavelength)
     for key in ("latitude", "longitude", "altitude"):
         if key in self.site_meta:
             self.data[key] = float(self.site_meta[key])
 def add_height(self):
     if 'altitude' in self.data:
         try:
             elevation = self.getvar('elv', 'elevation')
             tilt_angle = 90 - ma.median(elevation)
         except RuntimeError:
             logging.warning('Assuming 90 deg elevation')
             tilt_angle = 0
         height = utils.range_to_height(self.getvar('range'), tilt_angle)
         height += float(self.data['altitude'].data)
         height = np.array(height)
         self.data['height'] = CloudnetArray(height, 'height')
def test_range_to_height(los_range, tilt_angle, result):
    height = utils.range_to_height(los_range, tilt_angle)
    assert_array_almost_equal(height, result)
Exemple #6
0
def _append_height(ceilo, site_altitude):
    """Finds height above mean sea level."""
    tilt_angle = np.median(ceilo.metadata['tilt_angle'])
    height = utils.range_to_height(ceilo.range, tilt_angle)
    height += float(site_altitude)
    ceilo.data['height'] = CloudnetArray(height, 'height')