ESA.surface.svd_t3_region
index
/home/lfeng/otool/ESA/surface/svd_t3_region.py

Functions for doing composition of regional Basis functions (i.e, error)
 
 
Authors: L. Feng, Edinburgh University
History: v0.9, 2012.06.28
History: v0.95, 2013.02.24
 
 
Functions:
===========================================
svd_t3_region: do svd with T3 regions

 
Modules
       
ESA.util.flux_regrid
ESA.util.gen_plots
ESA.util.otool_ncfile_io
numpy
ESA.util.otool_var_io
pylab
ESA.surface.svd_region_flux

 
Functions
       
svd_t3_regions(flux_flnm, out_ncflnm, threshold, scale, dist_threshold, maxsel, nland=12, land_cor_length=800, ocean_cor_length=2000, **keywords)
SVD error map over region to several  sub-regions defined by (nsb_lon, nsb_lat)
 
Inputs:
 
--------------------------------------
1. grd_lon:<array, (nlon)>: longitude
2. grd_lat:<array, (nlat)>: latitude
3. reg_map:<array, (nlon, nlat)>: ratio  map defining one region. 
4. reg_err:<array, (nlon, nlat)>: err (or BF) defined over given region
5. cor_length <float>: length of the correlation 
6. threshold:<float>: any grid boxes below this threshold will be treated as one single region 
7. scale:<float>: scaling factor applied to this region 
8. dist_threshold:<float>: the max distance/cor_length where correlation will be considered 
9. maxsel:<int>: the maximum number to be keep
 
Returns:
--------------------------------------------
1. flux:<array, (nlon, nlat, neig)>: new regions masked with sub-region number 
2. new_map_lst:<list, t:array>: the layer map with each layer for each sub-regions

 
Data
        def_svd_land_cor_len = 800
def_svd_nland = 12
def_svd_ocean_cor_len = 2000
def_svd_t3_flux_flnm = 'reg_23_ml.4x5.nc'
def_svd_t3_varnames = ['longitude', 'latitude', 'map', 'flux', 'area', 'pid']