[ncl-talk] How to resolve SVD warning: column contains constant

Will Hobbs will.hobbs at utas.edu.au
Wed Dec 16 16:29:28 MST 2015


Bithi

You will have constant values in the SIC array anywhere that is a) land, b) perenially ice covered or c) never ice covered. Any of these conditions are physically plausible  for some data points in either the Arctic or Southern Ocean, and you would get the same warning with a regular cross-correlation using escort()

In short, it's not (necessarily) a problem and is encountered in almost all gridded ocean data.

Will

From: Bithi De <bde at purdue.edu<mailto:bde at purdue.edu>>
Date: Thursday, 17 December 2015 10:19 AM
To: "ncl-talk at ucar.edu<mailto:ncl-talk at ucar.edu>" <ncl-talk at ucar.edu<mailto:ncl-talk at ucar.edu>>
Subject: [ncl-talk] How to resolve SVD warning: column contains constant


Hi All,

I am calculating SVD between seaice concentration anomaly (documentation of the data at   http://nsidc.org/data/docs/daac/nsidc0079_bootstrap_seaice.gd.html ) and geopotential height anomaly from ERA-interim data, for winter(35years). I am not getting any error until the step for calculating SVD.

The part of my code is as follows:

;***********************************************************
   ; calculate SVD
 ;**************************************************
  ; Z-anomaly (timexlatxlon)

   nxy = dimsizes(lon1)*dimsizes(latz)   ;size(space)
    ntim = 35                                           ;size(time)

   ; reorder so time varying fast
   ; create spacextime matrix for Z_ano

    Z = z_djf(longitude|:,latitude|:,time|:)
    printVarSummary(Z)
    Z2 = onedtond(ndtooned(Z),(/nxy,ntim/))  ;convert into spacextime matrix
    printVarSummary(Z2)
    printMinMax(Z2,True)

Z2!0="space"
Z2!1="time"


  Z2 at _FillValue=0.0<mailto:Z2 at _FillValue=0.0>
 delete(Z2 at _FillValue)
 printVarSummary(Z2)
 printMinMax(Z2,True)

 if(any(ismissing(Z2))) then
    print("Your data contains some missing values. Beware.")
  end if    ; did not get any error

   ;********* SIC anomaly *********************
   ; create spacextime matrix for sic_ano(timex448x304) ; 448rows x304columns in 25kmx25km grid


  xy=448*304
  si = ice_djf(::-1,::-1,::-1)                                  ;dimension reordering -->448x304xtime
  printVarSummary(si)

    Si2 = onedtond(ndtooned(si),(/xy,ntim/))        ;convert into (spacextime)
    printVarSummary(Si2)
    printMinMax(Si2,True)

Si2!0="space"
Si2!1="time"

 Si2 at _FillValue=0.0<mailto:Si2 at _FillValue=0.0>
 delete(Si2 at _FillValue)
 printVarSummary(Si2)
 printMinMax(Si2,True)

 if(any(ismissing(Si2))) then
    print("Your data contains some missing values. Beware.")
  end if                                                                                           ; did not get any error


; check if some columns has constant value
p2d=Si2(time|:,space|:)
printVarSummary(p2d)

p2d_dims = dimsizes(p2d) ; I assume this is time x p1d

ntim = p2d_dims(0)
np1d = p2d_dims(1)

;do i=0,np1d-1
  ;pmin = min(p2d(:,i))
 ; pmax = max(p2d(:,i))
  ;if(pmin.eq.pmax) then
  ;  print("p2d contains all constant values at np1d = " + i)
  ;end if
;end do
  exit

  ; delete([/Z,Zano,SIC,si/])

   ;***************************************************
   ;spatial plot of 1st mode of left and right singular vector
   ;*************************************************************

       nsvd = nxy
       svLeft = new((/nsvd,nxy/),float)   ; pre-allocate space
        svRight = new((/nsvd,xy/),float)

    pc = svdcov_sv(Z2,Si2,nsvd,svLeft,svRight)

   printVarSummary(pc)

  end

;; giving warning ==> all Y values in columns are missing or constant

*********

I checked for Si2 following the http://www.ncl.ucar.edu/Support/talk_archives/2011/2803.html and it is shows it has constant value.

Could you suggest how I can solve it?


Thanks in advance!

Bithi De

Purdue University





University of Tasmania Electronic Communications Policy (December, 2014).
This email is confidential, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone outside the intended recipient organisation is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender. The views expressed in this email are not necessarily the views of the University of Tasmania, unless clearly intended otherwise.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20151216/f7a6e57d/attachment.html 


More information about the ncl-talk mailing list