diviner
Helpers for Diviner data.
add_wls_diviner(xarr, bands=('t3', 't4', 't5', 't6', 't7', 't8', 't9'))
Return xarr with wavelength coordinate.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xarr |
DataArray
|
Diviner lev4 hourly temperature data |
required |
bands |
tuple
|
bands to include in output |
('t3', 't4', 't5', 't6', 't7', 't8', 't9')
|
Source code in roughness/diviner.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
|
div_integrated_rad(emission, units='W/m^2/sr/um')
Return integrated radiance of diviner bands.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
emission |
DataArray
|
Diviner radiated emission |
required |
units |
str
|
units of output |
'W/m^2/sr/um'
|
Source code in roughness/diviner.py
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
|
div_tbol(divbt, wl1=DIV_WL1, wl2=DIV_WL2, tmin=DIV_TMIN, iters=ITERS)
Return bolometric temperature from Diviner C3-C9 brightness temperatures (s.o.m, Paige et al., 2010, in Science).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
divbt |
array
|
Diviner brightness temperatures |
required |
wl1 |
array
|
lower wavelength bound of each band |
DIV_WL1
|
wl2 |
array
|
upper wavelength bound of each band |
DIV_WL2
|
tmin |
array
|
minimum temperature of each band |
DIV_TMIN
|
iters |
array
|
number of iterations for each band |
ITERS
|
Source code in roughness/diviner.py
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 |
|
divfilt_rad(wnrad, div_filt=None)
Return radiance of Diviner bands (convolve rad with Diviner filter funcs).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wnrad |
DataArray
|
Diviner radiance in wavenumber space |
required |
div_filt |
DataArray
|
Diviner filter functions |
None
|
Source code in roughness/diviner.py
341 342 343 344 345 346 347 348 349 350 351 352 |
|
divrad2bt(divrad, fdiv_t2r=FDIV_T2R)
Return brightness temperatures from Diviner radiance (e.g. from div_filt).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
divrad |
DataArray
|
Diviner radiance |
required |
fdiv_t2r |
str
|
path to Diviner t2r lookup table |
FDIV_T2R
|
Source code in roughness/diviner.py
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 |
|
emission2tbol_xr(emission, wls=None, div_filt=None)
Return tbol from input emission array at wls.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
emission |
DataArray
|
Diviner radiated emission |
required |
wls |
DataArray
|
wavelengths to integrate over |
None
|
div_filt |
DataArray
|
Diviner filter functions |
None
|
Source code in roughness/diviner.py
383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 |
|
fit_poly_daytime(Tday, deg=2)
Return polynomial fit of order deg to daytime temperature data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
Tday |
array
|
daytime temperature data |
required |
deg |
int
|
order of polynomial fit |
2
|
Source code in roughness/diviner.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
|
get_diviner_wls(bres=1)
Return diviner c3-c9 wavelength arr with band_res values in each bandpass.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bres |
int
|
number of wavelength values in each bandpass |
1
|
Source code in roughness/diviner.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
|
lev4hourly2xr(fgrds, ext=None, savefile=None, tres=None, interp_method=None, interp_wrap=False)
Return xarray of Diviner lev4 hourly grd tiles with time resolution tres.
If interp_method: Interpolate missing values along tloc axis with method specified (e.g. 'nearest', 'linear', 'cubic', see xr.interpolate_na methods). Linear seems to produce fewest sharp artifacts.
If savefile: save result to netCDF (.nc) file for quick I/O into xarray, e.g. with xr.open_dataarray(savefile).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fgrds |
list of str
|
list of paths to .grd files (e.g. from glob) |
required |
tres |
num
|
time resolution |
None
|
interp_method |
str
|
interpolation method (see xarray.interpolate_na) |
None
|
interp_wrap |
bool
|
interpolate around time axis (wrap around 0/24h) |
False
|
ext |
list
|
extent of ROI |
None
|
savefile |
str
|
Path to save result to netCDF (.nc) file |
None
|
Source code in roughness/diviner.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
|
load_div_filters(fdiv_filt=FDIV_FILT, scale=True, wlunits=True, bands=DIV_C)
cached
Return Diviner filter functions
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fdiv_filt |
str
|
path to Diviner filter functions |
FDIV_FILT
|
scale |
bool
|
scale filter functions by FILT_SCALE |
True
|
wlunits |
bool
|
convert wavenumber to wavelength |
True
|
bands |
tuple
|
bands to include in output |
DIV_C
|
Source code in roughness/diviner.py
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 |
|
load_div_lev4(roi, ext, savefile='T.nc', smoothday=False, invert_y=False, load_cached=True, divdir=DATA_DIR_DIVINER / 'lev4')
Return Diviner lev4 data as xarray.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
roi |
str
|
region of interest |
required |
ext |
list
|
extent of ROI |
required |
savefile |
str
|
Path to save result to netCDF (.nc) file |
'T.nc'
|
smoothday |
bool
|
smooth daytime temperatures with 2nd order polyfit |
False
|
invert_y |
bool
|
invert y axis (sometimes Diviner data inverted) |
False
|
load_cached |
bool
|
load cached data if available |
True
|
divdir |
str
|
path to Diviner data directory |
DATA_DIR_DIVINER / 'lev4'
|
Source code in roughness/diviner.py
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 |
|
load_div_t2r(fdiv_t2r=FDIV_T2R)
cached
Return Diviner temperature to radiance lookup table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fdiv_t2r |
str
|
path to Diviner t2r lookup table |
FDIV_T2R
|
Source code in roughness/diviner.py
330 331 332 333 334 335 336 337 338 |
|
smooth_daytime(T_xarr, savefile=None)
Return smoothed daytime T from 6 AM to 6 PM with 2nd order polyfit.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
T_xarr |
DataArray
|
Diviner lev4 hourly temperature data |
required |
savefile |
str
|
Path to save result to netCDF (.nc) file |
None
|
Source code in roughness/diviner.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
|