[ncl-talk] warning:cnConstFEnableFill to enable fill

Kunal Bali kunal.bali9 at gmail.com
Wed Feb 21 23:33:11 MST 2018


Hello Ma'am,

I have one doubt regarding your question.

I run this script for both AOD and PM2.5 variable. The script is giving CoD
values between 0 to 1 for AOD but not for PM2.5. If I assume that there is
something wrong with the code then it should give some error in AOD data as
well.

Both files have the same grid structure

for AOD

#
# gridID 1
#
gridtype  = lonlat
gridsize  = 5273664
xsize     = 2497
ysize     = 2112
xname     = lon
xlongname = "longitude"
xunits    = "degrees_east"
yname     = lat
ylongname = "latitude"
yunits    = "degrees_north"
xfirst    = 59
xinc      = 0.015625
yfirst    = 5.0078125
yinc      = 0.015625


for PM


#
# gridID 1
#
gridtype  = lonlat
gridsize  = 5273664
xsize     = 2497
ysize     = 2112
xname     = lon
xlongname = "longitude"
xunits    = "degrees_east"
yname     = lat
ylongname = "latitude"
yunits    = "degrees_north"
xfirst    = 59
xinc      = 0.015625
yfirst    = 5.0078125
yinc      = 0.015625





---
Kunal Bali





On Wed, Feb 21, 2018 at 10:26 PM, Mary Haley <haley at ucar.edu> wrote:

> Kunal,
>
> The issue is obviously coming somewhere from the calculations, and you are
> going to have to debug this code to figure out where the problem is.
>
> As you can see from the printMinMax output, The CoD1 variable has a
> min/max of 1, so taking the average of this is also going to give you a
> min/max of 1 (CoD2), and then doing a sqrt on this is also going to give
> you a min/max of 1 (CoD_final).
>
> You need to go back to the data_single, data_subset, and DATA_SINGLE_3D
> and make sure these are being calculated correctly. You should also print
> the min/max of these arrays to further pinpoint the problem.
>
> --Mary
>
>
> On Wed, Feb 21, 2018 at 4:49 AM, Kunal Bali <kunal.bali9 at gmail.com> wrote:
>
>>   Dear Barry Sir,
>>
>>   I set the levels via
>>
>>   res at cnLevelSelectionMode = "ManualLevels"
>>   res at cnMinLevelValF = 0.0
>>   res at cnMaxLevelValF = 1
>>   res at cnLevelSpacingF = 0.005
>>
>>
>> ---
>> Kunal Bali
>>
>>
>>
>>
>>
>> On Wed, Feb 21, 2018 at 5:16 PM, Barry Lynn <barry.h.lynn at gmail.com>
>> wrote:
>>
>>> Hi:
>>>
>>> My apologies for asking simple question, but where do you set the levels
>>> you want to plot?
>>>
>>> I see that these two lines are commented out.
>>>
>>> ;  res at cnLevelSelectionMode = "ExplicitLevels"   ; set explicit contour
>>> levels
>>>
>>> ;  res at cnLevels  = (/0.04,0.06,0.08,0.1,0.12,0.14
>>> ,0.16,0.18,0.2,0.24,0.26,0.28,0.3,0.32,0.34,0.36,0.38,0.4/)
>>>
>>>
>>> On Wed, Feb 21, 2018 at 1:23 PM, Kunal Bali <kunal.bali9 at gmail.com>
>>> wrote:
>>>
>>>> Dear NCL users,
>>>>
>>>> I am trying to calculate the coefficient of divergence using the
>>>> attached script. The script is running successfully but I am getting only
>>>> one value i.e. 1 as a minimum and maximum value which should come in
>>>> between 0 to 1. And because of that I am also receiving the warning such as
>>>>
>>>> warning:ContourPlotInitialize: scalar field is constant; no contour
>>>> lines will appear; use cnConstFEnableFill to enable fill
>>>> if I set
>>>>
>>>> res at cnConstFEnableFill = True
>>>>
>>>> then the whole field is drawn in a single color as expected it will
>>>> give only one color.
>>>>
>>>>
>>>>
>>>> Regarding data
>>>> The data is in different 5 grid structure covering different Indian
>>>> region so I merged them and got one single file which cover whole Indian
>>>> region and then runs the attached script.
>>>>
>>>> Before merging the data, I used the same script for different grid
>>>> structures separately and it was giving the correct values between 0 to 1.
>>>>
>>>> But this time I am getting only one value.
>>>>
>>>> So could anyone please provide some information on that.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> *Copyright (C) 1995-2017 - All Rights Reserved University Corporation
>>>> for Atmospheric Research NCAR Command Language Version 6.4.0 The use of
>>>> this software is governed by a License Agreement. See
>>>> http://www.ncl.ucar.edu/ <http://www.ncl.ucar.edu/> for more
>>>> details.Variable: totcType: doubleTotal Size: 4050173952
>>>> <040%205017%203952> bytes            506271744 valuesNumber of Dimensions:
>>>> 3Dimensions and sizes:    [time | 96] x [lat | 2112] x [lon |
>>>> 2497]Coordinates:             time: [35430.125..104813.7916666667
>>>> <079%201666%206667>]            lat: [5.0078125..37.9921875]
>>>> lon: [  59..  98]Number Of Attributes: 6  _FillValue :    -28672  long_name
>>>> :    AOT at 0.55 micron  hdfeos_name :    Optical_Depth_055  projection
>>>> :    Albers Conical Equal_Area  unit :    None  missing_value :
>>>> -28672Variable: totcType: doubleTotal Size: 4050173952 <040%205017%203952>
>>>> bytes            506271744 valuesNumber of Dimensions: 3Dimensions and
>>>> sizes:    [time | 96] x [lat | 2112] x [lon | 2497]Coordinates:
>>>> time: [35430.125..104813.7916666667 <079%201666%206667>]            lat:
>>>> [5.0078125..37.9921875]            lon: [  59..  98]Number Of Attributes:
>>>> 6  _FillValue :    -28672  long_name :    AOT at 0.55 micron  hdfeos_name
>>>> :    Optical_Depth_055  projection :    Albers Conical Equal_Area  unit
>>>> :    None  missing_value :    -28672Variable: data_subsetType: doubleTotal
>>>> Size: 295196160 bytes            36899520 valuesNumber of Dimensions:
>>>> 3Dimensions and sizes:    [time | 96] x [lat | 646] x [lon |
>>>> 595]Coordinates:             time: [35430.125..104813.7916666667
>>>> <079%201666%206667>]            lat: [29.5234375..19.4453125]
>>>> lon: [91.390625..82.109375]Number Of Attributes: 6  missing_value :
>>>> -28672  unit :    None  projection :    Albers Conical Equal_Area
>>>> hdfeos_name :    Optical_Depth_055  long_name :    AOT at 0.55 micron
>>>> _FillValue :    -28672(0)    nearest location: k=0  n=481 m=882  156.836
>>>> 5297.11(0)    -----(0)    -----Variable: CoD1Type: doubleTotal Size:
>>>> 295196160 bytes            36899520 valuesNumber of Dimensions: 3Dimensions
>>>> and sizes:    [96] x [646] x [595]Coordinates: Number Of Attributes: 1
>>>> _FillValue :    -28672(0)    min=1   max=1(0)    ---Variable: CoD2Type:
>>>> doubleTotal Size: 3074960 bytes            384370 valuesNumber of
>>>> Dimensions: 2Dimensions and sizes:    [646] x [595]Coordinates: Number Of
>>>> Attributes: 3  long_name :    Coef of Divergence  _FillValue :    -28672
>>>> average_op_ncl :    dim_avg_n function was applied(0)    Coef of Divergence
>>>> : min=1   max=1Variable: CoD_finalType: doubleTotal Size: 3074960
>>>> bytes            384370 valuesNumber of Dimensions: 2Dimensions and
>>>> sizes:    [646] x [595]Coordinates: Number Of Attributes: 1  _FillValue
>>>> :    -28672(0)    min=1   max=1warning:ContourPlotInitialize: scalar field
>>>> is constant; no contour lines will appear; use cnConstFEnableFill to enable
>>>> fill*
>>>>
>>>> ---
>>>> Kunal
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> ncl-talk at ucar.edu
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>
>>>>
>>>
>>>
>>> --
>>> Barry H. Lynn, Ph.D
>>> Senior Lecturer,
>>> The Institute of the Earth Science,
>>> The Hebrew University of Jerusalem,
>>> Givat Ram, Jerusalem 91904, Israel
>>> Tel: 972 547 231 170
>>> Fax: (972)-25662581
>>>
>>> C.E.O, Weather It Is, LTD
>>> Weather and Climate Focus
>>> http://weather-it-is.com
>>> Jerusalem, Israel
>>> Local: 02 930 9525
>>> Cell: 054 7 231 170
>>> Int-IS: x972 2 930 9525
>>> US 914 432 3108 <091443%2023108>
>>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180222/99b8ef7f/attachment.html>


More information about the ncl-talk mailing list