Re: Error: scalar_field: If the input data is 1-dimensional ...

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Jun 25 2014 - 12:39:12 MDT

Vanúcia,

This script is confusing, because you are calling "copy_VarCoords" to copy
coordinate arrays from t to tsm, and then you are attaching what appears to
be coordinate arrays to "t".
If "t" already has coordinate arrays, then why are you reattaching them?

However, the printVarSummary for "t" indicates that "t" does *not* have
coordinate arrays. You can tell this very easily with:

Variable: t
Type: float
Total Size: 134217728 bytes
            33554432 values
Number of Dimensions: 2
Dimensions and sizes: [lat | 4096] x [lon | 8192]
Coordinates:
Number Of Attributes: 28

Note that after "Coordinates:", there is no actual list of coordinate
arrays. This means you either don't have coordinate arrays, or something is
wrong with the files you read in.

Are your latitudes and longitudes on the file both dimensioned 4096 x 8192?
 If so, you will need to do something like this:

media@lat2d = f[0]->lat
media@lon2d = f[0]->lon

You may also need:

res@gsnAddCyclic = False

--Mary



On Fri, Jun 20, 2014 at 12:47 PM, Vanúcia Schumacher <
vanucia-schumacher@hotmail.com> wrote:

> Hi users,
>
> I am trying to run my script with satellite data, and the following error
> appears:
>
>
> Error: scalar_field: If the input data is 1-dimensional, you must set
> sfXArray and sfYArray to 1-dimensional arrays of the same length.
> warning:create: Bad HLU id passed to create, ignoring it
> warning:ContourPlotSetValues: Data values out of range of levels set by
> MANUALLEVELS mode
>
> my code:
>
> fils = systemfunc("ls *.nc")
> f = addfiles(fils, "r")
> ListSetType(f,"join")
> t =short2flt(f[:]->bsst)
> printVarSummary(t)
> tsm = t - 273.15
> copy_VarCoords(t, tsm)
>
> t!0="lat"
> t!1="lon"
> t&lat=f[0]->lat
> t&lon=f[0]->lon
> t&lat@units="degrees_north"
> t&lon@units="degrees_east"
>
> media= dim_avg_n_Wrap(tsm, 0)
>
> .....
>
> res@gsnPolar = "SH" ; specify the hemispher=
e
> plot = gsn_csm_contour_map_polar(wks,media,res)
> end
>
> Variable: t
> Type: float
> Total Size: 134217728 bytes
> 33554432 values
> Number of Dimensions: 2
> Dimensions and sizes: [lat | 4096] x [lon | 8192]
> Coordinates:
> Number Of Attributes: 28
> _FillValue : 1e+20
> bsst.dsp_PixelType : 1
> bsst.dsp_PixelSize : 2
> bsst.dsp_Flag : 0
> bsst.dsp_nBits : 16
> bsst.dsp_LineSize : 0
> bsst.dsp_cal_name : Temperature
> bsst.units : Temp
> bsst.dsp_cal_eqnNumber : 2
> bsst.dsp_cal_CoeffsLength : 8
> bsst.dsp_cal_coeffs : ( 0.075, -3 )
> bsst.scale_factor : 0.075
> bsst.add_off : -3
> dsp_PixelType : 1
> dsp_PixelSize : 2
> dsp_Flag : 0
> dsp_nBits : 16
> dsp_LineSize : 0
> dsp_cal_name : Temperature
> units : Temp
> dsp_cal_eqnNumber : 2
> dsp_cal_CoeffsLength : 8
> dsp_cal_coeffs : ( 0.075, -3 )
> add_off : -3
> dim_0.name : lat
> dim_0.long_name : latitude
> dim_1.name : lon
> dim_1.long_name : longitude
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>

Received on Wed Jun 25 06:39:12 2014

This archive was generated by hypermail 2.1.8 : Wed Jul 23 2014 - 15:33:46 MDT