[ncl-talk] Fw: scatsat-1 data plotting

Mary Haley haley at ucar.edu
Tue Jan 30 10:05:53 MST 2018


Please subscribe to ncl-talk if you want help with NCL, and send your
questions there. I did not see your "jiban_samudra18 at yahoo.com" in the
ncl-talk membership list.

Dave, Rick, and I all sent you scripts a few weeks ago, but it looks like
you are not using the fixed scripts we sent you. The script you sent has
several things wrong with it, that we had fixed for you previously:

[1] You have several resources misspelled:

 res at cnfillon=True
 rescnLineson=False
 res at lbLabAutoStride=True

should be:

 res at cnFillOn=True
 rescnLinesOn=False
 res at lbLabelAutoStride=True
​     ; This is the default, so you don't need to set it.​


​[2] You didn't use the contour levels that we created for you before.  It
looks like you have unequally spaced contour levels, so you must provide
these for NCL.​

res at cnLevelSelectionMode = "ExplicitLevels"
res at cnLevels             =
(/1,1.5,2,2.25,2.5,2.75,3,3.5,4,4.5,5.2,5.6,6,6.4,6.8,7.2,7.6,8.5,11.8,12.4,14.0,14.5,15,30/)


[3] You created the lat/lon coordinates, but you didn't attach them to the
variable:

lon = (360./numlon)*(ispan(0,numlon-1,1)+0.5)
lat = (180./numlat)*(ispan(0,numlat-1,1)+0.5)-90

lat at units="degrees_north"
lon at units="degrees_east"
data_actual!0 = "lat"
data_actual!1 = "lon"
data_actual&lat = lat
data_actual&lon = lon

Note that you don't need a do loop to calculate lat/lon.  This is another
thing we tried to show you in a previous script.

[4] If you want the value 0.0 to be treated as missing, use the "where"
function:

data_actual at _FillValue = -999.
data_actual = where(data_actual.eq.0,data_actual at _FillValue,data_actual)

​I've attached the modified script and the resultant PNG. I didn't have
time to clean it up, so I'll leave that to you. Please look over this
script carefully and try to understand it this time.

As for adding vectors, you will need to add code like this at the end of
the contouring code, and you need to make sure u and v have lat/lon
attached to them the same way I did for asc_wind_speed in the attached
script.

vcres = True
;;vcres at vcMinDistanceF  = 0.005    ; thins the vectors
;;vcres at vcRefLengthF    = 0.01      ; changes the NDC length of the
reference vector

vector_plot=gsn_csm_vector(xwks,u,v,vcres)

overlay(plot,vector_plot)
draw(plot)
frame(xwks)

To see more about customizing vectors, see the examples at:

http://www.ncl.ucar.edu/Applications/vector.shtml


I don't know what u and v are on the file, so this is something you will
figure out yourself.

If you have more questions, please subscribe to ncl-talk and post a new
message.

Thanks for your consideration, and good luck.


--Mary



On Tue, Jan 30, 2018 at 4:04 AM, jayanti pal <jiban_samudra18 at yahoo.com>
wrote:

>
>
> Dr. Jayanti Pal
> Post-doc Fellow
> Department of Atmospheric Sciences
> Institute of Atmospheric and Environmental Sciences
> University of Calcutta
> Contact: jiban_samudra18 at yahoo.com, jayantibright at gmail.com
> Ph. 8013906997 <(801)%20390-6997>
>
>
> ----- Forwarded message -----
> *From:* jayanti pal <jiban_samudra18 at yahoo.com>
> *To:* ncl-talk at ucar.edu <ncl-talk at ucar.edu>
> *Sent:* Tuesday 30 January 2018, 4:24:31 PM IST
> *Subject:* Fw: scatsat-1 data plotting
>
> Sir
>
> I am new to ncl. I tried to plot scatsat-1 data with ncl. But figure is
> not correctly plotted.
> I have attached the code I have used, Hdf file, actual plot (in color) and
> ncl plot (in black).
> In this hdf file there are four variables: Asending wind speed, asending
> wind direction , descending wind speed, desending wind direction.
> I want to plot this four variable in a single plot where speeds are in
> contour and directions are in vector. Also I want to plot this over Indian
> region (Lat: 0-40 and Lon : 60-100).
>
> Please help me. I have to plot those data urgently as I have to submit
> project review.
>
> Sincerely
>
>
>
> Dr. Jayanti Pal
> Post-doc Fellow
> Department of Atmospheric Sciences
> Institute of Atmospheric and Environmental Sciences
> University of Calcutta
> Contact: jiban_samudra18 at yahoo.com, jayantibright at gmail.com
> Ph. 8013906997 <(801)%20390-6997>
>
>
> ----- Forwarded message -----
> *From:* jayanti pal <jiban_samudra18 at yahoo.com>
> *To:* ncl-talk at ucar.edu <ncl-talk at ucar.edu>
> *Sent:* Tuesday 2 January 2018, 12:47:33 PM IST
> *Subject:* Fw: scatsat-1 data plotting
>
> Sir
>
> I am new to ncl. I tried to plot scatsat-1 data with ncl. But figure is
> not correctly plotted.
> I have attached the code I have used, Hdf file, actual plot (in color) and
> ncl plot (in black).
>
> Please help me. I have to plot those data urgently.
>
>
>
> Dr. Jayanti Pal
> Post-doc Fellow
> Department of Atmospheric Sciences
> Institute of Atmospheric and Environmental Sciences
> University of Calcutta
> Contact: jiban_samudra18 at yahoo.com, jayantibright at gmail.com
> Ph. 8013906997 <(801)%20390-6997>
>
>
> ----- Forwarded message -----
> *From:* jayanti pal <jiban_samudra18 at yahoo.com>
> *To:* eoshelp at hdfgroup.org <eoshelp at hdfgroup.org>
> *Sent:* Friday 22 December 2017, 12:28:59 PM IST
> *Subject:* scatsat-1 data plotting
>
> Sir
>
> I am new to ncl. I tried to plot scatsat-1 data with ncl. But figure is
> not correctly plotted.
> I have attached the code I have used, Hdf file, actual plot (in color) and
> ncl plot (in black).
>
> Please help me. I have to plot those data urgently.
>
> Thanking you,
>
> Dr. Jayanti Pal
> Post-doc Fellow
> Department of Atmospheric Sciences
> Institute of Atmospheric and Environmental Sciences
> University of Calcutta
> Contact: jiban_samudra18 at yahoo.com, jayantibright at gmail.com
> Ph. 8013906997 <(801)%20390-6997>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180130/0898fcf3/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: S1L3WW2017001_25km.png
Type: image/png
Size: 156057 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180130/0898fcf3/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plot_ncl_mod.ncl
Type: application/octet-stream
Size: 1527 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180130/0898fcf3/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: S1L3WW2017001_25km.pdf
Type: application/pdf
Size: 76035 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180130/0898fcf3/attachment.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plot_ncl_mod_contours_only.ncl
Type: application/octet-stream
Size: 1920 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180130/0898fcf3/attachment-0001.obj>


More information about the ncl-talk mailing list