comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » ascii_template
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
ascii_template [message #20978] Thu, 03 August 2000 00:00 Go to next message
Luis Alonso is currently offline  Luis Alonso
Messages: 27
Registered: February 2000
Junior Member
Hi again!

my question for tonite (here in the old world) is:
i've got an ascii file i need to read zillions of times, and i don't want to
deal with the bother of filling the ascii_template dialog on and on
so, is there a way to store in a file that template, and be able to recover
it to use with read_ascii?

Thanks
Luis Alonso
Re: ascii_template [message #21044 is a reply to message #20978] Fri, 04 August 2000 00:00 Go to previous message
Paul van Delst is currently offline  Paul van Delst
Messages: 364
Registered: March 1997
Senior Member
Mark Hadfield wrote:
>
> "Paul van Delst" <pvandelst@ncep.noaa.gov> wrote in message
> news:3989BC70.16B7BA85@ncep.noaa.gov...
>> David Fanning wrote:
>>>
>>> FOR j=0,zillion-1 DO BEGIN
>>
>> Should be
>>
>> FOR j=0L,zillion-1 DO BEGIN
>
> For a zillion you need at least a 64-bit integer.
>
> But seriously, don't you use "compile_opt IDL2"?

I didn't even know what that was. After checking the on-line help, I see
it is a command that is equivalent to the -d8 or -i4 on some Fortran
compilers that automatically elevate certain default type definitions.

Now, this is my Fortran half talking, I *never* like to use these
features. If in some IDL code I type:

FOR i = 0, n-1 DO BEGIN....

when I look at code surrounding that statement I know that "i" is a
short (read 2-byte) integer and thus the numbers will never exceed the
values allowed by this data type. I guess it's just the years and years
of poring over old Fortran code full of default type definitions and
default type elevations causing havoc that induce this bitterness.
That's why all my F90 code starts IMPLICIT NONE.

Then again, it's not like I'll ever deliver a software product written
in IDL to a general audience (other than mates and colleagues who want a
robust planck function procedure :o). Fortran-90/95/200x yes. IDL no. I
don't know if majority is a better word, but a lot of people I supply
code to (for free) don't use IDL for a number of reasons (too expensive,
too slow for operational use, etc.) It is noteworthy that the number
crunching hardware/software used by most atmospheric science type bods
comes bundled with all manner of compilers - the cost of which is
transparent. What good is an SGI Origin without a C or Fortran
compiler??

At a satellite data processing conference I was at last year IDL was
rejected outright as a tool for data product visualisation as it cost
extra on top of what people pay for hardware. For those that can afford
fancy stuff like IDL great, but that doesn't help the weather
forecasters in countries that have very limited budgets and rely,
partially, on software "donated" by the user community.

Sorry for blathering totally off topic. Please feel free to comment -
seeing the "big picture" is not one of my strengths.

paulv

p.s. You can replace all instances of "IDL" in the above with "Matlab"
or similar products and the conclusions differ not.

--
Paul van Delst Ph: (301) 763-8000 x7274
CIMSS @ NOAA/NCEP Fax: (301) 763-8545
Rm.202, 5200 Auth Rd. Email: pvandelst@ncep.noaa.gov
Camp Springs MD 20746
Re: ascii_template [message #21056 is a reply to message #20978] Fri, 04 August 2000 00:00 Go to previous message
Luis Alonso is currently offline  Luis Alonso
Messages: 27
Registered: February 2000
Junior Member
"Mark Hadfield" <m.hadfield@niwa.cri.nz> wrote:
> But seriously, don't you use "compile_opt IDL2"?

Seriously, what's that?!

I cannot wait 'til Davis' book arrives to the library.
(it's already ordered but being in August i guess i better lay down and wait
to Sept)
Re: ascii_template [message #21061 is a reply to message #20978] Fri, 04 August 2000 00:00 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
"Paul van Delst" <pvandelst@ncep.noaa.gov> wrote in message
news:3989BC70.16B7BA85@ncep.noaa.gov...
> David Fanning wrote:
>>
>> FOR j=0,zillion-1 DO BEGIN
>
> Should be
>
> FOR j=0L,zillion-1 DO BEGIN

For a zillion you need at least a 64-bit integer.

But seriously, don't you use "compile_opt IDL2"?

---
Mark Hadfield
m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield/
National Institute for Water and Atmospheric Research
PO Box 14-901, Wellington, New Zealand
Re: ascii_template [message #21072 is a reply to message #20978] Thu, 03 August 2000 00:00 Go to previous message
Luis Alonso is currently offline  Luis Alonso
Messages: 27
Registered: February 2000
Junior Member
>> I hear in the old world, they turn the on-line help
>> off at 5PM. :-(
>>
>> Try this:
>>
>> mytemplate = ASCII_TEMPLATE("mydatafile.dat")
>> FOR j=0,zillion-1 DO BEGIN
>> data[j] = READ_ASCII(TEMPLATE=mytemplate, datafile[j])
>> ENDFOR

here we go again... my great great great problem always is to make myself
clear (and I rarely suceed).
Of course the problem was to reuse that template some other day...

> And furthermore, if you wanted to save that template in a file, you
> could just do:
> save, filename='mytemplate.idl', mytemplate
> and to get it back some other day:
> restore, 'mytemplate.idl'

thanks, that's what i wanted...

just for your info, i'm the kind that when getting a new toy just starts
playing with it... so i gess i just skipped some basics from the handbook,
do i?

By the way, Paul, what you just pointed drove me nuts when i first put my
hands on IDL some time ago ;)

Thanks, guys

Luis Alonso
Re: ascii_template [message #21073 is a reply to message #20978] Thu, 03 August 2000 00:00 Go to previous message
Paul van Delst is currently offline  Paul van Delst
Messages: 364
Registered: March 1997
Senior Member
David Fanning wrote:
>
> FOR j=0,zillion-1 DO BEGIN

Should be

FOR j=0L,zillion-1 DO BEGIN

:O)

*yawn*

Can you tell I didn't get coffee this morning?

Sigh.

p.s. Sorry.
--
Paul van Delst Ph: (301) 763-8000 x7274
CIMSS @ NOAA/NCEP Fax: (301) 763-8545
Rm.202, 5200 Auth Rd. Email: pvandelst@ncep.noaa.gov
Camp Springs MD 20746
Re: ascii_template [message #21074 is a reply to message #20978] Thu, 03 August 2000 00:00 Go to previous message
Bernard Puc is currently offline  Bernard Puc
Messages: 65
Registered: January 1998
Member
David Fanning wrote:
>
> Luis Alonso (luis.alonso@uv.es) writes:
>
>> my question for tonite (here in the old world) is:
>> i've got an ascii file i need to read zillions of times, and i don't want to
>> deal with the bother of filling the ascii_template dialog on and on
>> so, is there a way to store in a file that template, and be able to recover
>> it to use with read_ascii?
>
> I hear in the old world, they turn the on-line help
> off at 5PM. :-(
>
> Try this:
>
> mytemplate = ASCII_TEMPLATE("mydatafile.dat")
> FOR j=0,zillion-1 DO BEGIN
> data[j] = READ_ASCII(TEMPLATE=mytemplate, datafile[j])
> ENDFOR


And furthermore, if you wanted to save that template in a file, you
could just do:

save, filename='mytemplate.idl', mytemplate

and to get it back some other day:

restore, 'mytemplate.idl'

--
Bernard Puc AETC, INC.
bpuc@va.aetc.com 1225 Jefferson Davis Highway #800
(703) 413-0500 Arlington, VA 22202
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Top 10 IDL Requests ... python
Next Topic: Simple number formatting problem

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:41:18 PDT 2025

Total time taken to generate the page: 0.00617 seconds