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

Home » Public Forums » archive » Re: fits_help issues again/still
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: fits_help issues again/still [message #67421] Thu, 23 July 2009 15:22
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
> Besides returning to the main level, as David suggested, in that sort
> of situation (something worked 10 minutes before) sometimes it is
> useful to reset the IDL session (.reset_session,
> or .full_reset_session), which is a almost equivalent to exiting and
> restarting IDL.

I should also have said, that when resetting or restarting IDL helps,
it is not because of some unknown esoteric reason. There are many
possible reasons for that, such as not being at the main level, as
David said, or the presence of variables used as arguments that make
some routine use them instead of some default, which happens when the
variables are undefined in the beginning of the session.
Re: fits_help issues again/still [message #67422 is a reply to message #67421] Thu, 23 July 2009 15:13 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Jul 23, 6:00 pm, David Fanning <n...@dfanning.com> wrote:
> Barbara writes:
>> this is what it tells me:
>
>> % FITS_OPEN:  ERROR: OPENR: Error opening file. Unit: 100
>>                       File: C:\Documents and Settings\kerri_2\Desktop
>> \medvar_IDL_
>>                        stuff\spec6sep080079.a.fits
>> % Expression must be a structure in this context: FCB.
>> % Execution halted at: FITS_HELP          62 C:\Documents and
>>    Settings\kerri_2\Desktop\Course_Files\astrolib\pro\fits
>> \fits_help.pro
>> %                      $MAIN$
>

That indicates that the error in line 62 is only a consequence of the
first error (not being able to open the file). That is the source of
the problem. What it is trying to open is C:\Documents and Settings
\kerri_2\Desktop\medvar_IDL_ stuff
\spec6sep080079.a.fits

Which may not be where the file is, as David mentioned, if a relative
filename was used. Some program you used might have changed your
current directory, and it also might have happened when a file was
opened in the editor, if the preference "change directory on file
open" is enabled.

Besides returning to the main level, as David suggested, in that sort
of situation (something worked 10 minutes before) sometimes it is
useful to reset the IDL session (.reset_session,
or .full_reset_session), which is a almost equivalent to exiting and
restarting IDL.
Re: fits_help issues again/still [message #67423 is a reply to message #67422] Thu, 23 July 2009 14:43 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Barbara writes:

> ok... I moved the file into my default library and it works. However,
> I'm trying to work on a lot of fits, that are all in a folder to make
> my life easier and more organized. Should i make that my default
> library then? and move the library that is currently my default to
> just another library? Having it as a folder inside the current default
> library also causes issues

No, no, no. Goodness, no. :-)

Stay organized. Lumping things all together in one
folder will make your workspace look like my wife's
desk. You don't want that! :-(

Just be sure you are clear on what a "relative" filename is,
and what an "absolute" filename is. It is probably always best
to use absolute filenames, if you are not sure exactly where
you are.

And, are you *sure* you have your IDL path problems worked
out? If you set your path properly, you won't have to be
worrying so much about where things are. They will be found
when they are needed.

Have you considered a good book about IDL programming. :-)

Cheers,

David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: fits_help issues again/still [message #67424 is a reply to message #67423] Thu, 23 July 2009 14:22 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Barbara writes:

> my variable is a string. What is so confusing is it was all working 10
> min ago! and I even tried to use the file I was working on before that
> it had worked on, and it's not. I have no idea what ext name is. I
> wasn't using my variable (cause for some reason that never works) so I
> was using the actual file name, copied directly from the folder it's
> in.

Humm. I hope you are not one of those people who
thinks programming is easy, or that it "always
makes sense".

Here is something to try. Type "RETALL" (this
stands for RETurn ALL the way back to the main
IDL level). This might get you back on track.
It could be that when you crashed your program
you got stuck inside the program. That will certainly
confuse you.

Here is a piece of advice. Well over 95% of
programming errors are caused by the programmer.
An untold number of these are caused by the programmer
*thinking* he or she knows what is going on, but not
realizing they are making bogus assumptions.

So, when something goes wrong (and it does about every
10 minutes or so, on average, for most programmers)
take a couple of deep breaths and start questioning
your assumptions. Then test a few of them. Have a look
around. Maybe just gaze out the window at the mountains
(if you have any) for a couple of minutes to settle yourself.
Sometimes I do my best debugging when I go for a short walk
in the park across the street. Then step though your code to
see if what you THINK you are doing is really what you are
doing. 9 times out of 10 it is not, and you have found that
bug.

Now, on to the next one! :-)

Cheers,

David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: fits_help issues again/still [message #67425 is a reply to message #67424] Thu, 23 July 2009 14:18 Go to previous message
Barbara is currently offline  Barbara
Messages: 17
Registered: July 2009
Junior Member
On Jul 23, 2:07 pm, Barbara <med...@susqu.edu> wrote:
> On Jul 23, 2:00 pm, David Fanning <n...@dfanning.com> wrote:
>
>
>
>> Barbara writes:
>>> this is what it tells me:
>
>>> % FITS_OPEN: ERROR: OPENR: Error opening file. Unit: 100
>>> File: C:\Documents and Settings\kerri_2\Desktop
>>> \medvar_IDL_
>>> stuff\spec6sep080079.a.fits
>>> % Expression must be a structure in this context: FCB.
>>> % Execution halted at: FITS_HELP 62 C:\Documents and
>>> Settings\kerri_2\Desktop\Course_Files\astrolib\pro\fits
>>> \fits_help.pro
>>> % $MAIN$
>
>> Well, I would say the most likely explanation is that whatever
>> you passed to FITS_HELP wasn't what it was expecting. Was
>> it the name of a FITS file? Or was it an IDL structure
>> variable? You can use the "HELP, variable" syntax to
>> find out what it was. If it is a structure, set the /STRUCTURE
>> keyword to the HELP command so you can see what fields it
>> has in it. Is there a field named "extname"?
>
>> Cheers,
>
>> David
>> --
>> David Fanning, Ph.D.
>> Coyote's Guide to IDL Programming (www.dfanning.com)
>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
> my variable is a string. What is so confusing is it was all working 10
> min ago! and I even tried to use the file I was working on before that
> it had worked on, and it's not. I have no idea what ext name is. I
> wasn't using my variable (cause for some reason that never works) so I
> was using the actual file name, copied directly from the folder it's
> in.

ok... I moved the file into my default library and it works. However,
I'm trying to work on a lot of fits, that are all in a folder to make
my life easier and more organized. Should i make that my default
library then? and move the library that is currently my default to
just another library? Having it as a folder inside the current default
library also causes issues
Re: fits_help issues again/still [message #67426 is a reply to message #67425] Thu, 23 July 2009 14:07 Go to previous message
Barbara is currently offline  Barbara
Messages: 17
Registered: July 2009
Junior Member
On Jul 23, 2:00 pm, David Fanning <n...@dfanning.com> wrote:
> Barbara writes:
>> this is what it tells me:
>
>> % FITS_OPEN: ERROR: OPENR: Error opening file. Unit: 100
>> File: C:\Documents and Settings\kerri_2\Desktop
>> \medvar_IDL_
>> stuff\spec6sep080079.a.fits
>> % Expression must be a structure in this context: FCB.
>> % Execution halted at: FITS_HELP 62 C:\Documents and
>> Settings\kerri_2\Desktop\Course_Files\astrolib\pro\fits
>> \fits_help.pro
>> % $MAIN$
>
> Well, I would say the most likely explanation is that whatever
> you passed to FITS_HELP wasn't what it was expecting. Was
> it the name of a FITS file? Or was it an IDL structure
> variable? You can use the "HELP, variable" syntax to
> find out what it was. If it is a structure, set the /STRUCTURE
> keyword to the HELP command so you can see what fields it
> has in it. Is there a field named "extname"?
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Coyote's Guide to IDL Programming (www.dfanning.com)
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

my variable is a string. What is so confusing is it was all working 10
min ago! and I even tried to use the file I was working on before that
it had worked on, and it's not. I have no idea what ext name is. I
wasn't using my variable (cause for some reason that never works) so I
was using the actual file name, copied directly from the folder it's
in.
Re: fits_help issues again/still [message #67427 is a reply to message #67426] Thu, 23 July 2009 14:00 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Barbara writes:

> this is what it tells me:
>
> % FITS_OPEN: ERROR: OPENR: Error opening file. Unit: 100
> File: C:\Documents and Settings\kerri_2\Desktop
> \medvar_IDL_
> stuff\spec6sep080079.a.fits
> % Expression must be a structure in this context: FCB.
> % Execution halted at: FITS_HELP 62 C:\Documents and
> Settings\kerri_2\Desktop\Course_Files\astrolib\pro\fits
> \fits_help.pro
> % $MAIN$

Well, I would say the most likely explanation is that whatever
you passed to FITS_HELP wasn't what it was expecting. Was
it the name of a FITS file? Or was it an IDL structure
variable? You can use the "HELP, variable" syntax to
find out what it was. If it is a structure, set the /STRUCTURE
keyword to the HELP command so you can see what fields it
has in it. Is there a field named "extname"?

Cheers,

David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: fits_help issues again/still [message #67428 is a reply to message #67427] Thu, 23 July 2009 13:43 Go to previous message
Barbara is currently offline  Barbara
Messages: 17
Registered: July 2009
Junior Member
On Jul 23, 1:41 pm, David Fanning <n...@dfanning.com> wrote:
> Barbara writes:
>> I am trying to split fits files into headers and images. however, when
>> i try to fits_help, the file, it goes into an error. it wasn't doing
>> this about 10 minutes ago and now it is. My astrolib is in the path,
>> but it's having an error at line 62 of fits_help.pro. Help!
>
> You really have to give us more clues. We only
> appear to be clairvoyant. :-)
>
> For example, it would help a great deal to know
> what the error is.
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Coyote's Guide to IDL Programming (www.dfanning.com)
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

this is what it tells me:

% FITS_OPEN: ERROR: OPENR: Error opening file. Unit: 100
File: C:\Documents and Settings\kerri_2\Desktop
\medvar_IDL_
stuff\spec6sep080079.a.fits
% Expression must be a structure in this context: FCB.
% Execution halted at: FITS_HELP 62 C:\Documents and
Settings\kerri_2\Desktop\Course_Files\astrolib\pro\fits
\fits_help.pro
% $MAIN$
Re: fits_help issues again/still [message #67429 is a reply to message #67428] Thu, 23 July 2009 13:41 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Barbara writes:

> I am trying to split fits files into headers and images. however, when
> i try to fits_help, the file, it goes into an error. it wasn't doing
> this about 10 minutes ago and now it is. My astrolib is in the path,
> but it's having an error at line 62 of fits_help.pro. Help!

You really have to give us more clues. We only
appear to be clairvoyant. :-)

For example, it would help a great deal to know
what the error is.

Cheers,

David

--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (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: fits_help issues again/still
Next Topic: Re: speed up image processing

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

Current Time: Sat Oct 11 03:29:23 PDT 2025

Total time taken to generate the page: 0.40332 seconds