[ncl-talk] GOES IR and Visible example

Dennis Shea shea at ucar.edu
Thu Oct 16 13:17:07 MDT 2014


THX for the files.

re: "I assumed the 2d lat/lon gridding is the same for both."

I am not sure what you mean by this.

As we often note on ncl-talk, the most important rule in data processing is
'look at the data'

I looked via ncl_filedump (ncdump -h) so they are not the same.

Then via ncl interactively

ncl 0> fVIS = addfile("goes12_1_2011_094_1815.BRIT.VIS.nc","r")
ncl 1> fIR  = addfile("goes13_4_2013_208_2215.temp.IR.nc","r")
ncl 2> lat2d_VIS = fVIS->lat
ncl 3> lat2d_IR  = fIR->lat

ncl 5> printVarSummary(lat2d_VIS)

Variable: lat2d_VIS
Type: float
Total Size: 256080 bytes
            64020 values
Number of Dimensions: 2
Dimensions and sizes:    [yc | 165] x [xc | 388]
Coordinates:
Number Of Attributes: 2
  long_name :    lat
  units :    degrees_north

ncl 6> printVarSummary(lat2d_IR)

Variable: lat2d_IR
Type: float
Total Size: 1925120 bytes
            481280 values
Number of Dimensions: 2
Dimensions and sizes:    [yc | 640] x [xc | 752]
Coordinates:
Number Of Attributes: 2
  long_name :    lat
  units :    degrees_north
====
So they have different dimension sizes.
====

ncl 7> print("lat2d_VIS: min="+min(lat2d_VIS)+"  max="+max(lat2d_VIS))

(0)     lat2d_VIS: min=-3.49818  max=-2.00916          <=== VERY NARROW (~
1.5 degrees)
         lon2d_VIS: min=-60.995  max=-58.9998           <=== "" (~2 degree
range)

ncl 8> print("lat2d_IR: min="+min(lat2d_IR)+"  max="+max(lat2d_IR))

(0)     lat2d_IR: min=9.05268  max=2.14329e+09     <========================
        lon2d_IR: min=-153.341  max=2.14329e+09  <==========================

--------

Further, the varuiable 'data' on the IR file has

        float data(time, yc, xc) ;
                data:long_name = "Temperature" ;
                data:type = "GVAR" ;
                data:coordinates = "lon lat" ;
                data:units = "K" ;

There is no _FillValue or missing_value attribute.

But looking at the values you get

data =
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 284.9, 284.9, 285, 285, 285, 284.9, 285, 284.9, 284.5, 284.1, 284.4,
    284.9, 285, 285, 285, 284.4, 283.9, 283.9, 283.6, 283.7, 283.6, 283.7,
    283.9, 283.9, 284.1, 284.1, 284.1, 284.1, 284.1, 284.1, 284.1, 284.2,
    284.1, 284.1, 284.1, 284.2, 284.4, 284.4, 284.8, 285.4, 290.1, 296.2,
    297, 296.3, 297.9, 301.7, 303, 304.2, 305.9, 306.2, 307, 308.4, 307.2,
[snip]

Clearly, the data variable should have:   data at _FillValue = 0.0

Also, on the IR file the lat and lon variables should indicate an
_FillValue.

  lat2d_IR at _FillValue = max(lat2d_IR)   ; 2.14329e+09
  lon2d_IR ......

=============================

In order to address these values the user must add extra information.
In particular, the IR file contents need manual intervention.

Using the data on the file without being aware of its' issues
is a recipe for programming problems and confusion.

D


On Thu, Oct 16, 2014 at 10:24 AM, David Adams <dave.k.adams at gmail.com>
wrote:

> Hi Dennis,
> here are two examples.  One GOES IR over Mexico and
> one GOES visible over the central Amazon (Manaus).  I assumed the 2d
> lat/lon gridding is the same for both.
>
> GOES IR
> goes13_4_2013_208_2215.temp.nc
>
> GOES VIS
> goes12_1_2011_094_1815.BRIT.nc
>
> thanks for the help,
> Dave
>
>
>
> On Thu, Oct 16, 2014 at 10:33 AM, Dennis Shea <shea at ucar.edu> wrote:
>
>> Yes. It looks good to me.
>>
>> If you send a sample GOES file, an of GOES=>rectilinear gris could be
>> added to  the ESMF regridding page. Then, you could use
>>
>>  http://www.ncl.ucar.edu/Applications/narr.shtml
>> Example 5
>>
>> ftp ftp.cgd.ucar.edu
>> anonymous
>> email
>> cd incoming
>> put ... GOES..
>> quit
>>
>> Then you could send the name of the file (offline to reduce ncl-talk
>> traffic).
>>
>> On Thu, Oct 16, 2014 at 9:11 AM, David Adams <dave.k.adams at gmail.com>
>> wrote:
>>
>>> Thanks Mary, Dennis,
>>> I made a really big mistake not getting the regular gridded data from
>>> the GOES people at Wisconsin.
>>>
>>> Looking at the example
>>> http://www.ncl.ucar.edu/Applications/narr.shtml
>>> Example 6
>>>
>>> to set the x-labels (with actual longitude values), I have to consider
>>> both dimensions (x,y) of the longitude dimension, correct?
>>> I would have to do something like this in the example 6
>>>
>>>    ml = 200
>>>     resx at tmXBValues         := toint( fspan(0,nlat-1,nLabels) )
>>>     do i=0,nLabels-1
>>>        x = lon2d(resx at tmXBValues(i),ml)
>>>        y = lat2d(resx at tmXBValues(i),ml)
>>>        resx at tmXBLabels(i) = sprintf("%5.1f", y)+"~C~"+sprintf("%5.1f", x)
>>>     end do
>>>
>>> where lon2d would be
>>>    lon2d= new_lon(0,:,:)
>>>    lat2d= new_lat(0,:,:)
>>>
>>> (I made another mistake with ncecat and ncrcat. somehow adding a time
>>> dimension to lat and lon)
>>>
>>> thanks in advance,
>>> Dave
>>>
>>>
>>>
>>> On Wed, Oct 15, 2014 at 10:15 AM, Dennis Shea <shea at ucar.edu> wrote:
>>>
>>>> See the following: example of subscripting 2-dimensional array
>>>> coordinates
>>>> http://www.ncl.ucar.edu/Applications/narr.shtml
>>>> Example 6
>>>>
>>>> ---
>>>> To get a 'classic' cross section (ie, a vertical profile ata  constant
>>>> latitude or longitude), you must interpolate the curvilinear grid to to a
>>>> rectilinear grid.
>>>>
>>>> http://www.ncl.ucar.edu/Applications/ESMF.shtml
>>>> Example 30
>>>>
>>>> To use the weight file generated by Example 30,
>>>>
>>>> http://www.ncl.ucar.edu/Applications/narr.shtml
>>>> Example 5
>>>>
>>>> This shows classic cross sections (constant lat ot lon) AND
>>>> an arbitrary slice
>>>>
>>>> Good luck
>>>>
>>>>
>>>> On Wed, Oct 15, 2014 at 9:02 AM, Mary Haley <haley at ucar.edu> wrote:
>>>>
>>>>> Dave,
>>>>>
>>>>> I think the issue here is simply that "new_temp" is dimensioned time x
>>>>> lat x lon, and since you want a time x lon plot, you need to subscript the
>>>>> "lat" dimension somehow.
>>>>>
>>>>> i.e.
>>>>>
>>>>>   plot = gsn_csm_contour(wks,new_temp(:,0,:), res)
>>>>>
>>>>> I'm just selecting the first latitude dimension, but you need to set
>>>>> this to whatever you want.
>>>>>
>>>>> --Mary
>>>>>
>>>>> On Tue, Oct 14, 2014 at 11:41 AM, David Adams <dave.k.adams at gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Hi Mary et al.
>>>>>> I think I am misunderstanding how
>>>>>>
>>>>>>   res at sfYArray = new_time
>>>>>>    res at sfXArray = new_lon
>>>>>>
>>>>>> work.  Do I have to redefine the original variable new_temp in terms
>>>>>> of these dimensions?  And, if so, how?
>>>>>>
>>>>>> I am getting this error.
>>>>>>
>>>>>>     gsn_csm_contour: Fatal: the input data array must be 1D or 2D
>>>>>> fatal:Illegal right-hand side type for assignment
>>>>>> fatal:Execute: Error occurred at or near line 74 in file
>>>>>> lon_time_plots.ncl
>>>>>>
>>>>>> Here is the code.
>>>>>> thanks in advance,
>>>>>> Dave
>>>>>>
>>>>>> ;*********************************
>>>>>> ; read variable
>>>>>> ;*********************************
>>>>>>    f    = addfile("/home/dadams/Mini_Campaign_NAME/2013_GOES_data/
>>>>>> test.nc","r")
>>>>>>    new_temp    = f->new_temp          ; float new_temp(time, yc, xc)
>>>>>> ;   printVarSummary(new_temp)
>>>>>> ;*********************************
>>>>>> ;
>>>>>> ;*********************************
>>>>>>    new_lat  = f->new_lat
>>>>>>    new_lon  = f->new_lon
>>>>>>    time = f->time
>>>>>>    new_time = conform(new_lon(:,0,:),time,0)
>>>>>>
>>>>>> ;*********************************
>>>>>> ; create plot
>>>>>> ;*********************************
>>>>>>    pltName = "goes"
>>>>>>    pltType = "pdf"                             ; "ps", "eps", "pdf",
>>>>>> "png"
>>>>>>    pltDir  = "./"
>>>>>>
>>>>>>    wks = gsn_open_wks(pltType, pltDir+pltName)
>>>>>>    gsn_define_colormap(wks,"BlAqGrYeOrReVi200"); choose a color map
>>>>>>
>>>>>>    res                     = True
>>>>>>    res at cnFillOn            = True            ; turn on color
>>>>>>    res at cnFillMode          = "RasterFill"    ; cell mode
>>>>>>    res at cnLinesOn           = False           ; Turn off contour lines
>>>>>>
>>>>>>    res at sfYArray = new_time
>>>>>>    res at sfXArray = new_lon
>>>>>>
>>>>>>    res at gsnSpreadColors     = True            ; use full colormap
>>>>>>    res at gsnAddCyclic        = False           ; data not cyclic
>>>>>>    res at gsnMaximize         = True            ; ps, pdf, pdf
>>>>>>    res at pmTickMarkDisplayMode = "Always"      ; use NCL default
>>>>>>    res at lbLabelAutoStride   = True            ; let NCL decide spacing
>>>>>>    res at cnLevelSelectionMode = "ManualLevels"  ;"ExplicitLevels"
>>>>>>    res at cnMinLevelValF       = 200.                            ; set
>>>>>> the minimum contour level
>>>>>>    res at cnMaxLevelValF       = 300.                          ; set
>>>>>> the maximum contour level
>>>>>>    res at cnLevelSpacingF      = 5.0                            ; set
>>>>>> the contour interval
>>>>>>    res at cnRasterSmoothingOn  = True
>>>>>>   res at lbLabelStride        = 5.0             ; every other label bar
>>>>>> label
>>>>>>
>>>>>>   plot = gsn_csm_contour(wks,new_temp, res)
>>>>>>
>>>>>> On Mon, Oct 13, 2014 at 11:29 PM, Mary Haley <haley at ucar.edu> wrote:
>>>>>>
>>>>>>> Dave,
>>>>>>>
>>>>>>> The gsn_csm_hov script is meant to only be for rectilinear grids,
>>>>>>> and you are trying to use it on a curvilinear grid (i.e., one represented
>>>>>>> by 2D lat/lon grids). The documentation is not clear about this
>>>>>>> unfortunately.
>>>>>>>
>>>>>>> My suggestion is to just use gsn_csm_contour, and pass in the time
>>>>>>> and longitude arrays via the sfYArray and sfXArray resources:
>>>>>>>
>>>>>>> new_time = conform(new_lon(:,0,:),time,0)
>>>>>>> res at sfYArray = new_time
>>>>>>> res at sfXArray = new_lon
>>>>>>>
>>>>>>> --Mary
>>>>>>>
>>>>>>>
>>>>>>> On Thu, Oct 9, 2014 at 8:28 PM, David Adams <dave.k.adams at gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> HI NCLers,
>>>>>>>> I am trying to make a hovmoller plot but it does appear that my
>>>>>>>> coordinates are correct.
>>>>>>>>
>>>>>>>> warning:ContourPlotInitialize: Y coordinates out of data range:
>>>>>>>> defaulting
>>>>>>>> warning:ContourPlotInitialize: Zero Y coordinate span:
>>>>>>>> defaulting:[errno=1104]
>>>>>>>>
>>>>>>>> and then a blank plot.  The code is from the NCL website with
>>>>>>>> slight modification
>>>>>>>>
>>>>>>>>
>>>>>>>> --------------------------------------------------------------------------------
>>>>>>>> begin
>>>>>>>> ;=============================================
>>>>>>>> ; data processing
>>>>>>>> ;===========================================
>>>>>>>>  fili  = "test.nc"                 ; filename
>>>>>>>>   f     = addfile (fili , "r")             ; add file
>>>>>>>>  new_temp   = f->new_temp                                ; get chi
>>>>>>>>  new_lat  = f->new_lat
>>>>>>>>  new_lon  = f->new_lon
>>>>>>>> ;==============================================
>>>>>>>> ; creat plot: Reverse time axis; contour labels horizontal
>>>>>>>> ; Dash negative contours; double width of Zero
>>>>>>>> ;==============================================
>>>>>>>>  wks  = gsn_open_wks ("pdf", "hov")
>>>>>>>>  res                     = True                ; plot mods desired
>>>>>>>>  res at gsnContourZeroLineThicknessF = 2.         ; doubles thickness
>>>>>>>> of zero contour
>>>>>>>>  res at gsnContourNegLineDashPattern = 1          ; sets negative
>>>>>>>> contours to dash pattern 1
>>>>>>>>  res at trYReverse          = True                ; reverse y axis
>>>>>>>>  res at tiMainString        = "Reverse Time"      ; title
>>>>>>>>  res at cnLineLabelAngleF   = 0.0                 ; [cn] label
>>>>>>>> horizontal
>>>>>>>>
>>>>>>>> ;new_temp at lat2d = new_lat(0,:,:)
>>>>>>>> ;new_temp at lon2d = new_lon(0,:,:)
>>>>>>>>
>>>>>>>>  plot  = gsn_csm_hov(wks, new_temp(:,0,:), res )           ;
>>>>>>>> default hovmueller
>>>>>>>> end
>>>>>>>>
>>>>>>>> --------------------------------------------------------------------------------------------
>>>>>>>> Here is an ncdump -h on the data file
>>>>>>>>
>>>>>>>> netcdf test {
>>>>>>>> dimensions:
>>>>>>>>     yc = 221 ;
>>>>>>>>     xc = 141 ;
>>>>>>>>     time = UNLIMITED ; // (130 currently)
>>>>>>>> variables:
>>>>>>>>     float new_temp(time, yc, xc) ;
>>>>>>>>         new_temp:time = 1372896900 ;
>>>>>>>>         new_temp:units = "K" ;
>>>>>>>>         new_temp:coordinates = "lon lat" ;
>>>>>>>>         new_temp:type = "GVAR" ;
>>>>>>>>         new_temp:long_name = "Temperature" ;
>>>>>>>>     float new_lat(time, yc, xc) ;
>>>>>>>>         new_lat:units = "degrees_north" ;
>>>>>>>>         new_lat:long_name = "lat" ;
>>>>>>>>     float new_lon(time, yc, xc) ;
>>>>>>>>         new_lon:units = "degrees_east" ;
>>>>>>>>         new_lon:long_name = "lon" ;
>>>>>>>>     int time(time) ;
>>>>>>>>         time:units = "seconds since 2013-185 00:15" ;
>>>>>>>>
>>>>>>>>
>>>>>>>> any obvious errors?
>>>>>>>>
>>>>>>>> thanks in advance,
>>>>>>>> Dave
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> 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
>>>>>
>>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141016/79a4a876/attachment.html 


More information about the ncl-talk mailing list