Re: load query output into array

From: Rick Brownrigg <brownrig_at_nyahnyahspammersnyahnyah>
Date: Wed Aug 24 2011 - 15:00:54 MDT

Hi Donna,

Doesn't ascii read require data of all the same type? You might be able to convert your dates into "seconds since the epoch" via your sql query:

http://www.postgresql.org/docs/8.1/static/functions-datetime.html

(search for "epoch" on that page)

I'm not sure how you'd reconstitute those values back into a timestamp in NCL; perhaps its not crucial to your app?

Rick

On Aug 24, 2011, at 12:53 PM, donna Cote wrote:

> I'm familiar with asciiread but I'm stumped about how to go about taking
> the output of a PostgreSQL query (text, rows of data) and loading those
> columns into NCL arrays. How might I approach this idea?
>
> Sample query:
> select datadatetime, longitude, latitude, depth, temperature, axbtidtext
> from axbtdata order by axbtidtext, datadatetime limit 3;
>
> Sample output (comma-separated or can be space separated):
> 2010-05-08 05:40:39-05,-85.051,28.341,0,23.07,2010-129-15:57:28
> 2010-05-08 05:40:39-05,-85.051,28.341,-3,22.97,2010-129-15:57:28
> 2010-05-08 05:40:39-05,-85.051,28.341,-1.5,23.07,2010-129-15:57:28
>
> Donna
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Aug 24 15:01:00 2011

This archive was generated by hypermail 2.1.8 : Thu Aug 25 2011 - 09:54:48 MDT