pypromice 1.4.4__py3-none-any.whl → 1.5.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pypromice might be problematic. Click here for more details.

@@ -92,7 +92,7 @@ def toL2(
92
92
  baseline_elevation = (ds.gps_alt.to_series().resample('MS').median()
93
93
  .reindex(ds.time.to_series().index, method='nearest')
94
94
  .ffill().bfill())
95
- mask = (np.abs(ds.gps_alt - baseline_elevation) < 100) & ds.gps_alt.notnull()
95
+ mask = (np.abs(ds.gps_alt - baseline_elevation) < 100) | ds.gps_alt.isnull()
96
96
  ds[['gps_alt','gps_lon', 'gps_lat']] = ds[['gps_alt','gps_lon', 'gps_lat']].where(mask)
97
97
 
98
98
  # removing dlr and ulr that are missing t_rad
@@ -102,16 +102,16 @@ def toL2(
102
102
 
103
103
  # calculating realtive humidity with regard to ice
104
104
  T_100 = _getTempK(T_0)
105
- ds['rh_u_cor'] = correctHumidity(ds['rh_u'], ds['t_u'],
105
+ ds['rh_u_wrt_ice_or_water'] = adjustHumidity(ds['rh_u'], ds['t_u'],
106
106
  T_0, T_100, ews, ei0)
107
107
 
108
108
  if ds.attrs['number_of_booms']==2:
109
- ds['rh_l_cor'] = correctHumidity(ds['rh_l'], ds['t_l'],
109
+ ds['rh_l_wrt_ice_or_water'] = adjustHumidity(ds['rh_l'], ds['t_l'],
110
110
  T_0, T_100, ews, ei0)
111
111
 
112
112
  if hasattr(ds,'t_i'):
113
113
  if ~ds['t_i'].isnull().all():
114
- ds['rh_i_cor'] = correctHumidity(ds['rh_i'], ds['t_i'],
114
+ ds['rh_i_wrt_ice_or_water'] = adjustHumidity(ds['rh_i'], ds['t_i'],
115
115
  T_0, T_100, ews, ei0)
116
116
 
117
117
  # Determiune cloud cover for on-ice stations
@@ -419,9 +419,12 @@ def calcTilt(tilt_x, tilt_y, deg2rad):
419
419
  return phi_sensor_rad, theta_sensor_rad
420
420
 
421
421
 
422
- def correctHumidity(rh, T, T_0, T_100, ews, ei0): #TODO figure out if T replicate is needed
423
- '''Correct relative humidity using Groff & Gratch method, where values are
424
- set when freezing and remain the original values when not freezing
422
+ def adjustHumidity(rh, T, T_0, T_100, ews, ei0): #TODO figure out if T replicate is needed
423
+ '''Adjust relative humidity so that values are given with respect to
424
+ saturation over ice in subfreezing conditions, and with respect to
425
+ saturation over water (as given by the instrument) above the melting
426
+ point temperature. Saturation water vapors are calculated after
427
+ Groff & Gratch method.
425
428
 
426
429
  Parameters
427
430
  ----------
@@ -440,7 +443,7 @@ def correctHumidity(rh, T, T_0, T_100, ews, ei0): #TODO f
440
443
 
441
444
  Returns
442
445
  -------
443
- rh_cor : xarray.DataArray
446
+ rh_wrt_ice_or_water : xarray.DataArray
444
447
  Corrected relative humidity
445
448
  '''
446
449
  # Convert to hPa (Groff & Gratch)
@@ -458,8 +461,8 @@ def correctHumidity(rh, T, T_0, T_100, ews, ei0): #TODO f
458
461
  freezing = (T < 0) & (T > -100).values
459
462
 
460
463
  # Set to Groff & Gratch values when freezing, otherwise just rh
461
- rh_cor = rh.where(~freezing, other = rh*(e_s_wtr / e_s_ice))
462
- return rh_cor
464
+ rh_wrt_ice_or_water = rh.where(~freezing, other = rh*(e_s_wtr / e_s_ice))
465
+ return rh_wrt_ice_or_water
463
466
 
464
467
 
465
468
  def correctPrecip(precip, wspd):