Re: svd_lapack vs eofunc/eofunc_ts

From: Kerrie Geil <kgeil_at_nyahnyahspammersnyahnyah>
Date: Wed Nov 30 2011 - 10:27:08 MST

Thanks to everyone for the input, but is it known why the eofunc
eigenvalues are reduced by a factor of (n-1)? Solving for the eigenvalues
by hand using the covariance matrix yields the eigenvalues produced by the
SVD function, not the eofunc. From what I understand, the eigenvalues
produced by each function should be the same. So I guess I'm still not
understanding why there's a factor of (n-1) involved.

Thanks for the help,
Kerrie

On Wed, Nov 30, 2011 at 4:54 AM, <ncl-talk-request@ucar.edu> wrote:

> Send ncl-talk mailing list submissions to
> ncl-talk@ucar.edu
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> or, via email, send a message with subject or body 'help' to
> ncl-talk-request@ucar.edu
>
> You can reach the person managing the list at
> ncl-talk-owner@ucar.edu
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of ncl-talk digest..."
>
>
> Today's Topics:
>
> 1. Re: Error: Undefined identifier (Mateus Teixeira)
> 2. Re: xMon Avg in netcdf (David Brown)
> 3. small bug in linint2_wrap?? (Cathy Smith)
> 4. mall bug in linint2_wrap?? p.s. (Cathy Smith)
> 5. svd_lapack vs eofunc/eofunc_ts (Kerrie Geil)
> 6. Re: svd_lapack vs eofunc/eofunc_ts (Gil Compo)
> 7. Re: svd_lapack vs eofunc/eofunc_ts (Gustavo Correa)
> 8. Re-using Backgrounds (Paul Scorer)
> 9. Re: mall bug in linint2_wrap?? p.s. (Dennis Shea)
> 10. Re: mall bug in linint2_wrap?? p.s. (Cathy Smith)
> 11. Re: xMon Avg in netcdf (Dennis Shea)
> 12. encountering memory problem using svd_lapack (Kerrie Geil)
> 13. Re: ncl-talk Digest, Vol 96, Issue 30 (Run Liu)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 29 Nov 2011 17:02:52 -0200
> From: Mateus Teixeira <mateus.teixeira@gmail.com>
> Subject: Re: Error: Undefined identifier
> To: Guilherme Martins <jgmsantos@gmail.com>
> Cc: NCL <ncl-talk@ucar.edu>
> Message-ID:
> <CAB74pKsVqRWJCCn2m5wjdXQLk7q9rkpCxKb0Z7hEFPHybq-4hQ@mail.gmail.com
> >
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi Guilherme,
>
> I should to allocate memory before the loop. In other words, you should
> create the array tempn before your loops. You're assign values to an array
> that doesn't exist. Before the loops, insert the following line:
>
> tempn = new( (/ dim_t, dim_lev, dim_lat, dim_lon /), float )
>
> in which
>
> dim_t, dim_lev, dim_lat and dim_lon are the size of dimensions of your new
> array.
>
> Best regards,
>
> Mateus
>
>
>
>
>
> 2011/11/29 Guilherme Martins <jgmsantos@gmail.com>
>
> > Hi users,
> >
> > I need a help. I did this script below:
> >
> > load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> > load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> > load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> > load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
> >
> > begin
> >
> > f = addfile("/home/gui/gui/NCEP-R2-MENSAL/air.mon.mean.nc","r")
> >
> > temp = short2flt(f->air)
> > temp = temp - 273.15
> >
> > do y = -40,-40
> > do x = 270,270
> > do t = 0,10-1
> > tempn(t,0,{y},{x}) = temp(t,0,{y},{x})
> > end do
> > end do
> > end do
> >
> > valorp = .25
> > n = dimsizes(tempn)
> > percentil = round(valorp*n,3)-1
> >
> > print(tempn(percentil))
> >
> > end
> >
> > But I got the error:
> >
> > fatal:Undefined identifier: (tempn) is undefined, can't continue
> > fatal:Execute: Error occurred at or near line 16 in file teste04.ncl
> >
> > I can't understand when the NCL told me "Undefined identifier".
> >
> > May anyone help me?
> >
> > Thanks,
> >
> > Guilherme.
> >
> >
> > --
> > Guilherme Martins
> > Homepage: http://guilhermemartins.hd1.com.br/
> >
> >
> >
> >
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >
> >
>
>
> --
> Mateus da Silva Teixeira
> https://linuxcounter.net/cert/466740.png
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20111129/76563988/attachment.html
>
> ------------------------------
>
> Message: 2
> Date: Tue, 29 Nov 2011 12:58:29 -0700
> From: David Brown <dbrown@ucar.edu>
> Subject: Re: xMon Avg in netcdf
> To: "Idowu, Oluseun S. (UMKC-Student)" <oluseun.idowu@mail.umkc.edu>
> Cc: ncl forum <ncl-talk@ucar.edu>
> Message-ID: <5EAD8A6D-91F3-43C8-BEA8-9E8A62FEF396@ucar.edu>
> Content-Type: text/plain; charset=us-ascii
>
> Just FYI, the SuppressClose option applies to NetCDF only. It has no
> effect for GRIB files. GRIB files are opened once to figure out the
> location of each record and read its metadata. Thereafter they are opened
> only for reading actual data.
> -dave
>
> On Nov 29, 2011, at 10:07 AM, Dennis Shea wrote:
>
> > You are reading grib files.
> > addfiles( diri+fili+".grb", "r")
> >
> > In your case each grib file has only
> > one time step. To force a time dimension in this case you should have
> >
> > Please change
> > setfileoption("nc", "SuppressClose", False)
> > to
> > setfileoption("grb", "SuppressClose", False)
> >
> >
> > On 11/29/11 7:50 AM, Mary Haley wrote:
> >> Sam,
> >>
> >> You need to read your error messages carefully. This one is telling you
> exactly what the problem is.
> >>
> >> On line 68 you have:
> >>
> >> xMON&time = x&$x!0$(0) ; assign is day of month
> >>
> >> The error is telling you that no coordinate variable exists for the
> "0"th dimension (leftmost dimension) of the variable "x".
> >> In this case, you are trying to access a coordinate variable called
> "lv_ISBL0", which doesn't exist.
> >>
> >> It is possible for a variable to have a named dimension, but to not
> have a coordinate variable of the same name.
> >>
> >> You didn't include the output from "printVarSummary(x)", but you
> probably need to look at this closely
> >> to make sure you are reading in the variable correctly. It looks like
> you are expecting a "time" dimension,
> >> but the leftmost dimension here is actually "lv_ISBL0".
> >>
> >> Perhaps you need to read the files in with the "join" mode, instead of
> "cat" mode, which is the default mode.
> >>
> >> In "cat" mode, "addfiles" will simply concatenate each new set of
> values from a new file, causing the leftmost dimension
> >> to grow in size. In "join" mode, a new dimension will actually be
> added, representing the number of files you are
> >> reading in as the leftmost dimension.
> >>
> >> For example, say you have a variable "T" on the file that is
> dimensioned 10 x 64 x 128 (lev x lat x lon). Further,
> >> say you have 5 files each with a "T" variable that is 10 x 64 x 128.
> >>
> >> If you read in "T" using addfiles in default "cat" mode, you will have
> a variable of size 50 x 64 x 128.
> >>
> >> If you read in "T" using addfiles in "join" mode, you will have a
> variable of size 5 x 10 x 64 x 128.
> >>
> >> To get addfiles to use the join mode, you need to do this right after
> the call to addfiles:
> >>
> >> ListSetType(f, "join")
> >>
> >> --Mary
> >>
> >> On Nov 29, 2011, at 3:30 AM, Idowu, Oluseun S. (UMKC-Student) wrote:
> >>
> >>> Dear Users,
> >>>
> >>> I fixed the systemfunc failure issue with this script and I still
> continue
> >>> to get the error message below. Please help. Thank you!
> >>>
> >>> Sam
> >>>
> >>>
> >>>
> >>> Variable: xMon
> >>> Type: float
> >>> Total Size: 524288 bytes
> >>> 131072 values
> >>> Number of Dimensions: 2
> >>> Dimensions and sizes: [g4_lat_1 | 256] x [g4_lon_2 | 512]
> >>> Coordinates:
> >>> Number Of Attributes: 12
> >>> initial_time : 01/01/1990 (00:00)
> >>> forecast_time_units : hours
> >>> forecast_time : 0
> >>> parameter_number : 157
> >>> parameter_table_version : 128
> >>> gds_grid_type : 4
> >>> level_indicator : 100
> >>> _FillValue : 1e+20
> >>> units : %
> >>> long_name : Relative humidity
> >>> center : European Center for Medium-Range Weather Forecasts (RSMC)
> >>> average_op_ncl : dim_avg_n over dimension(s): lv_ISBL0
> >>> fatal:No coordinate variable exists for dimension (lv_ISBL0) in
> variable
> >>> (x)
> >>> fatal:Execute: Error occurred at or near line 68 in file
> nc2monavgID_RH.ncl
> >>>
> >>> (0) Writing out netcdf
> >>>
> >>> Variable: xMON
> >>> Type: float
> >>> Total Size: 524288 bytes
> >>> 131072 values
> >>> Number of Dimensions: 3
> >>> Dimensions and sizes: [time | 1] x [g4_lat_1 | 256] x [g4_lon_2
> | 512]
> >>> Coordinates:
> >>> Number Of Attributes: 1
> >>> _FillValue : 1e+20
> >>>
> >>>
> >>>
> >>>
> >>>>
> >>>
> >>> <nc2monavgID_RH.ncl>_______________________________________________
> >>> ncl-talk mailing list
> >>> List instructions, subscriber options, unsubscribe:
> >>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >>
> >> _______________________________________________
> >> ncl-talk mailing list
> >> List instructions, subscriber options, unsubscribe:
> >> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> ------------------------------
>
> Message: 3
> Date: Tue, 29 Nov 2011 13:58:38 -0700
> From: Cathy Smith <cathy.smith@noaa.gov>
> Subject: small bug in linint2_wrap??
> To: ncl-talk@ucar.edu
> Message-ID: <4ED5477E.4010503@noaa.gov>
> Content-Type: text/plain; charset=ISO-8859-1
>
> NCL users:
> I've been using linint2_wrap successfully to regrid. My issue is that
> the name of the coordinate variables change slightly. Unfortunately, I
> need them to stay exactly the same. Is there a way to rename coordinate
> variables in NCL easily?
>
> I call
>
> VARnew =
> linint2_Wrap(lat,uselevels(::-1),VAR(::-1,:),True,lat2nd,uselevels(::-1),0)
>
>
> and this is what I get for printVarSummary for VARnew and VAR
>
> Variable: VAR Type: float Total Size: 6336 bytes 1584 values Number of
> Dimensions: 2 Dimensions and sizes: [lev | 11] x [lat | 144]
> Coordinates: lev: [1000.. 100] lat: [-89.375..89.375] Number Of
> Attributes: 7 units : m s-1 var_desc : Zonal Wind time : 731948
> _FillValue : -9.99e+08 missing_value : -9.99e+08 long_name :
> eastward wind component average_op_ncl : dim_avg over dimension: lon
> (0)
>
> Variable: VARnew Type: float Total Size: 3212 bytes 803 values Number of
> Dimensions: 2 Dimensions and sizes: [LEV | 11] x [LAT | 73]
> Coordinates: LEV: [100..1000] LAT: [-90..90] Number Of Attributes: 7
> average_op_ncl : dim_avg over dimension: lon long_name : eastward
> wind component missing_value : -9.99e+08 _FillValue : -9.99e+08
> time : 731948 var_desc : Zonal Wind units : m s-1 (0)
>
> I'm using 5.2.1 on linux redhat 64 bit machine.
>
> Cathy Smith
>
> --
> ----------------------------------------------
> NOAA/ESRL PSD and CIRES CDC
> 303-497-6263
> http://www.esrl.noaa.gov/psd/people/cathy.smith/
>
> Emails about data/webpages may get quicker responses from emailing
> esrl.psd.data@noaa.gov
>
>
>
> ------------------------------
>
> Message: 4
> Date: Tue, 29 Nov 2011 14:02:25 -0700
> From: Cathy Smith <cathy.smith@noaa.gov>
> Subject: mall bug in linint2_wrap?? p.s.
> To: ncl-talk@ucar.edu
> Message-ID: <4ED54861.5030906@noaa.gov>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Small correction. I am running my code on 5.1.1 on redhat 32bit.....
>
> NCL users:
> I've been using linint2_wrap successfully to regrid. My issue is that
> the name of the coordinate variables change slightly. Unfortunately, I
> need them to stay exactly the same. Is there a way to rename coordinate
> variables in NCL easily?
>
> I call
>
> VARnew =
> linint2_Wrap(lat,uselevels(::-1),VAR(::-1,:),True,lat2nd,uselevels(::-1),0)
>
>
> and this is what I get for printVarSummary for VARnew and VAR
>
> Variable: VAR Type: float Total Size: 6336 bytes 1584 values Number of
> Dimensions: 2 Dimensions and sizes: [lev | 11] x [lat | 144]
> Coordinates: lev: [1000.. 100] lat: [-89.375..89.375] Number Of
> Attributes: 7 units : m s-1 var_desc : Zonal Wind time : 731948
> _FillValue : -9.99e+08 missing_value : -9.99e+08 long_name :
> eastward wind component average_op_ncl : dim_avg over dimension: lon
> (0)
>
> Variable: VARnew Type: float Total Size: 3212 bytes 803 values Number of
> Dimensions: 2 Dimensions and sizes: [LEV | 11] x [LAT | 73]
> Coordinates: LEV: [100..1000] LAT: [-90..90] Number Of Attributes: 7
> average_op_ncl : dim_avg over dimension: lon long_name : eastward
> wind component missing_value : -9.99e+08 _FillValue : -9.99e+08
> time : 731948 var_desc : Zonal Wind units : m s-1 (0)
>
> I'm using 5.2.1 on linux redhat 64 bit machine.
>
> Cathy Smith
>
> --
> ----------------------------------------------
> NOAA/ESRL PSD and CIRES CDC
> 303-497-6263
> http://www.esrl.noaa.gov/psd/people/cathy.smith/
>
> Emails about data/webpages may get quicker responses from emailing
> esrl.psd.data@noaa.gov
>
>
>
>
> ------------------------------
>
> Message: 5
> Date: Tue, 29 Nov 2011 14:14:41 -0700
> From: Kerrie Geil <kgeil@email.arizona.edu>
> Subject: svd_lapack vs eofunc/eofunc_ts
> To: ncl-talk@ucar.edu
> Message-ID:
> <CAKBe+-ARF8sVMzHmmQM=R_wTWhgGAwgZj57H98FW_RN+3qsSfw@mail.gmail.com
> >
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi All,
>
> Can anyone tell me why the singular value decomposition (svd_lapack) below
> yields different eigenvalues than the eigenanalysis (eofunc, eofunc_ts),
> while both output the exact same EOFs and PCs? Can't see what I'm doing
> wrong. Code and output are below.
>
> Thanks!
> Kerrie
>
>
>
> ;######################################################################################
> ;### data array A=(/ntime,nspace/) ###
> A=(/ (/-2.,1./),(/7.,-8./),(/-3.,0./),(/5.,-9./) /)
> A!0="time"
> A!1="space"
> ntime=4 ;### number of rows, time dimension 0 ###
> nspace=2 ;### number of columns, space dimension 1 ###
>
> Aprime = dim_rmvmean_n(A,0)
> ;### singular value decomposition of Aprime ###
> ;### Aprime=(u)(s)(vtranspose)-----> (4x2)=(4x2)(2x2)(2x2) ###
> u = new ( (/ntime,nspace/) , float ) ;### columns
> of u are PC eigenvectors ###
> vtranspose = new ( (/nspace,nspace/) , float ) ;###
> rows of vtranspose are EOF eigenvectors ###
> s = svd_lapack (Aprime, "S" , "S", 0, vtranspose, u) ;###
> s^2=eigenvalues
> ;### s is returned with only the non-zero (diagonal) values
>
> print("for SVD")
> print("U:")
> write_matrix (u, "2f10.4", False)
> print("V:")
> write_matrix (vtranspose, "2f10.4", False)
> print("lambda:")
> print(s^2)
>
>
> At=transpose(A) ;### make time the rightmost dimension ###
> eof=eofunc(At,2,False) ;### rows of eof are EOFs ###
> eoftranspose=transpose(eof)
> pc=eofunc_ts_Wrap(At,eof,False) ;### rows of pc are PCs ###
> pctranspose=transpose(pc) ;### for similarity to SVD matrices,
> now columns of pc are PCs ###
> pc_colsum=dim_sum_n(pctranspose^2,0) ;### square each component
> and sum the columns ###
> pctranspose(:,0)=pctranspose(:,0)/sqrt(pc_colsum(0)) ;###
> normalize PC1
> pctranspose(:,1)=pctranspose(:,1)/sqrt(pc_colsum(1)) ;###
> normalize PC2
>
> print("for eofunc")
> print("U:")
> write_matrix (pctranspose, "2f10.4", False)
> print("V:")
> write_matrix (eof, "2f10.4", False)
> print("lambda:")
> print(eof@eval)
>
> ;######################################################################################
>
>
> OUPUT IS:
>
> (0) for SVD
> (0) U:
>
> 0.5010 0.4050
> -0.5261 0.5745
> 0.4983 -0.3748
> -0.4732 -0.6046
>
> (0) V:
>
> -0.6898 0.7240
> 0.7240 0.6898
>
> (0) lambda:
> (0) 153.4626
> (1) 3.287447
> (0)
> (0)
> (0) for eofunc
> (0) U:
>
> 0.5010 0.4050
> -0.5261 0.5745
> 0.4983 -0.3748
> -0.4732 -0.6046
>
> (0) V:
>
> -0.6898 0.7240
> 0.7240 0.6898
>
> (0) lambda:
> (0) 51.15419
> (1) 1.095816
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20111129/6f523a70/attachment.html
>
> ------------------------------
>
> Message: 6
> Date: Tue, 29 Nov 2011 14:30:07 -0700
> From: Gil Compo <Gilbert.P.Compo@noaa.gov>
> Subject: Re: svd_lapack vs eofunc/eofunc_ts
> To: ncl-talk@ucar.edu
> Message-ID: <4ED54EDF.6090707@noaa.gov>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Kerrie,
>
> They should be different by a factor of 1/(n-1), since eofunc is
> computing the covariance matrix itself. In your case, that factor is
> exactly 1/3.
>
> best wishes,
>
> gil
>
>
>
> On 11/29/11 2:14 PM, Kerrie Geil wrote:
> > Hi All,
> >
> > Can anyone tell me why the singular value decomposition (svd_lapack)
> > below yields different eigenvalues than the eigenanalysis (eofunc,
> > eofunc_ts), while both output the exact same EOFs and PCs? Can't see
> > what I'm doing wrong. Code and output are below.
> >
> > Thanks!
> > Kerrie
> >
> >
> >
> ;######################################################################################
> > ;### data array A=(/ntime,nspace/) ###
> > A=(/ (/-2.,1./),(/7.,-8./),(/-3.,0./),(/5.,-9./) /)
> > A!0="time"
> > A!1="space"
> > ntime=4 ;### number of rows, time dimension 0 ###
> > nspace=2 ;### number of columns, space dimension 1 ###
> >
> > Aprime = dim_rmvmean_n(A,0)
> > ;### singular value decomposition of Aprime ###
> > ;### Aprime=(u)(s)(vtranspose)-----> (4x2)=(4x2)(2x2)(2x2) ###
> > u = new ( (/ntime,nspace/) , float ) ;###
> > columns of u are PC eigenvectors ###
> > vtranspose = new ( (/nspace,nspace/) , float )
> > ;### rows of vtranspose are EOF eigenvectors ###
> > s = svd_lapack (Aprime, "S" , "S", 0, vtranspose, u)
> > ;### s^2=eigenvalues
> > ;### s is returned with only the non-zero (diagonal) values
> >
> > print("for SVD")
> > print("U:")
> > write_matrix (u, "2f10.4", False)
> > print("V:")
> > write_matrix (vtranspose, "2f10.4", False)
> > print("lambda:")
> > print(s^2)
> >
> >
> > At=transpose(A) ;### make time the rightmost dimension ###
> > eof=eofunc(At,2,False) ;### rows of eof are EOFs ###
> > eoftranspose=transpose(eof)
> > pc=eofunc_ts_Wrap(At,eof,False) ;### rows of pc are PCs ###
> > pctranspose=transpose(pc) ;### for similarity to SVD
> > matrices, now columns of pc are PCs ###
> > pc_colsum=dim_sum_n(pctranspose^2,0) ;### square each
> > component and sum the columns ###
> > pctranspose(:,0)=pctranspose(:,0)/sqrt(pc_colsum(0)) ;###
> > normalize PC1
> > pctranspose(:,1)=pctranspose(:,1)/sqrt(pc_colsum(1)) ;###
> > normalize PC2
> >
> > print("for eofunc")
> > print("U:")
> > write_matrix (pctranspose, "2f10.4", False)
> > print("V:")
> > write_matrix (eof, "2f10.4", False)
> > print("lambda:")
> > print(eof@eval)
> >
> ;######################################################################################
> >
> >
> > OUPUT IS:
> >
> > (0) for SVD
> > (0) U:
> >
> > 0.5010 0.4050
> > -0.5261 0.5745
> > 0.4983 -0.3748
> > -0.4732 -0.6046
> >
> > (0) V:
> >
> > -0.6898 0.7240
> > 0.7240 0.6898
> >
> > (0) lambda:
> > (0) 153.4626
> > (1) 3.287447
> > (0)
> > (0)
> > (0) for eofunc
> > (0) U:
> >
> > 0.5010 0.4050
> > -0.5261 0.5745
> > 0.4983 -0.3748
> > -0.4732 -0.6046
> >
> > (0) V:
> >
> > -0.6898 0.7240
> > 0.7240 0.6898
> >
> > (0) lambda:
> > (0) 51.15419
> > (1) 1.095816
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> --
> +++++++++++++++++++++++++++++++++++++++++++++++++++
> Gil Compo, Research Scientist, CIRES
> University of Colorado
>
> Mail : CIRES Climate Diagnostics Center
> NOAA Physical Sciences Division
> Earth System Research Laboratory
> 325 Broadway R/PSD1, Boulder, CO 80305-3328
> Email: compo@colorado.edu
> Phone: (303) 497-6115 Fax: (303) 497-6449
> http://www.esrl.noaa.gov/psd/people/gilbert.p.compo
> +++++++++++++++++++++++++++++++++++++++++++++++++++
> "Stop and consider the wondrous works of God."
> Job 37:34
> ---------------------------------------------------
> The contents of this message are mine personally
> and do not necessarily reflect any position of
> NOAA or the University of Colorado.
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20111129/2ce6de34/attachment.html
>
> ------------------------------
>
> Message: 7
> Date: Tue, 29 Nov 2011 16:36:45 -0500
> From: Gustavo Correa <gus@ldeo.columbia.edu>
> Subject: Re: svd_lapack vs eofunc/eofunc_ts
> To: ncl-talk <ncl-talk@ucar.edu>
> Message-ID: <43DF3514-1E15-4147-86B8-6BDDB2BBA96D@ldeo.columbia.edu>
> Content-Type: text/plain; charset=us-ascii
>
> Hi Kerrie
>
> For what it is worth, the second group of eigenvalues is equal to the
> first group
> divided by 3, which is the largest dimension of your matrix.
> It may depend a bit on how the SVD problem is posed, I suppose.
>
> Gus Correa
>
>
> On Nov 29, 2011, at 4:14 PM, Kerrie Geil wrote:
>
> > Hi All,
> >
> > Can anyone tell me why the singular value decomposition (svd_lapack)
> below yields different eigenvalues than the eigenanalysis (eofunc,
> eofunc_ts), while both output the exact same EOFs and PCs? Can't see what
> I'm doing wrong. Code and output are below.
> >
> > Thanks!
> > Kerrie
> >
> >
> >
> ;######################################################################################
> > ;### data array A=(/ntime,nspace/) ###
> > A=(/ (/-2.,1./),(/7.,-8./),(/-3.,0./),(/5.,-9./) /)
> > A!0="time"
> > A!1="space"
> > ntime=4 ;### number of rows, time dimension 0 ###
> > nspace=2 ;### number of columns, space dimension 1 ###
> >
> > Aprime = dim_rmvmean_n(A,0)
> > ;### singular value decomposition of Aprime ###
> > ;### Aprime=(u)(s)(vtranspose)-----> (4x2)=(4x2)(2x2)(2x2) ###
> > u = new ( (/ntime,nspace/) , float ) ;###
> columns of u are PC eigenvectors ###
> > vtranspose = new ( (/nspace,nspace/) , float )
> ;### rows of vtranspose are EOF eigenvectors ###
> > s = svd_lapack (Aprime, "S" , "S", 0, vtranspose, u) ;###
> s^2=eigenvalues
> > ;### s is returned with only the non-zero (diagonal) values
> >
> > print("for SVD")
> > print("U:")
> > write_matrix (u, "2f10.4", False)
> > print("V:")
> > write_matrix (vtranspose, "2f10.4", False)
> > print("lambda:")
> > print(s^2)
> >
> >
> > At=transpose(A) ;### make time the rightmost dimension ###
> > eof=eofunc(At,2,False) ;### rows of eof are EOFs ###
> > eoftranspose=transpose(eof)
> > pc=eofunc_ts_Wrap(At,eof,False) ;### rows of pc are PCs ###
> > pctranspose=transpose(pc) ;### for similarity to SVD
> matrices, now columns of pc are PCs ###
> > pc_colsum=dim_sum_n(pctranspose^2,0) ;### square each
> component and sum the columns ###
> > pctranspose(:,0)=pctranspose(:,0)/sqrt(pc_colsum(0)) ;###
> normalize PC1
> > pctranspose(:,1)=pctranspose(:,1)/sqrt(pc_colsum(1)) ;###
> normalize PC2
> >
> > print("for eofunc")
> > print("U:")
> > write_matrix (pctranspose, "2f10.4", False)
> > print("V:")
> > write_matrix (eof, "2f10.4", False)
> > print("lambda:")
> > print(eof@eval)
> >
> ;######################################################################################
> >
> >
> > OUPUT IS:
> >
> > (0) for SVD
> > (0) U:
> >
> > 0.5010 0.4050
> > -0.5261 0.5745
> > 0.4983 -0.3748
> > -0.4732 -0.6046
> >
> > (0) V:
> >
> > -0.6898 0.7240
> > 0.7240 0.6898
> >
> > (0) lambda:
> > (0) 153.4626
> > (1) 3.287447
> > (0)
> > (0)
> > (0) for eofunc
> > (0) U:
> >
> > 0.5010 0.4050
> > -0.5261 0.5745
> > 0.4983 -0.3748
> > -0.4732 -0.6046
> >
> > (0) V:
> >
> > -0.6898 0.7240
> > 0.7240 0.6898
> >
> > (0) lambda:
> > (0) 51.15419
> > (1) 1.095816
> >
> >
> >
> >
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> ------------------------------
>
> Message: 8
> Date: Tue, 29 Nov 2011 21:40:01 +0000
> From: Paul Scorer <paul.scorer01@gmail.com>
> Subject: Re-using Backgrounds
> To: NCL Helpline <ncl-talk@ucar.edu>
> Message-ID: <1322602801.3458.25.camel@hp-compaq.home>
> Content-Type: text/plain; charset="UTF-8"
>
> I am attempting to create a reusable background.
>
> The real code is significantly more complicated, and the data files
> huge, but the idea is _illustrated_ by the code below (although it
> obviously won't run!).
>
> I would also note that the do ... end do is in a separate file, if that
> is relevant.
>
> My code basically works, except that I get a warning:
>
> warning:_NhlSetValues:wkFileName does not have "S" access
>
> I have only been able to establish that 'some values do not have "S"
> access'.
>
> Further, the output filenames are "tmp.000001,png", "tmp.000002.png"
>
>
> The only workaround I can think of is to do
>
> system("mv tmp.000001.png " + "ParameterFilename")
>
> But how can I find out what is the current tmp filename?
>
> I have established that doing something like
> getvalues wks
> "wkFileName" : fname
> end getvalues
> only yields "tmp.png"
>
> Can anything be done about this?
>
>
> I hope this is sufficient information.
>
>
> Regards & Many Thanks in anticipation.
>
> PaulS
>
> ;;;; EXAMPLE CODE START
>
> ; Create a workstation
> wks = create "tmp" imageWorkStationClass defaultapp
> ; stuff here, eg Height, Width, ...
> end create
>
> ; Stop the background being drawn
> opts_bg = True
> opts_bg@gsnDraw = False
> opts_bg@gsnFrame = False
>
> ; Specify other details, etc
> opts_bg@mpProjection = ...
> ; also Corners, etc, etc
>
> ; Create the background map
> bg = gsn_csm_map(wks, opts_bg)
>
> ; Loop over lots of parameters, all to have the same background
> do parameter = 0,N
>
> ; Create the parameter contour, to go onto the background map
>
> ; Don't draw it yet
> opts_cn@gsnDraw = False
> opts_cn@gsnFrame = False
>
> ; duplicate the background, so can re-use
> param_bg = bg
>
> ; set individual parameter filename
> setvalues wks
> "wkFileName" : "ParameterFileName"
> end setvalues
>
> ; create the contour
> contour = gsn_csm_contour(wks, data, opts_cn)
>
> ; Put the contour onto the background
> overlay(param_bg, contour)
>
> ; Draw the plot
> draw(param_bg)
> ; Advance the frame
> frame(wks)
>
> ; Destroy the copied background, so can recreate
> delete(param_bg)
> end
> ;;;; CODE END
>
>
>
> ------------------------------
>
> Message: 9
> Date: Tue, 29 Nov 2011 14:59:21 -0700
> From: Dennis Shea <shea@ucar.edu>
> Subject: Re: mall bug in linint2_wrap?? p.s.
> To: Cathy Smith <cathy.smith@noaa.gov>
> Cc: ncl-talk@ucar.edu
> Message-ID: <4ED555B9.10209@ucar.edu>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Yes ... there is.
>
> [1] Under the hood, I wrote the code to switch the case.
> There was/is a reason for this. Basically, early-on people
> were getting confused when an interpolated variable returned
> with the same name as the input variable. So, it
> was done to avoid user confusion.
>
> [2] The simplest solution: upon return from linint2_Wrap
> varNEW = linibt2_Wrap(...)
> varNEW!0 = var!0 ; force original dimension names
> varNEW!1 = var!1
>
> There are other approaches. Let me know if this is not acceptable.
>
> On 11/29/2011 02:02 PM, Cathy Smith wrote:
> > Small correction. I am running my code on 5.1.1 on redhat 32bit.....
> >
> > NCL users:
> > I've been using linint2_wrap successfully to regrid. My issue is that
> > the name of the coordinate variables change slightly. Unfortunately, I
> > need them to stay exactly the same. Is there a way to rename coordinate
> > variables in NCL easily?
> >
> > I call
> >
> > VARnew =
> >
> linint2_Wrap(lat,uselevels(::-1),VAR(::-1,:),True,lat2nd,uselevels(::-1),0)
> >
> >
> > and this is what I get for printVarSummary for VARnew and VAR
> >
> > Variable: VAR Type: float Total Size: 6336 bytes 1584 values Number of
> > Dimensions: 2 Dimensions and sizes: [lev | 11] x [lat | 144]
> > Coordinates: lev: [1000.. 100] lat: [-89.375..89.375] Number Of
> > Attributes: 7 units : m s-1 var_desc : Zonal Wind time : 731948
> > _FillValue : -9.99e+08 missing_value : -9.99e+08 long_name :
> > eastward wind component average_op_ncl : dim_avg over dimension: lon
> > (0)
> >
> > Variable: VARnew Type: float Total Size: 3212 bytes 803 values Number of
> > Dimensions: 2 Dimensions and sizes: [LEV | 11] x [LAT | 73]
> > Coordinates: LEV: [100..1000] LAT: [-90..90] Number Of Attributes: 7
> > average_op_ncl : dim_avg over dimension: lon long_name : eastward
> > wind component missing_value : -9.99e+08 _FillValue : -9.99e+08
> > time : 731948 var_desc : Zonal Wind units : m s-1 (0)
> >
> > I'm using 5.2.1 on linux redhat 64 bit machine.
> >
> > Cathy Smith
> >
>
>
>
> ------------------------------
>
> Message: 10
> Date: Tue, 29 Nov 2011 15:03:20 -0700
> From: Cathy Smith <cathy.smith@noaa.gov>
> Subject: Re: mall bug in linint2_wrap?? p.s.
> To: Dennis Shea <shea@ucar.edu>
> Cc: ncl-talk@ucar.edu
> Message-ID: <4ED556A8.1010001@noaa.gov>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Dennis,
>
> That solution will work. Thanks!
>
> Cathy
>
> On 11/29/11 2:59 PM, Dennis Shea wrote:
> > Yes ... there is.
> >
> > [1] Under the hood, I wrote the code to switch the case.
> > There was/is a reason for this. Basically, early-on people
> > were getting confused when an interpolated variable returned
> > with the same name as the input variable. So, it
> > was done to avoid user confusion.
> >
> > [2] The simplest solution: upon return from linint2_Wrap
> > varNEW = linibt2_Wrap(...)
> > varNEW!0 = var!0 ; force original dimension names
> > varNEW!1 = var!1
> >
> > There are other approaches. Let me know if this is not acceptable.
> >
> > On 11/29/2011 02:02 PM, Cathy Smith wrote:
> >> Small correction. I am running my code on 5.1.1 on redhat 32bit.....
> >>
> >> NCL users:
> >> I've been using linint2_wrap successfully to regrid. My issue is that
> >> the name of the coordinate variables change slightly. Unfortunately, I
> >> need them to stay exactly the same. Is there a way to rename coordinate
> >> variables in NCL easily?
> >>
> >> I call
> >>
> >> VARnew =
> >>
> linint2_Wrap(lat,uselevels(::-1),VAR(::-1,:),True,lat2nd,uselevels(::-1),0)
> >>
> >>
> >>
> >> and this is what I get for printVarSummary for VARnew and VAR
> >>
> >> Variable: VAR Type: float Total Size: 6336 bytes 1584 values Number of
> >> Dimensions: 2 Dimensions and sizes: [lev | 11] x [lat | 144]
> >> Coordinates: lev: [1000.. 100] lat: [-89.375..89.375] Number Of
> >> Attributes: 7 units : m s-1 var_desc : Zonal Wind time : 731948
> >> _FillValue : -9.99e+08 missing_value : -9.99e+08 long_name :
> >> eastward wind component average_op_ncl : dim_avg over dimension: lon
> >> (0)
> >>
> >> Variable: VARnew Type: float Total Size: 3212 bytes 803 values Number of
> >> Dimensions: 2 Dimensions and sizes: [LEV | 11] x [LAT | 73]
> >> Coordinates: LEV: [100..1000] LAT: [-90..90] Number Of Attributes: 7
> >> average_op_ncl : dim_avg over dimension: lon long_name : eastward
> >> wind component missing_value : -9.99e+08 _FillValue : -9.99e+08
> >> time : 731948 var_desc : Zonal Wind units : m s-1 (0)
> >>
> >> I'm using 5.2.1 on linux redhat 64 bit machine.
> >>
> >> Cathy Smith
> >>
> >
>
>
> --
> ----------------------------------------------
> NOAA/ESRL PSD and CIRES CDC
> 303-497-6263
> http://www.esrl.noaa.gov/psd/people/cathy.smith/
>
> Emails about data/webpages may get quicker responses from emailing
> esrl.psd.data@noaa.gov
>
>
>
> ------------------------------
>
> Message: 11
> Date: Tue, 29 Nov 2011 16:02:24 -0700
> From: Dennis Shea <shea@ucar.edu>
> Subject: Re: xMon Avg in netcdf
> To: "Idowu, Oluseun S. (UMKC-Student)" <oluseun.idowu@mail.umkc.edu>
> Cc: ncl forum <ncl-talk@ucar.edu>
> Message-ID: <4ED56480.5060900@ucar.edu>
> Content-Type: text/plain; charset="iso-8859-1"
>
> The problem with your nc files is that there is
> **no time dimension**.
>
> netcdf ei.oper.an.pl.regn128sc.1990010112 {
> dimensions:
> lv_ISBL0 = 37 ;
> g4_lat_1 = 256 ;
> g4_lon_2 = 512 ;
> variables:
> float R_GDS4_ISBL(lv_ISBL0, g4_lat_1, g4_lon_2) ;
> [snip]
>
> If you used
>
> %> ncl_convert2nc ec*.grb -itime
>
> then there would a time dimension.
>
> Also, I am not sure why there are no 'lev', 'lat' and 'lon' coordinate
> variables. They should always be present.
>
> =======================
> ListSetType(f, "join") will result in a place for a time dimension
> but there is no time coordinate information.
>
> f = addfiles( diri+fili, "r")
> ListSetType(f, "join")
> x = f[:]->$var$
> printVarSummary(x) ; <==== look at the output
>
> xMon = dim_avg_n_Wrap(x, 0)
>
> Later, there is
> xMON!0 = "time"
> xMON&time = x&$x!0$(0) ; assign is day of month
>
> ^^^^^^^^^
>
> this wants/needs time coordinate information. There is none.
>
> The only way to get this with the information available is to parse each
> of the file names and create a time coordinate.
>
> =============================
> Also, the script has
>
> do year=yrStrt,yrLast
> do nmo=nmoStrt,nmoLast
> [snip
> end do ; nmo
> end do ; year
>
> The 'end do' are in the wrong place.
>
> You commented out the correct location at the end.
> Why was this done?
>
> ;end do ; nmo
> ;end do ; year
>
> ==================================================================
> I have attached a modified version of your script.
> I can not spend any more time on this.
>
> Good Luck
>
> On 11/29/2011 11:12 AM, Idowu, Oluseun S. (UMKC-Student) wrote:
> > Thanks Dennis. I got that already fixed in the code I was running but I
> > mistakenly attached the old code to the email. I used the ListSetFile(f,
> > "join") as suggested by Mary and I still got the error
> >
> > average_op_ncl : dim_avg_n over dimension(s): ncl_join
> > fatal:No coordinate variable exists for dimension (ncl_join) in variable
> > (x)
> > fatal:Execute: Error occurred at or near line 69 in file
> nc2monavgID_RH.ncl
> >
> >
> >
> >
> > On 11/29/11 11:58 AM, "Dennis Shea"<shea@ucar.edu> wrote:
> >
> >> You have in your code
> >>
> >> addfiles( diri+fili+".grb", "r") ;<<< .grb
> >>
> >> if the files have been converted to nc and the fili
> >> have a .nc extension, then
> >>
> >> addfiles( diri+fili", "r")
> >>
> >>
> >> On 11/29/2011 10:52 AM, Idowu, Oluseun S. (UMKC-Student) wrote:
> >>> addfiles( diri+fili+".grb", "r")
> >>
> >>
>
> -------------- next part --------------
> An embedded and charset-unspecified text was scrubbed...
> Name: nc2monavgID_RH.ncl
> Url:
> http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20111129/e2fc4f49/attachment.pl
>
> ------------------------------
>
> Message: 12
> Date: Tue, 29 Nov 2011 19:46:06 -0700
> From: Kerrie Geil <kgeil@email.arizona.edu>
> Subject: encountering memory problem using svd_lapack
> To: ncl-talk@ucar.edu
> Message-ID:
> <CAKBe+-CJM1Hn87=J8Qd1kYay-9fB=5w8tFzHT5NSO1fx95jTfA@mail.gmail.com
> >
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi,
>
> Is there any way to get around the error below from svd_lapack other than
> to thin the data by using every other space point?
>
> The data I input into svd_lapack is time x space with these dimension
> sizes:
> Dimensions and sizes: [50] x [8838]
>
> ncl(87431) malloc: *** mmap(size=1916055552) failed (error code=12)
> *** error: can't allocate region
> *** set a breakpoint in malloc_error_break to debug
> fatal:svd_lapack: Unable to allocate memory for coercing output arrays to
> double precision
> fatal:Execute: Error occurred at or near line 179 in file stats_proj.ncl
>
> I'm working on a mac with the following settings from the limit command:
> cputime unlimited
> filesize unlimited
> datasize unlimited
> stacksize 16384 kbytes
> coredumpsize 0 kbytes
> memoryuse unlimited
> descriptors 2560
> memorylocked unlimited
> maxproc 266
>
>
> Thank you,
>
> --
> Kerrie Geil
>
> Master's Student
> Department of Atmospheric Sciences
> University of Arizona
> PAS Building Rm 526
> 1118 E 4th Street
> Tucson, AZ 85721
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20111129/824890e4/attachment.html
>
> ------------------------------
>
> Message: 13
> Date: Wed, 30 Nov 2011 19:54:19 +0800
> From: Run Liu <liuruncn@gmail.com>
> Subject: Re: ncl-talk Digest, Vol 96, Issue 30
> To: ncl-talk@ucar.edu
> Message-ID:
> <CAByPjwnL5+xgUtpNXHmdGcoEXa2pO=jhBanSGs1a_RYo0oZ_qQ@mail.gmail.com
> >
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi, All
>
> I'm a newer to study NCL. I have a simple question. Let me describe it
> first.
> After running the WRF, i got so many output files. I want to use NCL to
> analyse them. I start with the simplist scirpt, just as below:
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>
>
> begin
>
> f =
>
> addfile("/nuwa_cluster/home/rcecstu03/RunLiu/WRF/run/PRD/wrfout_d03_2008-11-01_01:00:
> 00.nc","r")
> T = f->T
> printVarSummary(T)
>
> end
>
> it worked, it showes that :Variable: T
> Type: float
> Total Size: 1154736 bytes
> 288684 values
> Number of Dimensions: 4
> Dimensions and sizes: [Time | 1] x [bottom_top | 27] x [south_north | 99]
> x [west_east | 108]
> Coordinates:
> Number Of Attributes: 6
> FieldType : 104
> MemoryOrder : XYZ
> description : perturbation potential temperature (theta-t0)
> units : K
> stagger :
> coordinates : XLONG XLAT
>
> But when i changed another similar script, it failed
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>
>
> begin
>
> diri = "/nuwa_cluster/home/rcecstu03/RunLiu/WRF/run/PRD/"
> fils = systemfunc ("ls " +diri+ "wrfout_d03_2008-11-01_1*.nc")
> f = addfiles(fils,"r")
> T = f->T
> printVarSummary(T)
>
> end
>
> it showed that ls:
>
> /nuwa_cluster/home/rcecstu03/RunLiu/WRF/run/PRD/wrfout_d03_2008-11-01_1*.nc:
> No such file or directory
> warning:Argument 0 of the current function or procedure was coerced to the
> appropriate type and thus will not change if the function or procedure
> modifies its value
> fatal:(-2147483647) has no file extension, can't determine type of file to
> open
> fatal:["NclVar.c":1376]:Assignment type mismatch, right hand side can't be
> coerced to type of left hand side
> fatal:Execute: Error occurred at or near line 12 in file file.ncl
>
> or i change fils = systemfunc ("ls " +diri+
> "wrfout_d03_2008-11-01_1*.nc") to fils = systemfunc ("ls " +diri+
> "wrfout_d03_2008-11-01_1*") ,it showed
>
> fatal:(/nuwa_cluster/home/rcecstu03/RunLiu/WRF/run/PRD/wrfout_d03_2008-11-01_19:00:00)
> has no file extension, can't determine type of file to open
>
> fatal:(/nuwa_cluster/home/rcecstu03/RunLiu/WRF/run/PRD/wrfout_d03_2008-11-01_18:00:00)
> has no file extension, can't determine type of file to open
>
> fatal:(/nuwa_cluster/home/rcecstu03/RunLiu/WRF/run/PRD/wrfout_d03_2008-11-01_17:00:00)
> has no file extension, can't determine type of file to open
>
> fatal:(/nuwa_cluster/home/rcecstu03/RunLiu/WRF/run/PRD/wrfout_d03_2008-11-01_16:00:00)
> has no file extension, can't determine type of file to open
>
> fatal:(/nuwa_cluster/home/rcecstu03/RunLiu/WRF/run/PRD/wrfout_d03_2008-11-01_15:00:00)
> has no file extension, can't determine type of file to open
>
> fatal:(/nuwa_cluster/home/rcecstu03/RunLiu/WRF/run/PRD/wrfout_d03_2008-11-01_14:00:00)
> has no file extension, can't determine type of file to open
>
> fatal:(/nuwa_cluster/home/rcecstu03/RunLiu/WRF/run/PRD/wrfout_d03_2008-11-01_13:00:00)
> has no file extension, can't determine type of file to open
>
> fatal:(/nuwa_cluster/home/rcecstu03/RunLiu/WRF/run/PRD/wrfout_d03_2008-11-01_12:00:00)
> has no file extension, can't determine type of file to open
>
> fatal:(/nuwa_cluster/home/rcecstu03/RunLiu/WRF/run/PRD/wrfout_d03_2008-11-01_11:00:00)
> has no file extension, can't determine type of file to open
>
> fatal:(/nuwa_cluster/home/rcecstu03/RunLiu/WRF/run/PRD/wrfout_d03_2008-11-01_10:00:00)
> has no file extension, can't determine type of file to open
> fatal:(f) does not reference a file
> fatal:Execute: Error occurred at or near line 13 in file file.ncl
>
> what should i do? look forward your help,thanks
>
>
>
> 2011/11/18 <ncl-talk-request@ucar.edu>
>
> > Send ncl-talk mailing list submissions to
> > ncl-talk@ucar.edu
> >
> > To subscribe or unsubscribe via the World Wide Web, visit
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> > or, via email, send a message with subject or body 'help' to
> > ncl-talk-request@ucar.edu
> >
> > You can reach the person managing the list at
> > ncl-talk-owner@ucar.edu
> >
> > When replying, please edit your Subject line so it is more specific
> > than "Re: Contents of ncl-talk digest..."
> >
> >
> > Today's Topics:
> >
> > 1. 2 dimensional running local area average (Stephan Matthiesen)
> > 2. Two legends for Four lines ? (Helen Parish)
> > 3. Looking for reference datafile (Gerald Creager)
> > 4. Re: Looking for reference datafile (Dennis Shea)
> > 5. Re: Two legends for Four lines ? (Mary Haley)
> > 6. upscript (Chao Luo)
> > 7. Re: upscript (Rick Brownrigg)
> > 8. Re: Looking for reference datafile (Gerald Creager)
> > 9. Re: upscript (Chao Luo)
> > 10. label bar labels and WRF contour (David B. Reusch)
> > 11. Re: Two legends for Four lines ? (Mary Haley)
> >
> >
> > ----------------------------------------------------------------------
> >
> > Message: 1
> > Date: Thu, 17 Nov 2011 08:40:25 +0000
> > From: Stephan Matthiesen <info@stephan-matthiesen.de>
> > Subject: 2 dimensional running local area average
> > To: ncl-talk@ucar.edu
> > Message-ID: <4EC4C879.5090605@stephan-matthiesen.de>
> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> >
> > Hello,
> >
> > I'm looking for a function that can calculate running local area
> > averages, i.e. for each point xi,yi the average of all points xj,yj that
> > are within n gridpoints of xi,yi.
> >
> > That is essentially a 2-d version of runave. Is there a function that
> > does that?
> >
> > I thought perhaps one of the regridding functions might do that.
> > area_hi2lores is getting close to what I need, but it averages only when
> > reducing the grid, while I need it for the original grid resolution.
> >
> > Are there any functions that help, or do I have to do it manually?
> >
> > Thanks a lot in advance
> > Stephan
> >
> > --
> > Stephan Matthiesen
> > http://www.stephan-matthiesen.de
> > Neu auf www.science-texts.de: Novembermuster
> >
> > LinkedIn: http://www.linkedin.com/in/stephanmatthiesen
> >
> >
> > ------------------------------
> >
> > Message: 2
> > Date: Thu, 17 Nov 2011 05:16:31 -0800
> > From: Helen Parish <hparish@ess.ucla.edu>
> > Subject: Two legends for Four lines ?
> > To: ncl-talk@ucar.edu
> > Cc: hparish@ess.ucla.edu
> > Message-ID: <A569F566-B13C-4549-805D-E77BAD2631B3@ess.ucla.edu>
> > Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
> >
> > Does anyone know if there is a way to plot legends for only some of
> > the lines on a plot ?. I have four lines in the example below, which
> > shows a section of the NCL code. I want to put legends on the plot for
> > only two of these lines. For the other two lines I do not want any
> > part of the legend to appear. I tried just putting "" for one of the
> > legend labels I did not want, which removed the writing, but still
> > left a colored line for the legend. I also tried omitting the fourth
> > label in the ExplicitLegendLabels assignment, but this still left a
> > colored line and put rubbish in the written part of the legend.
> >
> > Is there a way to create legends for just 2 of the 4 lines ?.
> >
> > Thanks,
> > Helen.
> >
> >
> >
> > Below is an excerpt from the routine :
> >
> >
> > res@xyLineColors =
> > (/"black","blue","red","red"/) ; change line colour
> >
> > res@xyDashPatterns = (/0,1,2,2/) ;
> > choose dash patterns
> >
> > res@xyLineThicknesses = (/1.0,2.0,2.0,2.0/) ;
> > make 2nd, 3rd, 4th lines thicker
> >
> > ; add a legend
> > res@pmLegendDisplayMode = "Always" ; turn on legend
> >
> > res@pmLegendSide = "Top" ; Change location
> > of
> > res@pmLegendParallelPosF = .80 ; move units right
> > res@pmLegendOrthogonalPosF = -0.275 ; more neg = down
> >
> > res@pmLegendWidthF = 0.12 ; Change width and
> > res@pmLegendHeightF = 0.10 ; height of legend.
> > res@lgLabelFontHeightF = .02 ; change font
> > height
> > res@lgPerimOn = False ; no box around
> > ; labels for the legend
> > res@xyExplicitLegendLabels = (/"","Mean","Standard deviation"/)
> >
> > plot = gsn_csm_xy (wks,x,y,res) ; create plot
> >
> >
> >
> > ------------------------------
> >
> > Message: 3
> > Date: Thu, 17 Nov 2011 09:23:02 -0600
> > From: Gerald Creager <gerry.creager@tamu.edu>
> > Subject: Looking for reference datafile
> > To: "ncl-talk@ucar.edu" <ncl-talk@ucar.edu>
> > Message-ID: <4EC526D6.3020805@tamu.edu>
> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> >
> > I'm looking for the datafile (gx1v3.TEMP.nc) used in example iso_1.ncl
> > on this page: http://www.ncl.ucar.edu/Applications/iso.shtml
> >
> > Is it available anywhere, easily?
> >
> > Thanks, Gerry
> > --
> > Gerry Creager -- gerry.creager@tamu.edu
> > Texas Mesonet -- AATLT, Texas A&M University
> > Cell: 979.229.5301 Office: 979.458.4020 FAX: 979.862.3983
> > Office: 7607 Eastmark Drive, Suite 112, College Station, TX 77840
> >
> >
> > ------------------------------
> >
> > Message: 4
> > Date: Thu, 17 Nov 2011 08:43:09 -0700
> > From: Dennis Shea <shea@ucar.edu>
> > Subject: Re: Looking for reference datafile
> > To: gerry.creager@tamu.edu
> > Cc: "ncl-talk@ucar.edu" <ncl-talk@ucar.edu>
> > Message-ID: <4EC52B8D.3060503@ucar.edu>
> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> >
> > ftp ftp.cgd.ucar.edu
> > anonymous
> > email
> > cd pub/shea/POP
> > get gx1v3.TEMP.nc
> > quit
> >
> > 20645792 Nov 17 08:41 gx1v3.TEMP.nc
> >
> > Good Luck
> > D
> >
> > On 11/17/11 8:23 AM, Gerald Creager wrote:
> > > I'm looking for the datafile (gx1v3.TEMP.nc) used in example iso_1.ncl
> > > on this page: http://www.ncl.ucar.edu/Applications/iso.shtml
> > >
> > > Is it available anywhere, easily?
> > >
> > > Thanks, Gerry
> >
> >
> > ------------------------------
> >
> > Message: 5
> > Date: Thu, 17 Nov 2011 10:12:12 -0700
> > From: Mary Haley <haley@ucar.edu>
> > Subject: Re: Two legends for Four lines ?
> > To: Helen Parish <hparish@ess.ucla.edu>
> > Cc: ncl-talk@ucar.edu
> > Message-ID: <5635B76E-7A66-4E5F-B8B2-D0352EDEF7F3@ucar.edu>
> > Content-Type: text/plain; charset=us-ascii
> >
> > Hi Helen,
> >
> > The legend object that's associated with an XY plot that you create is
> > not very customizable in this fashion. I was able to turn off the
> > labels the same way you did, but instead of setting
> > xyExplicitLegendLabels to 2 elements, I set it to four elements,
> > with the last two being equal to "". This way you don't get the
> > label rubbish.
> >
> > However, you can't turn off the individual lines.
> >
> > I will write an example script that shows how to customize your legend.
> >
> > --Mary
> >
> > On Nov 17, 2011, at 6:16 AM, Helen Parish wrote:
> >
> > > Does anyone know if there is a way to plot legends for only some of
> > > the lines on a plot ?. I have four lines in the example below, which
> > > shows a section of the NCL code. I want to put legends on the plot for
> > > only two of these lines. For the other two lines I do not want any
> > > part of the legend to appear. I tried just putting "" for one of the
> > > legend labels I did not want, which removed the writing, but still
> > > left a colored line for the legend. I also tried omitting the fourth
> > > label in the ExplicitLegendLabels assignment, but this still left a
> > > colored line and put rubbish in the written part of the legend.
> > >
> > > Is there a way to create legends for just 2 of the 4 lines ?.
> > >
> > > Thanks,
> > > Helen.
> > >
> > >
> > >
> > > Below is an excerpt from the routine :
> > >
> > >
> > > res@xyLineColors =
> > > (/"black","blue","red","red"/) ; change line colour
> > >
> > > res@xyDashPatterns = (/0,1,2,2/) ;
> > > choose dash patterns
> > >
> > > res@xyLineThicknesses = (/1.0,2.0,2.0,2.0/) ;
> > > make 2nd, 3rd, 4th lines thicker
> > >
> > > ; add a legend
> > > res@pmLegendDisplayMode = "Always" ; turn on legend
> > >
> > > res@pmLegendSide = "Top" ; Change location
> > > of
> > > res@pmLegendParallelPosF = .80 ; move units right
> > > res@pmLegendOrthogonalPosF = -0.275 ; more neg = down
> > >
> > > res@pmLegendWidthF = 0.12 ; Change width and
> > > res@pmLegendHeightF = 0.10 ; height of
> legend.
> > > res@lgLabelFontHeightF = .02 ; change font
> > > height
> > > res@lgPerimOn = False ; no box around
> > > ; labels for the legend
> > > res@xyExplicitLegendLabels = (/"","Mean","Standard deviation"/)
> > >
> > > plot = gsn_csm_xy (wks,x,y,res) ; create plot
> > >
> > > _______________________________________________
> > > ncl-talk mailing list
> > > List instructions, subscriber options, unsubscribe:
> > > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >
> >
> >
> > ------------------------------
> >
> > Message: 6
> > Date: Thu, 17 Nov 2011 12:20:51 -0500 (EST)
> > From: Chao Luo <chao.luo@eas.gatech.edu>
> > Subject: upscript
> > To: ncl-talk@ucar.edu
> > Message-ID: <9238e9aa-b501-436d-ac15-e938d653fddb@mail4.gatech.edu>
> > Content-Type: text/plain; charset=utf-8
> >
> > Hi,
> >
> > I have a simple question. Want to change "m/s" to ms^-1, but don't know
> > how to change "-1" for upscript in NCL script.
> >
> > Thanks,
> >
> > Chao
> >
> >
> > ------------------------------
> >
> > Message: 7
> > Date: Thu, 17 Nov 2011 10:27:50 -0700
> > From: Rick Brownrigg <brownrig@ucar.edu>
> > Subject: Re: upscript
> > To: Chao Luo <chao.luo@eas.gatech.edu>
> > Cc: ncl-talk@ucar.edu
> > Message-ID: <70561BDF-4B0A-4AEF-A82F-9F19830B9D93@ucar.edu>
> > Content-Type: text/plain; charset=us-ascii
> >
> > Hi,
> >
> > Check out the discussion on Text Function Codes:
> >
> > http://www.ncl.ucar.edu/Document/Graphics/function_code.shtml
> >
> > Rick
> >
> > On Nov 17, 2011, at 10:20 AM, Chao Luo wrote:
> >
> > > Hi,
> > >
> > > I have a simple question. Want to change "m/s" to ms^-1, but don't know
> > how to change "-1" for upscript in NCL script.
> > >
> > > Thanks,
> > >
> > > Chao
> > > _______________________________________________
> > > ncl-talk mailing list
> > > List instructions, subscriber options, unsubscribe:
> > > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >
> >
> >
> > ------------------------------
> >
> > Message: 8
> > Date: Thu, 17 Nov 2011 12:16:24 -0600
> > From: Gerald Creager <gerry.creager@tamu.edu>
> > Subject: Re: Looking for reference datafile
> > To: Dennis Shea <shea@ucar.edu>
> > Cc: "ncl-talk@ucar.edu" <ncl-talk@ucar.edu>
> > Message-ID: <4EC54F78.2020308@tamu.edu>
> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> >
> > Thanks! Got it.
> > gerry
> >
> > On 11/17/2011 09:43 AM, Dennis Shea wrote:
> > > ftp ftp.cgd.ucar.edu
> > > anonymous
> > > email
> > > cd pub/shea/POP
> > > get gx1v3.TEMP.nc
> > > quit
> > >
> > > 20645792 Nov 17 08:41 gx1v3.TEMP.nc
> > >
> > > Good Luck
> > > D
> > >
> > > On 11/17/11 8:23 AM, Gerald Creager wrote:
> > >> I'm looking for the datafile (gx1v3.TEMP.nc) used in example
> iso_1.ncl
> > >> on this page: http://www.ncl.ucar.edu/Applications/iso.shtml
> > >>
> > >> Is it available anywhere, easily?
> > >>
> > >> Thanks, Gerry
> >
> > --
> > Gerry Creager -- gerry.creager@tamu.edu
> > Texas Mesonet -- AATLT, Texas A&M University
> > Cell: 979.229.5301 Office: 979.458.4020 FAX: 979.862.3983
> > Office: 7607 Eastmark Drive, Suite 112, College Station, TX 77840
> >
> >
> > ------------------------------
> >
> > Message: 9
> > Date: Thu, 17 Nov 2011 13:22:18 -0500 (EST)
> > From: Chao Luo <chao.luo@eas.gatech.edu>
> > Subject: Re: upscript
> > To: Rick Brownrigg <brownrig@ucar.edu>
> > Cc: ncl-talk@ucar.edu
> > Message-ID: <3d2b2eec-2172-4357-bb5b-1fff7b93cacb@mail4.gatech.edu>
> > Content-Type: text/plain; charset=utf-8
> >
> > Thanks much!
> >
> > Chao
> >
> >
> > ----- Original Message -----
> > From: "Rick Brownrigg" <brownrig@ucar.edu>
> > To: "Chao Luo" <chao.luo@eas.gatech.edu>
> > Cc: ncl-talk@ucar.edu
> > Sent: Thursday, November 17, 2011 9:27:50 AM
> > Subject: Re: upscript
> >
> > Hi,
> >
> > Check out the discussion on Text Function Codes:
> >
> > http://www.ncl.ucar.edu/Document/Graphics/function_code.shtml
> >
> > Rick
> >
> > On Nov 17, 2011, at 10:20 AM, Chao Luo wrote:
> >
> > > Hi,
> > >
> > > I have a simple question. Want to change "m/s" to ms^-1, but don't know
> > how to change "-1" for upscript in NCL script.
> > >
> > > Thanks,
> > >
> > > Chao
> > > _______________________________________________
> > > ncl-talk mailing list
> > > List instructions, subscriber options, unsubscribe:
> > > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >
> >
> >
> > ------------------------------
> >
> > Message: 10
> > Date: Thu, 17 Nov 2011 11:22:41 -0700
> > From: "David B. Reusch" <dreusch@ees.nmt.edu>
> > Subject: label bar labels and WRF contour
> > To: NCL Talk <ncl-talk@ucar.edu>, wrfhelp@ucar.edu
> > Message-ID: <4EC550F1.2010206@ees.nmt.edu>
> > Content-Type: text/plain; charset="iso-8859-1"
> >
> > Not sure if this is NCL or the WRF NCL scripts so you're both getting
> > this email. I've been trying to create a soil category plot from
> > geogrid data starting from the vegland_1
> > <http://www.ncl.ucar.edu/Applications/Scripts/vegland_1.ncl> example on
> > the NCL site. The problem I can't seem to resolve is that in my label
> > bar I can either get (a) 16 number labels and 17 label boxes or (b) 15
> > number labels + "Label 15" and 16 label boxes (for my 16 category soil
> > data). I've tried to follow this through the WRFUserARW.ncl code but
> > have given up (after trying lots of variations...). Although I am
> > providing a lbUserLabels all the way through (as far as I can tell),
> > this seems to be being ignored at some level I haven't nailed down.
> >
> > I have put the file dbr_wrf_plot_lb.tgz at the ftp incoming site. It
> > has my script, my input file and an output file.
> >
> > Thanks,
> > Dave Reusch
> >
> > --
> > Associate Research Professor of Climatology
> > Dept of Earth and Environmental Science
> > MSEC 304; 801 Leroy Place
> > New Mexico Tech
> > Socorro, NM 87801
> >
> > -------------- next part --------------
> > An HTML attachment was scrubbed...
> > URL:
> >
> http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20111117/fa6de231/attachment.html
> >
> > ------------------------------
> >
> > Message: 11
> > Date: Thu, 17 Nov 2011 11:44:56 -0700
> > From: Mary Haley <haley@ucar.edu>
> > Subject: Re: Two legends for Four lines ?
> > To: Helen Parish <hparish@ess.ucla.edu>
> > Cc: ncl-talk@ucar.edu
> > Message-ID: <4C1159C8-6247-45A3-8D3E-503AF880E48A@ucar.edu>
> > Content-Type: text/plain; charset=us-ascii
> >
> > Helen,
> >
> > Please see example 13 on the legend page:
> >
> > http://www.ncl.ucar.edu/Applications/legend.shtml#ex13
> >
> > This example is probably a bit of overkill for what you need,
> > for it tries to recreate an XY legend from scratch.
> >
> > Note that this XY plot has four curves, but I only created
> > two legend items. See the "NumberLegendItems"
> > attribute in this code.
> >
> > --Mary
> >
> > On Nov 17, 2011, at 6:16 AM, Helen Parish wrote:
> >
> > > Does anyone know if there is a way to plot legends for only some of
> > > the lines on a plot ?. I have four lines in the example below, which
> > > shows a section of the NCL code. I want to put legends on the plot for
> > > only two of these lines. For the other two lines I do not want any
> > > part of the legend to appear. I tried just putting "" for one of the
> > > legend labels I did not want, which removed the writing, but still
> > > left a colored line for the legend. I also tried omitting the fourth
> > > label in the ExplicitLegendLabels assignment, but this still left a
> > > colored line and put rubbish in the written part of the legend.
> > >
> > > Is there a way to create legends for just 2 of the 4 lines ?.
> > >
> > > Thanks,
> > > Helen.
> > >
> > >
> > >
> > > Below is an excerpt from the routine :
> > >
> > >
> > > res@xyLineColors =
> > > (/"black","blue","red","red"/) ; change line colour
> > >
> > > res@xyDashPatterns = (/0,1,2,2/) ;
> > > choose dash patterns
> > >
> > > res@xyLineThicknesses = (/1.0,2.0,2.0,2.0/) ;
> > > make 2nd, 3rd, 4th lines thicker
> > >
> > > ; add a legend
> > > res@pmLegendDisplayMode = "Always" ; turn on legend
> > >
> > > res@pmLegendSide = "Top" ; Change location
> > > of
> > > res@pmLegendParallelPosF = .80 ; move units right
> > > res@pmLegendOrthogonalPosF = -0.275 ; more neg = down
> > >
> > > res@pmLegendWidthF = 0.12 ; Change width and
> > > res@pmLegendHeightF = 0.10 ; height of
> legend.
> > > res@lgLabelFontHeightF = .02 ; change font
> > > height
> > > res@lgPerimOn = False ; no box around
> > > ; labels for the legend
> > > res@xyExplicitLegendLabels = (/"","Mean","Standard deviation"/)
> > >
> > > plot = gsn_csm_xy (wks,x,y,res) ; create plot
> > >
> > > _______________________________________________
> > > ncl-talk mailing list
> > > List instructions, subscriber options, unsubscribe:
> > > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >
> >
> >
> > ------------------------------
> >
> > _______________________________________________
> > ncl-talk mailing list
> > ncl-talk@ucar.edu
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >
> >
> > End of ncl-talk Digest, Vol 96, Issue 30
> > ****************************************
> >
>
>
>
> --
>
> Liu Run
>
> State Key Joint Laboratory of Environment Simulation and Pollution Control
> College of Environmental Sciences and Engineering
> Peking University, Beijing
> P.R.China, 100871
>
> E-mail: liuruncn@gmail.com
>
> Mobile: 86-15201475934
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20111130/fedacb51/attachment.html
>
> ------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk@ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> End of ncl-talk Digest, Vol 96, Issue 56
> ****************************************
>

-- 
Kerrie Geil
Master's Student
Department of Atmospheric Sciences
University of Arizona
PAS Building Rm 526
1118 E 4th Street
Tucson, AZ 85721

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Nov 30 10:27:31 2011

This archive was generated by hypermail 2.1.8 : Wed Nov 30 2011 - 19:52:47 MST