Rif: Re: [ncl-talk] problem with 2D vertical coordinates plot

From: <franco.catalano_at_nyahnyahspammersnyahnyah>
Date: Sat, 19 May 2007 16:52:58 +0200

Thanks a lot! This solved the problem.

Bye,

Franco

 
Mary Haley <haley@ucar.edu>
18/05/2007 16:30 CST

Per   franco.catalano@uniroma1.it
CC  David Brown <dbrown@ucar.edu>
CCR  
Oggetto  Re: [ncl-talk] problem with 2D vertical coordinates plot
 

Hi Franco,

Based on Dave's description below, and the script and data you sent
me, I modified your script to do what Dave suggested. Please see the
attached "vector_2d_2.ncl" script and the *.ps file.

--Mary



On Fri, 18 May 2007, David Ian Brown wrote:

> Hi Franco,
>
> I was going to try to run your plot before I have to leave in a few minutes,
> but
> I can see that I am not up-to-speed with running WRF apps yet. Looks like I
> need to build some shared libraries and I'm not going to have time for that.
> However, I have another suggestion for you to try.
> If you look at the first example under
>
> http://www.ncl.ucar.edu/Applications/2Dvertcoord.shtml
>
> I think you will see that although the data in this plot is scalar, the
> same principles apply. If you want a plot that looks, conceptually, like the
> second frame you need to "linearize" the vertical axis by overlaying your
> plot on a LogLinPlot. With the TriangularMesh transform you do not have to
> do this, but with the the curvilinear transformation you do.
>
> Basically after your call to gsn_vector you need to adapt the code at the
> end of this example: i.e. this part.
> Hope this helps.
> -dave
>
> ; Linearize the plot by overlaying on a logLinPlot. It's important to use the
> ; "curvilinear" gridType instead of the default 2D "spherical" grid type
> ; because the spherical grid type assumes that the X coordinates are modular
> ; and that the Y coordinates only range from -90 to 90.
>
>  setvalues plot
>    "trGridType"    : "curvilinear"
>    "tiMainString"  : "linearized data"
>    "tiXAxisString" : "Range across shelf (m)"   ; x-axis title
>    "tiYAxisString" : "Depth up from bottom (m)" ; y-axis title
>  end setvalues
>
>  ll = create "ll" logLinPlotClass wks
>    "trXMinF"      : min(range)
>    "trXMaxF"      : max(range)
>    "trYMinF"      : min(depth)
>    "trYMaxF"      : max(depth)
>    "pmTickMarkDisplayMode" : "always"
>  end create
>  overlay(ll, plot)
>
>  draw(ll)
>  frame(wks)
>
> On May 18, 2007, at 10:33 AM, franco.catalano@uniroma1.it wrote:
>
>> I have put my data and the relative ncl script in your ftp server.
>>
>> The file, named wrfout_franco.tar.gz, is gzipped because of its original
>> large size.
>>
>> Thank you for your kindness,
>>
>> Franco
>>
>>
>> Mary Haley <haley@ucar.edu>
>> 18/05/2007 09:10 CST
>>
>> Per   franco.catalano@uniroma1.it
>> CC  David Ian Brown <dbrown@ucar.edu>
>> CCR
>> Oggetto  Re: [ncl-talk] problem with 2D vertical coordinates plot
>>
>>
>>
>> Franco,
>>
>> Can you provide us with your data so we can run the script? You can
>> put it on our anonymous ftp account:
>> ftp ftp.cgd.ucar.edu
>> <log in as "anonymous">
>> <Use email address as password>
>> cd incoming
>> put <your data file>
>> quit
>>
>> Please note you can't list the contents of this directory; we'll need
>> to know the exact name of the file in order to retrieve it.
>>
>> Thanks,
>>
>> --Mary
>>
>>
>> On Thu, 17 May 2007 franco.catalano@uniroma1.it wrote:
>>
>> >
>> > I have tried setting these attributes but the axis remain referred to the
>> > nodes (i,k) instead of
>> >
>> > the 2D arrays vx and vy, then the output appears as if I had no
>> > topography.
>> >
>> > I attach my modified script.
>> >
>> > Thanks,
>> >
>> > Franco
>> >
>> >
>> > David Ian Brown <dbrown@ucar.edu>
>> > 16/05/2007 11:30 CST
>> >
>> > Per   franco.catalano@uniroma1.it
>> > CC  ncl-talk@ucar.edu
>> > CCR
>> > Oggetto  Re: Rif: Re: Rif: Re: Rif: Re: [ncl-talk] problem with 2D
>> > vertical coordinates plot
>> >
>> >
>> > Hi Franco,
>> >
>> > I don't think you need to use TriangularMesh to plot your vector field
>> > with 2D vertical coordinates.
>> >
>> > If you have 2 coordinate arrays with one giving the X axis coordinates
>> > and the other the Y axis
>> > coordinates, you can set the special lat2d and lon2d attributes for
>> > your U and V variables before
>> > calling gsn_csm_vector. You can ignore the fact that in this case your
>> > coordinates do not represent
>> > lats and lons.
>> >
>> > So you would say, for example
>> >
>> > U@lat2d = y2d_coords
>> > U@lon2d = x2d_coords
>> > V@lat2d = y2d_coords
>> > V@lon2d = x2d_coords
>> >
>> > gsn_csm_vector(wks,U,V,res)
>> >
>> > Note that since it is likely that your X and Y coordinates have
>> > different units and the ranges of each
>> > axis are dissimilar, you will probably want to set the Vector resource
>> > vcMapDirection False.
>> > See
>> > http://www.ncl.ucar.edu/Document/Graphics/Resources/
>> > vc.shtml#vcMapDirection
>> >
>> > If you have problems with this, let us know.
>> > -dave
>> >
>> > On May 15, 2007, at 3:14 AM, franco.catalano@uniroma1.it wrote:
>> >
>> > > Since gsn_csm_vector currently does not work with 2D vertical
>> > > coordinates,
>> > >
>> > > could you please tell me an alternative way to plot vertical slices of
>> > > a vector field
>> > >
>> > > from a stretched domain with topography?
>> > >
>> > > Thanks,
>> > >
>> > > Franco
>> > >
>> > >
>> > > David Ian Brown <dbrown@ucar.edu>
>> > > 09/05/2007 10:18 CST
>> > >
>> > > Per   Mary Haley <haley@ucar.edu>
>> > > CC  franco.catalano@uniroma1.it
>> > > CCR
>> > > Oggetto  Re: Rif: Re: Rif: Re: [ncl-talk] problem with 2D vertical
>> > > coordinates plot
>> > >
>> > >
>> > >
>> > > Yes, I suppose there should be an error message when trGridType is set
>> > > to TriangularMesh
>> > > for vector plots.  But as Mary says,  later on this year it will work
>> > > to set TriangularMesh for
>> > > these plots. I will fix this when I have a chance.
>> > > -dave
>> > >
>> > >
>> > > On May 9, 2007, at 7:42 AM, Mary Haley wrote:
>> > >
>> > > >
>> > > > Franco,
>> > > >
>> > > > I think the problem is that you are setting trGridType to
>> > > > TriangularMesh, which is not an option for vector plots. This is only
>> > > > available for contour plots, and will probably be added to vector
>> > > > plots later this year.
>> > > >
>> > > > It seems NCL should have given you an error message about this,
>> > > > however.  I'm CC-ing Dave Brown in case this is something that
>> > > > needs to be remedied.
>> > > >
>> > > > --Mary
>> > > >
>> > > >
>> > > >
>> > > > On Wed, 9 May 2007 franco.catalano@uniroma1.it wrote:
>> > > >
>> > > >> The dimensions of my 2-dimensional arrays vx and vy are the same and
>> > > >> equal to the those of my vector field.
>> > > >> I have no troubles with scalar fields plotted with gsn_csm_contour,
>> > > >> so I
>> > > >> suppose the problem is with gsm_csm_vector.
>> > > >> Here is my ncl script attached.
>> > > >> Thanks,
>> > > >> Franco
>> > > >> Mary Haley <haley@ucar.edu>
>> > > >> 07/05/2007 08:19 CST
>> > > >> Per   franco.catalano@uniroma1.it
>> > > >> CC CCR Oggetto  Re: Rif: Re: [ncl-talk] problem with 2D vertical
>> > > >> coordinates
>> > > >> plot
>> > > >> Franco,
>> > > >> I'm not sure what the question is. If you want to generate a vector
>> > > >> plot,
>> > > >> you need two 2-dimensional arrays of the same size, which you then
>> > > >> pass
>> > > >> to gsn_csm_vector. There are several vector examples on the page:
>> > > >>    http://www.ncl.ucar.edu/Applications/vector.shtml
>> > > >> --Mary
>> > > >> On May 7, 2007, at 7:39 AM, franco.catalano@uniroma1.it wrote:
>> > > >> I have seen those links before sending the message. I think it is
>> > > not
>> > > >> a
>> > > >> problem with wrf dataset.
>> > > >> I just want to plot a vector field with 2D vertical coordinates.
>> > > Could
>> > > >> you please send me an
>> > > >> example script? I am using gsn_csm_vector.
>> > > >> Thank you for your kindness,
>> > > >> Franco
>> > > >> Mary Haley <haley@ucar.edu>
>> > > >> 04/05/2007 10:01 CST
>> > > >> Per  franco.catalano@uniroma1.it
>> > > >> CC ncl-talk@ucar.edu
>> > > >> CCR
>> > > >> Oggetto Re: [ncl-talk] problem with 2D vertical coordinates plot
>> > > >> Hi Franco,
>> > > >> Please see the WRF graphical page, which contains several examples.
>> > > >> The
>> > > >> main page is:
>> > > >>     http://www.ncl.ucar.edu/Applications/wrf.shtml
>> > > >> which contains links to several other pages, one or two of which
>> > > >> contain
>> > > >> vector plots.
>> > > >> You may also want to consider contacting WRF support itself, at
>> > > >> wrfhelp@ucar.edu. They have a large post-processing graphics package
>> > > >> created specifically for WRF. You can see their page at:
>> > > >>     http://www.mmm.ucar.edu/wrf/users/graphics/WRF_NCL/NCL.htm
>> > > >> --Mary
>> > > >> On May 3, 2007, at 10:02 AM, franco.catalano@uniroma1.it wrote:
>> > > >> I can not manage to plot a vector field (i.e. vertical
>> > > >> slice of wind) in 2D vertical coordinates (height Z
>> > > >> and (virtual) 2D horizontal distance X). I have succesfully
>> > > >> plotted a scalar field like temperature referring to the
>> > > >> examples on http://www.ncl.ucar.edu/Applications/2Dvertcoord.shtml.
>> > > >> I am working with WRF netCDF files.
>> > > >> Thanks,
>> > > >> Franco
>> > > >> ____________________________________________________
>> > > >> Eng. Franco Catalano
>> > > >> Ph.D. Student
>> > > >> D.I.T.S.
>> > > >> Department of Hydraulics, Transportation and Roads.
>> > > >> Via Eudossiana 18, 00184 Rome
>> > > >> University of Rome "La Sapienza".
>> > > >> tel: +390644585218
>> > > >> _______________________________________________
>> > > >> ncl-talk mailing list
>> > > >> ncl-talk@ucar.edu
>> > > >> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>> > > >>
>> >
>> >
>> >
>
>

Received on Sat May 19 2007 - 08:52:58 MDT

This archive was generated by hypermail 2.2.0 : Mon May 21 2007 - 09:22:55 MDT