[ncl-talk] read json file

Dennis Shea shea at ucar.edu
Wed Oct 10 11:24:35 MDT 2018


I am blissfully ignorant about using JSON  and *I prefer to stay that way!
:-)*

There are some negative comments about using JSON for "configuration files."

*Note:*
*https://arp242.net/weblog/json_as_configuration_files-_please_dont*
<https://arp242.net/weblog/json_as_configuration_files-_please_dont>
*https://revelry.co/json-configuration-file-format/*
<https://revelry.co/json-configuration-file-format/>
*=================================================*
That said, NCL 6.5.0 has the following which can be used to read an 'NCL
configuration' file.

*https://www.ncl.ucar.edu/Document/Functions/Contributed/keyword_values.shtml*
<https://www.ncl.ucar.edu/Document/Functions/Contributed/keyword_values.shtml>

If you do:

*%>* less *$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl*

and search for "*keyword_values*" you can see the code. If you find this
useful, you could extract the function code and, perhaps, tune it to your
needs.

An advantage of the NCL  "*keyword_values*"is that it does allow comments
to be embedded within the configuration file.

Good luck
D




On Wed, Oct 10, 2018 at 8:37 AM Francesco Trotta <francesco.trotta4 at unibo.it>
wrote:

> ok, I tried to implement a procedure using asciiread and  ncl string
> manag. functions. to read the json
>
>
> but I think this feature will be useful to be implement in NCL package
>
> because json are now very common as configuration file
>
>
> thanks
>
> Fra
> ------------------------------
> *Da:* Rick Brownrigg <brownrig at ucar.edu>
> *Inviato:* giovedì 4 ottobre 2018 21:36:55
> *A:* Francesco Trotta
> *Cc:* Ncl-talk
> *Oggetto:* Re: [ncl-talk] read json file
>
> Hi,
>
> No unfortunately, there is no direct support for reading JSON.
>
> Rick
>
> On Thu, Oct 4, 2018 at 1:04 PM Francesco Trotta <
> francesco.trotta4 at unibo.it> wrote:
>
> Dear mcl-talk
>
>    I'm using ncl 6.4.0.
>
>    Is there a way to read JSON file in ncl?
>
>
>
> thanks
>
> Francesco T.
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> _______________________________________________
> 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/20181010/e7afd5ba/attachment.html>


More information about the ncl-talk mailing list