Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
# [Unreleased] - yyyy-mm-dd

### Fixed
- dial.py to accomodate python change for nan
- update hsrl.py to use py3 integer divide. fixes date parsing.
- units for backscatter coeffiecient to km-1 sr-1 in output files generated with aop.py
- conversion from km to m in icartt.py
Expand All @@ -16,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- add configuration file for GEOS-5430 (current FP)
- add a buddy check code for station observation QC
- add reader for GloSSAC data
- support for HALO in hsrl.py

### Changed
- use xesmf regridder to station sampling. this is more efficient that using xarray native interp
Expand Down Expand Up @@ -106,7 +108,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Added list parsing for variables in trajectory sampler
- fixed byte string bug in aeronet.py
- - use a local copy of RH in aop calculator. otherwise it overwrites when fixRH is used
- use a local copy of RH in aop calculator. otherwise it overwrites when fixRH is used
### Added
- MPL reader and plot curtain
- calculation of total backscatter coefficient in aop.py
Expand Down
2 changes: 1 addition & 1 deletion src/pyobs/dial.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os

import h5py
from numpy import ones, zeros, interp, NaN, isnan, array, ma
from numpy import ones, zeros, interp, nan as NaN, isnan, array, ma
from datetime import datetime, timedelta

from matplotlib.pyplot import imshow, xlabel, ylabel, title, colorbar, \
Expand Down
23 changes: 20 additions & 3 deletions src/pyobs/hsrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Implements Python interface to the HSRL L2 data.
"""

import os
import h5py
import numpy as np
from datetime import datetime, timedelta
Expand Down Expand Up @@ -79,8 +79,15 @@
'Relative_Humidity',
)
}
SDS_HALO = {
'/': ('lat', 'lon', 'time', 'z',
'1064_bsc_cloud_screened', '1064_ext', '1064_aer_dep',
'532_bsc_cloud_screened', '532_ext', '532_aer_dep'),
'Nav_Data': ('gps_date', 'date', 'gps_alt', 'gps_lat', 'gps_lon', 'gps_time'),
'State': ('Pressure', 'Temperature', 'Relative_Humidity')
}

NAV = ( 'Altitude','date', 'gps_date','gps_lat','gps_lon','gps_time')
NAV = ( 'Altitude','date', 'gps_date','gps_lat','gps_lon','gps_time','lat','lon','time','z')

# Short names
# -----------
Expand Down Expand Up @@ -169,7 +176,17 @@ def __init__ (self,hsrl_filename,Nav_only=False,verbose=True,freq=3.0,

# Handle incosistency of date across HSRL datasets
# -----------------------------------------------
if self.nt != self.date.shape[0]:
if getattr(self, 'date', None) is None:
import re
match = re.search(r'_(\d{8})_', os.path.basename(hsrl_filename))
if match:
dt_str = match.group(1)
# Format as MM/DD/YYYY to match HSRL convention
dates = '%s/%s/%s' % (dt_str[4:6], dt_str[6:8], dt_str[0:4])
self.date = np.array([dates for i in range(self.nt)])
else:
raise ValueError(f"Missing date variable and could not parse YYYYMMDD from filename: {hsrl_filename}")
elif self.nt != self.date.shape[0]:
date_ = self.date[0,0]
yy = int(date_)//10000
mm = (int(date_) - yy * 10000)//100
Expand Down
Loading