Re: IDL workbench & windows [message #58422] |
Fri, 01 February 2008 09:57  |
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   |
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 #58444 is a reply to message #58443] |
Thu, 31 January 2008 19:33   |
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 #58618 is a reply to message #58422] |
Mon, 04 February 2008 14:51   |
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  |
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.")
|
|
|