1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 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 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 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 236 237 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 297 298 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 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 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 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575
|
**********************************************************************************************
****************** Overview of the CDAT interface to the NCAR SPHEREPACK 3.0 *****************
**********************************************************************************************
None
************************************************************************************
************************** Sphere class documentation ******************************
************************************************************************************
--------------------------------------------------------------------------------------
To make an instance x of the Sphere class type
x = sphere.Sphere(lonArray , latArray, numberLevels = nlev, numberTimes = ntime,
computed_stored = 'computed')
where nlev and ntime are the actual number of levels and times respectively and the
keywords are
lonArray = longitude vector (required)
latArray = latitude vector (required)
numberLevels = number of levels (optional)
numberTimes = number of times (optional)
computed_stored (optional) : 'computed' -- computed Legendre polynomials
'stored' -- stored Legendre polynomials
This choice involves a 30% storage/speed tradeoff
As an example, for a 2D field using 'computed Legendre polynomials' type
x = sphere.Sphere(lonArray , latArray)
As an example, for a 4D field with 3 levels, 120 times using 'stored Legendre polynomials' type
x = sphere.Sphere(lonArray , latArray, 3, 120, 'stored')
or using the keywords explicitly
x = sphere.Sphere(lonArray , latArray, numberLevels = 3, numberTimes = 120,
computed_stored = 'stored')
where the order of the keyword entries is immaterial.
-----------------------------------------------------------------------------------
**************************** Sphere class functions ********************************
--------------------------------------------------------------------------------------------------------
routine: div
purpose: computes the divergence of a vector function
usage: div = x.div( u, v, missingValue) where x is an instance of Sphere
passed: u -- zonal vector function on a global grid
v -- meridional vector function on a global grid
missingValue -- an optional number requesting a check for missing data
returned: div -- the divergence of the vector function
definition: div(self, u, v, missingValue = None):
--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
routine: idiv
purpose: computes an irrotational vector function with given divergence
usage: u, v = x.idiv(div, missingValue)
passed: div -- divergence function on a global grid
missingValue -- an optional number requesting a check for missing data
returned: u -- zonal vector function
v -- meridional vector function
definition: idiv(self, div, missingValue = None):
--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
routine: vrt
purpose: computes the scalar vorticity of a vector function
usage: vort = x.vrt(u, v, missingValue)
passed: u -- zonal vector function on a global grid
v -- meridional vector function on a global grid
missingValue -- an optional number requesting a check for missing data
returned: vort -- the vorticity of the vector function
definition: vrt(self, u, v, missingValue = None):
--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
routine: ivrt
purpose: computes a divergence-free vector function whose vorticity is
given
usage: u, v = x.ivrt(vort, missingValue)
missingValue -- an optional number requesting a check for missing data
passed: vort -- vorticity on a global grid
returned: u -- zonal vector function
v -- meridional vector function
definition: ivrt(self, vort, missingValue = None):
--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
routine: idvt
purpose: computes a vector function with given divergence and vorticity
usage: u, v = x.idvt(div, vort, missingValue)
passed: div -- divergence function on a global grid
vort -- vorticity function on a global grid
missingValue -- an optional number requesting a check for missing data
returned: u -- zonal vector function
v -- meridional vector function
definition: idvt(self, div, vort, missingValue = None):
--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
routine: vts
purpose: computes the derivative of the vector function with respect
to latitude
usage: ud, vd = x.vrt(u, v, missingValue)
passed: u -- zonal vector function on a global grid
v -- meridional vector function on a global grid
missingValue -- an optional number requesting a check for missing data
returned: ud -- zonal vector function
vd -- meridional vector function
definition: vts(self, u, v, missingValue = None):
--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
routine: grad
purpose: computes the gradient of a scalar function
usage: u, v = x.grad(sf, missingValue)
passed: sf -- scalar function on a global grid
returned: u -- zonal vector function
v -- meridional vector function
missingValue -- an optional number requesting a check for missing data
definition: grad(self, sf, missingValue = None):
--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
routine: igrad
purpose: computes a scalar function whose gradient is a given vector
function
usage: sf = x.igrad(u, v, missingValue)
passed: u -- zonal vector function
v -- meridional vector function
missingValue -- an optional number requesting a check for missing data
returned: sf -- a scalar function
definition: igrad(self, u, v, missingValue = None):
--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
routine: slap
purpose: computes a scalar Laplacian of a scalar function
usage: slap = x.slap(self, sf, missingValue)
missingValue -- an optional number requesting a check for missing data
passed: sf -- scalar function on a global grid
returned: slap -- scalar function
definition: slap(self, sf, missingValue = None):
--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
routine: islap
purpose: computes a scalar function whose scalar Laplacian is given
usage: sf, ierror = x.islap(slap, missingValue):
passed: slap -- scalar Laplacian on a global grid
missingValue -- an optional number requesting a check for missing data
returned: sf -- a scalar function
definition: islap(self, slap, missingValue = None):
--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
routine: vlap
purpose: computes the vector Laplacian of a given vector function
usage: ulap, vlap = x.vlap(u, v, missingValue)
passed: u -- zonal vector function on a global grid
v -- meridional vector function on a global grid
missingValue -- an optional number requesting a check for missing data
returned: ulap -- zonal vector Laplacian function
vlap -- meridional vector Laplacian function
definition: vlap(self, u, v, missingValue = None):
--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
routine: ivlap
purpose: computes a vector function whose Laplacian is a given vector
vector function
usage: u, v = x.ivlap(ulap, vlap, missingValue)
missingValue -- an optional number requesting a check for missing data
passed: ulap -- zonal Laplacian vector function on a global grid
vlap -- meridional Laplacian vector function on a global grid
returned: u -- zonal vector function
v -- meridional vector function
definition: ivlap(self, ulap, vlap, missingValue = None):
--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
routine: sfvp
purpose: computes the stream function and the velocity potential of a
vector function
usage: sf, vp = x.sfvp(u, v, missingValue)
passed: u -- zonal vector function on a global grid
v -- meridional vector function on a global grid
missingValue -- an optional number requesting a check for missing data
returned: sf -- stream function
vp -- velocity potential
definition: sfvp(self, u, v, missingValue = None):
--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
routine: isfvp
purpose: computes a vector function with a given stream function and
velocity potential
usage: u, v = x.isfvp(sf, vp, missingValue):
passed: sf -- stream function on a global grid
vp -- velocity potential on a global grid
missingValue -- an optional number requesting a check for missing data
returned: u -- zonal vector function
v -- meridional vector function
definition: isfvp(self, sf, vp, missingValue = None):
--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
routine: truncation
purpose: performs a triangular truncation of a scalar or a vector function with
or without tapering. For example, a request for T42 entails eliminating all
values for the total wavenumber above 42. The remaining values are tapered
by default.
usage: u, v = truncation(42, u, v)
u, v = truncation(wave, u, v)
u, v = truncation(wave, u, v, 'no', missingValue):
or
sf = truncation(42, sf):
sf = truncation(wave, sf):
sf = truncation(wave, sf, v, 'no', missingValue):
passed: wave - the truncation wave number. For example, a request for T42 is wave set
to 42 whick entails eliminating all values for the total wavenumber above 42.
u -- zonal vector function on a global grid
v -- meridional vector function on a global grid
or
sf -- a scalar with v = None instead of u, v
taper - (optional) the values remaining after truncation are tapered if the default 'yes'
is not changed to 'no'.
missingValue -- an optional number requesting a check for missing data
returned: u, v or sf
definition: truncation(self, wave, u, v = None, taper = 'yes', missingValue = None):
--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
routine: sha
purpose: computes analysis coefficients for a scalar function
usage: a, b = x.sha(sf, missingValue)
missingValue -- an optional number requesting a check for missing data
passed: sf -- scalar function on global grid
returned: a -- coefficients
b -- coefficients
definition: sha(self, sf, missingValue = None):
--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
routine: shs
purpose: computes a scalar function from the coefficients
usage: sf = x.shs(a, b)
passed: a -- coefficients
b -- coefficients
returned: sf -- scalar function
definition: shs(self, a, b):
--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
routine: vha
purpose: computes the vector harmonic analysis
usage: br, bi, cr, ci = x.vha(u, v, missingValue)
passed: u -- zonal vector function on a global grid
v -- meridional vector function on a global grid
missingValue -- an optional number requesting a check for missing data
returned: br -- coefficients
bi -- coefficients
cr -- coefficients
ci -- coefficients
definition: vha(self, u, v, missingValue = None):
--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
routine: vhs
purpose: computes the vector harmonic synthesis
usage: u, v = x.vhs(br, bi, cr, ci)
passed: br -- coefficients
bi -- coefficients
cr -- coefficients
ci -- coefficients
returned: u -- zonal vector function
v -- meridional vector function
definition: vhs(self, br, bi, cr, ci):
--------------------------------------------------------------------------------------------------------
************************************************************************************
**************************** Regrid class documentation ****************************
************************************************************************************
--------------------------------------------------------------------------------------
To make an instance x of the Regrid class type
x = sphere.Regrid(lonArrayOut, latArrayOut, lonArrayIn, latArrayIn, numberLevels = nlev,
numberTimes = ntime)
where nlev and ntime are the actual number of levels and times respectively and the keywords are
lonArrayOut = output grid longitude vector (required)
latArrayOut = output grid latitude vector (required)
lonArrayIn = input grid longitude vector (required)
latArrayIn = input grid latitude vector (required)
numberLevels = input grid number of levels (optional)
numberTimes = input grid number of times (optional)
-----------------------------------------------------------------------------------
****************************** Regrid class functions ******************************
--------------------------------------------------------------------------------------------------------
routine: regridScalar
purpose: transfers scalar data from one global spherical grid to
another. The grids may be gaussian or equally spaced.
usage: sfregrid= x.regridScalar(sf)
passed: sf -- scalar function on a global grid
returned: sfregrid -- regridded scalar function
definition: regridScalar(self, sf, missingValue = None):
--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
routine: regridVector
purpose: transfers vector data from one global spherical grid to another.
The grids can be gaussian or equally spaced.
usage: uregrid, vregrid = x.regridVector(u, v)
passed: u -- zonal vector function on a global grid
v -- meridional vector function on a global grid
returned: uregrid -- zonal regridded vector function
vregrid -- meridional regridded vector function
definition: regridVector(self, u, v, missingValue = None):
--------------------------------------------------------------------------------------------------------
************************************************************************************
*************************** Shiftgrid class documentation **************************
************************************************************************************
--------------------------------------------------------------------------------------
To make an instance x of the Shiftgrid class type
x = sphere.Shiftgrid(lonArray, latArray, numberLevels = nlev, numberTimes = ntime)
where nlev and ntime are the actual number of levels and times respectively and the keywords are
lonArray = longitude vector (required)
latArray = latitude vector (required)
numberLevels = number of levels (optional)
numberTimes = number of times (optional)
-----------------------------------------------------------------------------------
***************************** Shiftgrid class functions ****************************
--------------------------------------------------------------------------------------------------------
routine: shiftScalar
purpose: transfers scalar data on the sphere between an equally spaced
grid that includes the poles and a grid which is offset by a
half grid increment in both longitude and latitude (which
excludes the poles)
usage: sfshift = x.shiftScalar(sf)
passed: sf -- an evenly spaced scalar function on a global grid
returned: sfshift -- the shifted evenly spaced scalar function
definition: shiftScalar(self, sf, missingValue = None):
--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
routine: shiftVector
purpose: transfers vector data on the sphere between an equally spaced
grid that includes the poles and a grid which is offset by a
half grid increment in both longitude and latitude (which
excludes the poles)
usage: ushift, vshift = x.shiftVector(u,v)
passed: u -- zonal evenly spaced vector function on a global grid
v -- meridional evenly spaced vector function on a global grid
returned: ushift -- zonal evenly spaced vector function
vshift -- meridional evenly spaced vector function
definition: shiftVector(self, u, v, missingValue = None):
--------------------------------------------------------------------------------------------------------
************************************************************************************
**************************** Utility documentation *********************************
************************************************************************************
-----------------------------------------------------------------------------
routine: gridGenerator
purpose: generate the grid vectors
usage: lonvals, latvals = sphere.gridGenerator(nlon, nlat, firstLongitude,
typeLatitudes, directionLatitudes)
passed: nlon - size of longitude vector
nlat - size of latitude vector
firstLongitude -- first vector element
typeLatitudes -- 'even' or 'gaussian'
directionLatitudes -- 'north_to_south' or 'south_to_north'
return: lonvals, latvals - the double precision grid vectors
definition: gridGenerator(nlon, nlat, firstLongitude, typeLatitudes, directionLatitudes):
-----------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------
routine: truncate
purpose: perform a triangular truncation of the coefficients in the arrays a and b with
or without tapering. For example, a request for T42 entails eliminating all
values for the total wavenumber above 42. If taper is not None, the remaining
values are tapered.
usage: a,b = truncate(wave, a, b) -- use tapering
a,b = truncate(wave, a, b, taper = 'no') -- turn off tapering
passed: a, b - the arrays
wave - the truncation wavenumber
taper - request for tapering the coefficient values
returned: a, b - the truncated coefficient arrays
definition: truncate(wave, a, b, taper = 'yes'):
note: a, b have indices (nt, n, m)
note: the formula for the exponential tapering was taken from John C. Adams. It is described
in Sardeshmukh P. D. and Hoskins B. J., 1984, Spatial Smoothing on the Sphere. Mon. Wea.
Rev., 112, 2524-2529.
-------------------------------------------------------------------------------------------
|