[ncl-talk] Converting .nc file to CTL/UNF
Dennis Shea
shea at ucar.edu
Mon Nov 10 08:26:19 MST 2014
>From an NCL perspective, why would you want to do that?
NCL can read & plot the nc files without the intermediate .ctl file.
--
There is no automated way to construct .ctl files. Most people want to do
the reverse:
http://www.ncl.ucar.edu/Applications/grads.shtml
--
The .ctl file has 2 parts: a descriptor file (text) and one or more binary
records.
; create a binary record
* setfileoption*
<http://www.ncl.ucar.edu/Document/Functions/Built-in/setfileoption.shtml>("bin","WriteByteOrder","LittleEndian")
; "BigEndian
f = addfile("foo.nc", "r")
t = f->TEMP
fbindirwrite("T.dir_bin", t) ; .ctl=> options stream
little_endian
or
fbinrecwrite("T.seq_bin", 0, t) ; .ctl=> options sequential
little_endian
; create the descriptor file ...
; do it manually or via NCL using str_* functions and asciiwrite
Good luck
On Sun, Nov 9, 2014 at 8:29 PM, amit timilsina <
timilsinaamit87 at huskers.unl.edu> wrote:
>
> How can I convert .nc file to .ctl file? Is there any way?
>
> Amit
> _______________________________________________
> 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/20141110/6e160e52/attachment.html
More information about the ncl-talk
mailing list