[gradsusr] Rounding of a control file variable to its nearest integer before plotting

Stephen McMillan smcmillan at planalytics.com
Thu Oct 17 09:07:31 EDT 2019


Dear K P Harish,

It depends on your plot method or whether you mean that you want the
plotted RESULT to be to the nearest integer.  For example:

If plotting using 'set gxout grid' then...
'set dignum 0' prior to plotting the variable

If plotting using 'set gxout contour' and you want the contour labels be to
the nearest integer...
'set clab %.0f' (actually, no digits after decimal is the default action)
prior to the plot

If plotting using 'set gxout print'...
'set gxout print'
'set prnopts %0.0f' (for example, but see GrADS documentation index for
other examples)
'd [your variable]

Hope this helps.
Stephen


On Thu, Oct 17, 2019 at 12:07 AM KP Harish Kumar <kphk at hotmail.com> wrote:

> Dear all
>
> I want to round of a variable to its nearest integer in a control file
> before plotting it. Please do help
>
> For ex:
>
> ICAHTl12 is varaible in the following ctl file
>
> dset ^T+06_1800
> index ^T+06_1800.idx
> undef 9.999E+20
> title T+06_1800
> * produced by g2ctl v0.1.8
> * command line options: -0 T+06_1800
> * griddef=1:41:(288 x 145):grid_template=0:winds(N/S): lat-lon grid:(288 x
> 145) units 1e-06 input WE:SN output WE:SN res 48 lat -90.000000 to
> 90.000000 by 1.250000 lon 0.000000 to 358.750000 by 1.250000
> #points=41760:winds(N/S)
>
> dtype grib2
> ydef 145 linear -90.000000 1.25
> xdef 288 linear 0.000000 1.250000
> tdef 1 linear 18Z30sep2019 1mo
> zdef 1 linear 1 1
> vars 3
> CBHEl10   0,10,0   0,6,25 ** entire atmosphere Horizontal Extent of
> Cumulonimbus (CB) [%]
> ICAHTl11   0,11,0   0,3,3 ** cumulonimbus base ICAO Standard Atmosphere
> Reference Height [m]
> ICAHTl12   0,12,0   0,3,3 ** cumulonimbus top ICAO Standard Atmosphere
> Reference Height [m]
> ENDVARS
>
> I am converting ICAHTl12 from m to ft
>
> now I want to round off it to its nearest integer before plotting it. I
> dont want the decimal part
>
> Please do help
>
> With best regards
>
> K P Harish Kumar
> General Manager (Aviation Meteorology)
> Software Lab and Technical Support Center
> Sheorey Digital Systems Pvt. Ltd.
> Anjaneya Techno Park, 1st Floor
> 147, HAL Airport Road, Kodihalli
> Bengaluru 560 008,India
>
> Tele:      +91 80 67188383
> Mobile:  +91 9047354390
> Fax:       +91 80 25036222
> Website: www.sds.co.in
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>

-- 
***************************************************The information 
contained in this e-mail message is intended only for the use of the 
recipient(s) named above and may contain information that is privileged, 
confidential, and/or proprietary. If you are not the intended recipient, 
you may notreview, copy or distribute this message. If you havereceived 
this communication in error, please notify the sender immediately by 
e-mail, and delete the original 
message.***************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20191017/b4e342e7/attachment-0001.html>


More information about the gradsusr mailing list