[ncl-talk] HDF to Text issues
Dennis Shea
shea at ucar.edu
Thu Jun 23 07:29:41 MDT 2016
The 'key' is to replicate (broadcast) the 'time' variable to the same
dimensionality as the 'data' variable. This is readilt accomplished via the
'conform' function
TIME = conform( data, time, 0) ; replicate (broadcast) to match dimension
sizes
Then ...
write_table("test.txt","a",[/lat2d,lon2d,TIME,data/],"%-16.5f%-16.5f%-16.5f%-16.5f")
I added an extra ' %-16.5f ' .... these do not have to be the same (I am
sure you know that.)
Note: all the meta data in the example is not really necessary. Meta data
is desirable for writng (say) netCDF and for graphics applications. In this
case, it is not needed.
See attached
D
http://www.ncl.ucar.edu/Document/Functions/Built-in/conform.shtml
http://www.ncl.ucar.edu/Document/Functions/Built-in/conform_dims.shtml
On Wed, Jun 22, 2016 at 8:36 AM, BLIUJUS, STEVEN D GS-07 USAF ACC 16 WS/WXE
<steven.bliujus.1 at us.af.mil> wrote:
> I am having issues converting HDF to text files in particular I want to
> create a table with lat, lon, date, and data. Currently the ncl script I
> have does that with the exception of the time variable. I would like each
> point have the time associated with it. Currently, it just lists the first
> 17 times. I have attached the ncl script, the output, and 3 hdf files that
> I
> am using.
>
> V/R,
>
> STEVEN D. BLIUJUS, GS-07, DAFC
> 16 WS/WXE
> DSN: 272-7151
> COMM: 402-232-7151
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> 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/20160623/d54d6c56/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: modis.hdf2txt.ncl
Type: application/octet-stream
Size: 4041 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160623/d54d6c56/attachment.obj
More information about the ncl-talk
mailing list