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

Home » Public Forums » archive » Re: IDL workbench & windows
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: IDL workbench & windows [message #58422] Fri, 01 February 2008 09:57 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
elwood writes:

> Does anyone know what the system variable is that holds the value of
> the project directory
> in which you are currently working?

Why don't you create your own variable. Here is an IDL
program that is handy:

PRO PWD
CD, CURRENT=thisDir
Print, thisDir
END

Used like this to tell you what directory is the current
directory:

IDL> pwd
G:\IDL\Coyote

You could probably turn this into a function easy enough. :-)

If you want to write programs that can find data files
and other files based on the location of the IDL source
code, use PROGRAMROOTDIR:

http://www.dfanning.com/programs/programrootdir.pro

Use it like this inside of a program named DOIT, to locate
a data file in the same directory as doit.pro:

datafile = Filepath(ROOTDIR=ProgramRootDir(), 'doit_data.dat')

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: IDL workbench & windows [message #58430 is a reply to message #58422] Fri, 01 February 2008 08:52 Go to previous messageGo to next message
elwood is currently offline  elwood
Messages: 23
Registered: February 2007
Junior Member
I guess my main problem was that under linux when I used IDL
I was in a directory creating programs.
Data files were usually also in this directory.

But under workbench, my current working dir is not the same as the
project directory
and that is driving me nuts.
Data files may be in the projectr dir, but if my current working dir
is not the project dir,
idl doesnt know about them.
I dont want to have to lookup (using cd,current=junk) my current dir
all the time,
figure out what directory the project is in and then type an
additional command to cd to that dir.

When you open a project workbench is opening a directory essentially.
I looked around in IDL and couldnt figure out what the variable was
that held
the project dir name, so that I could hardwire the following into my
startup:

"When a project is opened change current dir to the project dir"

The organization of workbench files and the potential for linked files
is very different from what I am used to under linux.

Does anyone know what the system variable is that holds the value of
the project directory
in which you are currently working?


Thanks,
Elisha

On Jan 31, 9:21 pm, David Fanning <n...@dfanning.com> wrote:
> elwood writes:
>> One last note for any illustrious readers:
>> When I have re-opened a project, the project explorer shows my idl
>> source file
>> and the fits file that I am trying to read.
>> However Even though the path to the fits file is in my IDL path,
>> it doesnt seem to know where the fits file is unless I cd to the
>> directory where it is located.
>
>> My quick read of how the idl path works under windows is that it
>> search for .pro and .save files in those locations.
>> How can I make it know about other files??
>
> Why would you think IDL does this kind of thing? It
> has never done it in the past. The documentation
> (*.pro and *.sav files only) seems pretty clear to me.
> Are you possibly expecting things from IDL that it
> can't deliver?
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: IDL workbench & windows [message #58443 is a reply to message #58430] Fri, 01 February 2008 01:01 Go to previous messageGo to next message
Steve[5] is currently offline  Steve[5]
Messages: 10
Registered: September 2007
Junior Member
elwood wrote:
> One last note for any illustrious readers:
> When I have re-opened a project, the project explorer shows my idl
> source file
> and the fits file that I am trying to read.
> However Even though the path to the fits file is in my IDL path,
> it doesnt seem to know where the fits file is unless I cd to the
> directory where it is located.
>
> My quick read of how the idl path works under windows is that it
> search for .pro and .save files in those locations.
> How can I make it know about other files??
>

See the file_which command - if you do not give it a path to look at it
will search using your IDL_PATH as default.

Steve
Re: IDL workbench & windows [message #58444 is a reply to message #58443] Thu, 31 January 2008 19:33 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
elwood writes:

> Could someone clarify the difference between workspace and initial
> working directory?

The workspace would be (in a perfect world) the directory
that contains all your project directories. It is not
a perfect world, because IDL allows project directories
to exist outside the workspace, but even so, the workspace
knows about them (via the .metadata folder inside the
workspace). So, it is the container that holds your project.

The initial working directory is the directory that IDL
changes into when it starts up. It *could* be the workspace
directory, but it could also be a project directory, or it
could be the default "home" directory that is operating
system dependent, if you don't tell it otherwise:

http://www.dfanning.com/misc_tips/startdir.html

If you have the "Change on Open" preference on, as you
open files the "working" directory will change to the
directory containing the file you opened.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: IDL workbench & windows [message #58445 is a reply to message #58444] Thu, 31 January 2008 19:21 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
elwood writes:

> One last note for any illustrious readers:
> When I have re-opened a project, the project explorer shows my idl
> source file
> and the fits file that I am trying to read.
> However Even though the path to the fits file is in my IDL path,
> it doesnt seem to know where the fits file is unless I cd to the
> directory where it is located.
>
> My quick read of how the idl path works under windows is that it
> search for .pro and .save files in those locations.
> How can I make it know about other files??

Why would you think IDL does this kind of thing? It
has never done it in the past. The documentation
(*.pro and *.sav files only) seems pretty clear to me.
Are you possibly expecting things from IDL that it
can't deliver?

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: IDL workbench & windows [message #58447 is a reply to message #58445] Thu, 31 January 2008 17:04 Go to previous messageGo to next message
elwood is currently offline  elwood
Messages: 23
Registered: February 2007
Junior Member
One last note for any illustrious readers:
When I have re-opened a project, the project explorer shows my idl
source file
and the fits file that I am trying to read.
However Even though the path to the fits file is in my IDL path,
it doesnt seem to know where the fits file is unless I cd to the
directory where it is located.

My quick read of how the idl path works under windows is that it
search for .pro and .save files in those locations.
How can I make it know about other files??

On Jan 31, 6:50 pm, elwood <epolo...@uwsp.edu> wrote:
>
> My basic problem is that when I switch workspace
> the current directory is not switched to the new orkspace
> and if I am reading in any files I expect to be IN that workspace idl
> cant find them.
>
> Whats the best way for dealing with this tangled mess?
>
Re: IDL workbench & windows [message #58448 is a reply to message #58447] Thu, 31 January 2008 16:50 Go to previous messageGo to next message
elwood is currently offline  elwood
Messages: 23
Registered: February 2007
Junior Member
OK ignore #1-Sorry about that!
I expected the dialog to be UNDER idl but its actually idl
So I found that place.

My basic problem is that when I switch workspace
the current directory is not switched to the new orkspace
and if I am reading in any files I expect to be IN that workspace idl
cant find them.

Whats the best way for dealing with this tangled mess?

And BTW: question3, my evil experiment, still holds true.

On Jan 31, 6:31 pm, elwood <epolo...@uwsp.edu> wrote:
> I'm having alot of problems with the workbench!
> 1)IN the help files it says I should be able to use a preference
> dialog to set
> the initial working directory.
> I cannot find such a dialog:
> I've got a preferences->idl->paths dialog
> but which one of those paths in there does idl consider my initial
> working dir?
>
> 2)For some unknown reason IDL set the working dir to
> C:\Program Files\ITT\IDL70\bin\bin.x86
> The only way i was able to fix this was by creating a new working dir
> and new project and dragging files over to it
>
> 3) As an evil experiment I wanted to rename my workspace directory
> Name was idlworktest
> and I have a project called p1
> and I have a file named test.pro in the project
>
> Couldnt see any way to rename workspace using the workbench.
> So I closed idl
> renamed my workspace to
> idlwork
>
> opened idl
> tried to switch workspace
> -------------
> First, IDL wrongly allows me to browse to a folder which no longer
> exists
>
> second when I print the current dir its not the same as the
> "workspace"
> when I look at the project properties it does show the directory
> idlwork/p1
>
> Could someone clarify the difference between workspace and initial
> working directory?
>
> The workbench is really making me crazy!!
Re: IDL workbench & windows [message #58576 is a reply to message #58445] Fri, 08 February 2008 01:43 Go to previous messageGo to next message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
David Fanning schrieb:
> elwood writes:
>
>> One last note for any illustrious readers:
>> When I have re-opened a project, the project explorer shows my idl
>> source file
>> and the fits file that I am trying to read.
>> However Even though the path to the fits file is in my IDL path,
>> it doesnt seem to know where the fits file is unless I cd to the
>> directory where it is located.
>>
>> My quick read of how the idl path works under windows is that it
>> search for .pro and .save files in those locations.
>> How can I make it know about other files??
>
> Why would you think IDL does this kind of thing? It
> has never done it in the past. The documentation
> (*.pro and *.sav files only) seems pretty clear to me.
> Are you possibly expecting things from IDL that it
> can't deliver?
>
> Cheers,
>
> David

Hi

In the past I was entering a dir where I do have my sources. If I did
start in that dir idlde this path was searched for routines.

And there was a rule in the past that's this dir is in front of the
search path.

This is gone now for idlde but still in the old way for the idl shell.

cheers
Eeimar
Re: IDL workbench & windows [message #58618 is a reply to message #58422] Mon, 04 February 2008 14:51 Go to previous messageGo to next message
elwood is currently offline  elwood
Messages: 23
Registered: February 2007
Junior Member
Current dir is easy enough to find out,
but I am talking about the PROJECT folder.
The problem is that I may be running a program from a project but I
find that the workbench
has my current dir set to one thing and the project dir set to
something entirely different.

When I open a previously created project,
workbench doesnt seem to be cd'ing to the Project folder


On Feb 1, 11:57 am, David Fanning <n...@dfanning.com> wrote:
> elwood writes:
>> Does anyone know what the system variable is that holds the value of
>> the project directory
>> in which you are currently working?
>
> Why don't you create your own variable. Here is an IDL
> program that is handy:
>
> PRO PWD
> CD, CURRENT=thisDir
> Print, thisDir
> END
>
> Used like this to tell you what directory is the current
> directory:
>
> IDL> pwd
> G:\IDL\Coyote
>
> You could probably turn this into a function easy enough. :-)
>
> If you want to write programs that can find data files
> and other files based on the location of the IDL source
> code, use PROGRAMROOTDIR:
>
> http://www.dfanning.com/programs/programrootdir.pro
>
> Use it like this inside of a program named DOIT, to locate
> a data file in the same directory as doit.pro:
>
> datafile = Filepath(ROOTDIR=ProgramRootDir(), 'doit_data.dat')
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: IDL workbench & windows [message #58671 is a reply to message #58576] Fri, 08 February 2008 05:59 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Reimar Bauer writes:

> In the past I was entering a dir where I do have my sources. If I did
> start in that dir idlde this path was searched for routines.
>
> And there was a rule in the past that's this dir is in front of the
> search path.

This is true, but partially compensated for a project's ability
to update the IDL path preference when a project is opened
or closed. Of course, you have to have this turned on for
a project.

As I expected, though, the ability to the update path preference
works better in theory than in practice. Unless you have the
discipline to maintain only one version of any particular
file (and who does!?) I find there is always a question of
which file I have opened. As far as I know, there is no
good way to tell. I always have to close all my files and
start over, opening them up one by one so I am sure. :-(

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: from 6.4 to 7.0
Next Topic: K- Nearest neighbor classification

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

Current Time: Wed Oct 08 19:26:09 PDT 2025

Total time taken to generate the page: 0.00808 seconds