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

Home » Public Forums » archive » help IDL GRID3 problem
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
help IDL GRID3 problem [message #3469] Tue, 31 January 1995 10:14 Go to next message
aa318 is currently offline  aa318
Messages: 1
Registered: January 1995
Junior Member
I'm using IDL version 3.6.1a and I'm trying to use the GRID3 routine.
I keep getting the error message:

"Ill-conditioned matrix or all nodes co-planar"

Does anyone know what this means?
--
Linda Payzant, Bedford Institute of Oceanography, Dartmouth, Nova Scotia
lpayzant@astra.bio.dfo.ca
Re: Help IDL [message #14695 is a reply to message #3469] Mon, 22 March 1999 00:00 Go to previous message
William Daffer is currently offline  William Daffer
Messages: 34
Registered: February 1999
Member
VU KHAC Tri <tvk@info.fundp.ac.be> writes:

> Hi folks,
> I want to write a IDL reader which can read a binary file created by a C
> application. This binary file contains structured data, for example:
>
> struct {
> double A;
> long B;
> short C;
> }
>
> How can I write the reader this file in IDL application ? Thanks for
> help.
> Best regards,
>
> --
> #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++#
> | VU KHAC TRI |


I'm assuming you're on a Unix system. There are window's users here
that will make the necessary corrections should this information be
faulty for windows systems.

The basic idea is to create the structure to mirror the C structure,
making allowances for the short(C) -> int(IDL) mapping, and being
aware that string data has to be fixed length, which doesn't appear
to be a problem here. Then make an array of this structure that has
as many records as the file, or as many as you want to read at a
time. The just call readu with that array of structures as the
argument.

In idl

read_struct = { a:0.0d, b:0l, c:0}
openr, lun, your_filename_here,/get_lun,error=err
if err eq 0 then begin
ff=fstat(lun)
nrecs = ff.size/14 ;<- note, this is the sum of the data in
; read_struct, NOT the result of
; N_tags(read_struct,/length)=16, which pads structure.
; -- to read the whole file in one read
recs=replicate(read_struct,nrecs)
readu,lun,recs ; slurp whole file in one read
free_lun,lun
endif else Message,!error_state.msg ;<- might have to change if
; not using IDL 5.0 or greater


Or, if you only wanted to read, say, 100 records at a time, just
replace 'nrecs' above with 100. But you'd have to iterate over the
100 record batches in the file.

If the file isn't too large, you should be able to read the whole
thing in one fell swoop, and it is almost always faster to do this
and then prune the data according to some data editting criteria.


--
My mail address has been mangled by my mailer. Send replies to...
daffer@primenet.com

--
Outside of a dog, a book is man's best friend
Inside of a dog, it's too dark to read.
Groucho Marx.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Help IDL
Next Topic: FAQ Site changes

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

Current Time: Wed Oct 08 15:31:45 PDT 2025

Total time taken to generate the page: 0.00427 seconds