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

Home » Public Forums » archive » Re: Openw and printf
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
Re: Openw and printf [message #56596] Mon, 05 November 2007 03:40
Spon is currently offline  Spon
Messages: 178
Registered: September 2007
Senior Member
No Message Body
Re: Openw and printf [message #56601 is a reply to message #56596] Sun, 04 November 2007 05:54 Go to previous message
Foldy Lajos is currently offline  Foldy Lajos
Messages: 268
Registered: October 2001
Senior Member
On Fri, 2 Nov 2007, StevenM wrote:

> Hello Everybody,
>
> I have a 3D array [x,y,z] and I am trying to write one column to a
> file. My problem arises when I try to export the z dimension, the
> output file has gaps between each data point, in the other dimensions
> there are no gaps. Can anyone help me with how to get rid of the
> gaps.
>
> thanks
>
> Steven
>
> ps the output data looks like this
>
> 4
>
> 6
>
> 7
>
> 8
>
> when I would like
>
> 4
> 6
> 7
> 8
>
>

REFORM() will solve this:


IDL> a=indgen(2,3,4)
IDL> print, a[*,0,0]
0 1
IDL> print, a[0,*,0]
0
2
4
IDL> print, a[0,0,*]
0

6

12

18
IDL> print, reform(a[0,0,*], 1,4)
0
6
12
18



regards,
lajos
Re: Openw and printf [message #56602 is a reply to message #56601] Sun, 04 November 2007 04:27 Go to previous message
StevenM is currently offline  StevenM
Messages: 9
Registered: June 2006
Junior Member
Hi David

Thanks for the reply, no it was all done on a PC. I get the same
problem using the print command: the data in the z dimension has
spaces. And no I haven't used a format statement.

all the best

Steven
Re: Openw and printf [message #56612 is a reply to message #56602] Fri, 02 November 2007 12:20 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
StevenM writes:

> I have a 3D array [x,y,z] and I am trying to write one column to a
> file. My problem arises when I try to export the z dimension, the
> output file has gaps between each data point, in the other dimensions
> there are no gaps. Can anyone help me with how to get rid of the
> gaps.

Did you create this file on a PC and open it on a UNIX
machine? If so, I would try running dos2unix on it. This
looks more like a file transfer problem to me, than a file
writting problem. Did you use some kind of format statement?

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: FLAASH Atmospheric Module
Next Topic: PROBLEM WITH FEDORA 7 and ENVIZOOM

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

Current Time: Wed Oct 08 20:02:08 PDT 2025

Total time taken to generate the page: 0.43999 seconds