Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
Re: How to add several *.fit files (matrices) into one output *.fit file?
On Thu, 6 Nov 2008 08:46:31 -0800 (PST), Griffons <griffons76@gmail.com> wrote: > Hello, > Thank you for your help. > I mean adding as in summation. Let say you have 20 image files in a > folder and want the output to be the sum into one file. Well, then it's like Jeremy said, readfits to read all images and writefits to write the sum. I'm not sure what the problem is...
On Nov 6, 11:55 am, Wox <s...@nomail.com> wrote: > On Thu, 6 Nov 2008 08:46:31 -0800 (PST), Griffons > > <griffon...@gmail.com> wrote: >> Hello, >> Thank you for your help. >> I mean adding as in summation. Let say you have 20 image files in a >> folder and want the output to be the sum into one file. > > Well, then it's like Jeremy said, readfits to read all images and > writefits to write the sum. I'm not sure what the problem is... I downloaded readfits, writefits and the other files required. I am not sure what to do next. I compiled and ran readfits and writefits, but then what to do?
On Thu, 6 Nov 2008 09:14:30 -0800 (PST), Griffons <griffons76@gmail.com> wrote: > I downloaded readfits, writefits and the other files required. > I am not sure what to do next. I compiled and ran readfits and > writefits, but then what to do? files=['test1.fits','test2.fits',...] ; use e.g. file_search for this sum = READFITS( files[0], /NOSCALE) for i=1,n_elements(files)-1 do $ sum += READFITS( files[i], /NOSCALE) writefits, 'sum_filename', sum Both readfits and writefits depend on some other procedures from the ASTRO library. Make sure you compiled them too.
Griffons writes: > I downloaded readfits, writefits and the other files required. > I am not sure what to do next. I compiled and ran readfits and > writefits, but then what to do? Usually, the next step is to read the documentation headers. 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.")
On Nov 6, 7:14 am, Griffons <griffon...@gmail.com> wrote: > On Nov 6, 11:55 am, Wox <s...@nomail.com> wrote: > >> On Thu, 6 Nov 2008 08:46:31 -0800 (PST), Griffons > >> <griffon...@gmail.com> wrote: >>> Hello, >>> Thank you for your help. >>> I mean adding as in summation. Let say you have 20 image files in a >>> folder and want the output to be the sum into one file. > >> Well, then it's like Jeremy said, readfits to read all images and >> writefits to write the sum. I'm not sure what the problem is... > > I downloaded readfits, writefits and the other files required. > I am not sure what to do next. I compiled and ran readfits and > writefits, but then what to do? I would do something like this, where files is a string array of the file names and nfiles is the number of files in that array: im = mrdfits( files[0], 0, h, /silent) for i = 1, nfiles - 1, 1 do begin im += mrdfits(files[i], 0, h, /silent) endfor writefits,'outfile', im, h The caveat to this is that the header of the output file is the header of the last file only. Use something like file_search to create the files array. Chris
On Nov 6, 12:32 pm, Wox <s...@nomail.com> wrote: > On Thu, 6 Nov 2008 09:14:30 -0800 (PST), Griffons > > <griffon...@gmail.com> wrote: >> I downloaded readfits, writefits and the other files required. >> I am not sure what to do next. I compiled and ran readfits and >> writefits, but then what to do? > > files=['test1.fits','test2.fits',...] ; use e.g. file_search for this > sum = READFITS( files[0], /NOSCALE) > for i=1,n_elements(files)-1 do $ > sum += READFITS( files[i], /NOSCALE) > writefits, 'sum_filename', sum > > Both readfits and writefits depend on some other procedures from the > ASTRO library. Make sure you compiled them too. Thank you for your help. I compiled all the procedures related to readfits and writefits. When I run readfits, it gives this error: Attempt to call undefined procedure/function: 'READFITS'. Execution halted at: $MAIN$ As a result, the files cannot be read when they are called: files=['test1.fits','test2.fits',...] ; I tried files_search it does not work. writefits work when is run. What could I do?
On Nov 6, 12:35 pm, David Fanning <n...@dfanning.com> wrote: > Griffons writes: >> I downloaded readfits, writefits and the other files required. >> I am not sure what to do next. I compiled and ran readfits and >> writefits, but then what to do? > > Usually, the next step is to read the documentation headers. > > 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.") Thank you for your help. Griffons
On Nov 6, 12:53 pm, Christopher Thom <ct...@oddjob.uchicago.edu> wrote: > Quoth Wox: > >> On Thu, 6 Nov 2008 09:14:30 -0800 (PST), Griffons >> <griffon...@gmail.com> wrote: > >>> I downloaded readfits, writefits and the other files required. >>> I am not sure what to do next. I compiled and ran readfits and >>> writefits, but then what to do? > >> files=['test1.fits','test2.fits',...] ; use e.g. file_search for this >> sum = READFITS( files[0], /NOSCALE) >> for i=1,n_elements(files)-1 do $ >> sum += READFITS( files[i], /NOSCALE) >> writefits, 'sum_filename', sum > >> Both readfits and writefits depend on some other procedures from the >> ASTRO library. Make sure you compiled them too. > > And a minor point to add...be clear that you really want to specify the > /NOSCALE option. If the fits images have BSCALE and BZERO set in the > header, then you may want them scaled appropriately before summing... > > cheers > chris Thank you for your help Chris. Griffons
Griffons writes: > Thank you for your help. > I compiled all the procedures related to readfits and writefits. > When I run readfits, it gives this error: > Attempt to call undefined procedure/function: 'READFITS'. > Execution halted at: $MAIN$ > > As a result, the files cannot be read when they are called: > files=3D['test1.fits','test2.fits',...] ; I tried files_search it does > not work. > > writefits work when is run. > > What could I do? The next step is to read this article: http://www.catb.org/~esr/faqs/smart-questions.html Especially the part about "don't say program XXX doesn't work unless you are *absolutely* sure about it." 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.")
On Nov 6, 1:57 pm, David Fanning <n...@dfanning.com> wrote: > Griffons writes: >> Thank you for your help. >> I compiled all the procedures related to readfits and writefits. >> When I run readfits, it gives this error: >> Attempt to call undefined procedure/function: 'READFITS'. >> Execution halted at: $MAIN$ > >> As a result, the files cannot be read when they are called: >> files=3D['test1.fits','test2.fits',...] ; I tried files_search it does >> not work. > >> writefits work when is run. > >> What could I do? > > The next step is to read this article: > > http://www.catb.org/~esr/faqs/smart-questions.html > > Especially the part about "don't say program XXX doesn't > work unless you are *absolutely* sure about it." > > 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.") I compiled gettok, mrd_skip, strnumber, sxaddpar, sxdelpar, sxpar, valid_num, and readfits. They all worked. Then I run readfits and it does not work.
Griffons wrote: > On Nov 6, 1:57�pm, David Fanning <n...@dfanning.com> wrote: >> Griffons writes: >>> Thank you for your help. >>> I compiled all the procedures related to readfits and writefits. >>> When I run readfits, it gives this error: >>> Attempt to call undefined procedure/function: 'READFITS'. >>> Execution halted at: $MAIN$ >> >>> As a result, the files cannot be read when they are called: >>> files=3D['test1.fits','test2.fits',...] ; �I tried files_search it does >>> not work. >> >>> writefits work when is run. >> >>> What could I do? >> >> The next step is to read this article: >> >> � http://www.catb.org/~esr/faqs/smart-questions.html >> >> Especially the part about "don't say program XXX doesn't >> work unless you are *absolutely* sure about it." >> >> 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.") > > I compiled gettok, mrd_skip, strnumber, sxaddpar, sxdelpar, sxpar, > valid_num, and readfits. They all worked. Then I run readfits and it > does not work. How does it fail then? Paolo
On Nov 6, 2:35 pm, Paolo <pgri...@gmail.com> wrote: > Griffons wrote: >> On Nov 6, 1:57 pm, David Fanning <n...@dfanning.com> wrote: >>> Griffons writes: >>>> Thank you for your help. >>>> I compiled all the procedures related to readfits and writefits. >>>> When I run readfits, it gives this error: >>>> Attempt to call undefined procedure/function: 'READFITS'. >>>> Execution halted at: $MAIN$ > >>>> As a result, the files cannot be read when they are called: >>>> files=3D['test1.fits','test2.fits',...] ; I tried files_search it does >>>> not work. > >>>> writefits work when is run. > >>>> What could I do? > >>> The next step is to read this article: > >>> http://www.catb.org/~esr/faqs/smart-questions.html > >>> Especially the part about "don't say program XXX doesn't >>> work unless you are *absolutely* sure about it." > >>> 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.") > >> I compiled gettok, mrd_skip, strnumber, sxaddpar, sxdelpar, sxpar, >> valid_num, and readfits. They all worked. Then I run readfits and it >> does not work. > > How does it fail then? > > Paolo- Hide quoted text - > > - Show quoted text - Hello Paolo, how are you? Here is what I get as error message: It is not able to locate any of the files. I am not sure how to pick/ search for them. IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents \Data_Reduction\code\READFITS_code\readfits.pro" Compiled module: READFITS. IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents \Data_Reduction\code\READFITS_code\readfits.pro" Compiled module: READFITS. IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents \Data_Reduction\code\READFITS_code\strnumber.pro" Compiled module: STRNUMBER. IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents \Data_Reduction\code\READFITS_code\sxaddpar.pro" Compiled module: SXADDPAR. IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents \Data_Reduction\code\READFITS_code\sxdelpar.pro" Compiled module: SXDELPAR. IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents \Data_Reduction\code\READFITS_code\sxpar.pro" Compiled module: SXPAR. IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents \Data_Reduction\code\READFITS_code\tbget.pro" Compiled module: TBGET. IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents \Data_Reduction\code\READFITS_code\valid_num.pro" Compiled module: VALID_NUM. IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents \Data_Reduction\code\READFITS_code\ftget.pro" Compiled module: FTGET. IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents \Data_Reduction\code\READFITS_code\gettok.pro" Compiled module: GETTOK. IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents \Data_Reduction\code\READFITS_code\mrd_skip.pro" Compiled module: MRD_SKIP. IDL> files=['S_08189493.fit','S_08189494.fit','S_08189495.fit', 'S_08189496.fit'] ; IDL> sum = READFITS( files[0], /NOSCALE) READFITS: ERROR - Unable to locate file S_08189493.fit
On Nov 6, 9:38 am, Griffons <griffon...@gmail.com> wrote: > On Nov 6, 2:35 pm, Paolo <pgri...@gmail.com> wrote: > > > >> Griffons wrote: >>> On Nov 6, 1:57 pm, David Fanning <n...@dfanning.com> wrote: >>>> Griffons writes: >>>> > Thank you for your help. >>>> > I compiled all the procedures related to readfits and writefits. >>>> > When I run readfits, it gives this error: >>>> > Attempt to call undefined procedure/function: 'READFITS'. >>>> > Execution halted at: $MAIN$ > >>>> > As a result, the files cannot be read when they are called: >>>> > files=3D['test1.fits','test2.fits',...] ; I tried files_search it does >>>> > not work. > >>>> > writefits work when is run. > >>>> > What could I do? > >>>> The next step is to read this article: > >>>> http://www.catb.org/~esr/faqs/smart-questions.html > >>>> Especially the part about "don't say program XXX doesn't >>>> work unless you are *absolutely* sure about it." > >>>> 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.") > >>> I compiled gettok, mrd_skip, strnumber, sxaddpar, sxdelpar, sxpar, >>> valid_num, and readfits. They all worked. Then I run readfits and it >>> does not work. > >> How does it fail then? > >> Paolo- Hide quoted text - > >> - Show quoted text - > > Hello Paolo, > how are you? > > Here is what I get as error message: > It is not able to locate any of the files. I am not sure how to pick/ > search for them. > > IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents > \Data_Reduction\code\READFITS_code\readfits.pro" > Compiled module: READFITS. > IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents > \Data_Reduction\code\READFITS_code\readfits.pro" > Compiled module: READFITS. > IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents > \Data_Reduction\code\READFITS_code\strnumber.pro" > Compiled module: STRNUMBER. > IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents > \Data_Reduction\code\READFITS_code\sxaddpar.pro" > Compiled module: SXADDPAR. > IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents > \Data_Reduction\code\READFITS_code\sxdelpar.pro" > Compiled module: SXDELPAR. > IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents > \Data_Reduction\code\READFITS_code\sxpar.pro" > Compiled module: SXPAR. > IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents > \Data_Reduction\code\READFITS_code\tbget.pro" > Compiled module: TBGET. > IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents > \Data_Reduction\code\READFITS_code\valid_num.pro" > Compiled module: VALID_NUM. > IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents > \Data_Reduction\code\READFITS_code\ftget.pro" > Compiled module: FTGET. > IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents > \Data_Reduction\code\READFITS_code\gettok.pro" > Compiled module: GETTOK. > IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents > \Data_Reduction\code\READFITS_code\mrd_skip.pro" > Compiled module: MRD_SKIP. > IDL> files=['S_08189493.fit','S_08189494.fit','S_08189495.fit', > 'S_08189496.fit'] ; > IDL> sum = READFITS( files[0], /NOSCALE) > READFITS: ERROR - Unable to locate file S_08189493.fit It doesn't know where this file is - probably because it is in a folder IDL doesn't know about. IDL has a list of directories that it looks for whenever trying to read or run anything (this is also how you get around manually compiling all of these files -IDL automatically looks in these folders and will automatically compile the code it needs to if it can find it). I have an older version of IDL, but there should be something like edit->preferences in IDL. Then, find the tab called 'path', choose to add a new directory to the path, and then add in all of the folders where you keep IDL code or files you want IDL to read. Then, things should compile and read much more easily. Note, you should be able to check a box that searches in all of the subdirectories of a given folder as well. Once you set up these paths, go ahead and dump the ENTIRE IDL astro library in one of the folders in your path. Then, you never need to worry about compiling them again. chris
On Nov 6, 2:53 pm, Chris <beaum...@ifa.hawaii.edu> wrote: > On Nov 6, 9:38 am, Griffons <griffon...@gmail.com> wrote: > > > > > >> On Nov 6, 2:35 pm, Paolo <pgri...@gmail.com> wrote: > >>> Griffons wrote: >>>> On Nov 6, 1:57 pm, David Fanning <n...@dfanning.com> wrote: >>>> > Griffons writes: >>>> > > Thank you for your help. >>>> > > I compiled all the procedures related to readfits and writefits. >>>> > > When I run readfits, it gives this error: >>>> > > Attempt to call undefined procedure/function: 'READFITS'. >>>> > > Execution halted at: $MAIN$ > >>>> > > As a result, the files cannot be read when they are called: >>>> > > files=3D['test1.fits','test2.fits',...] ; I tried files_search it does >>>> > > not work. > >>>> > > writefits work when is run. > >>>> > > What could I do? > >>>> > The next step is to read this article: > >>>> >http://www.catb.org/~esr/faqs/smart-questions.html > >>>> > Especially the part about "don't say program XXX doesn't >>>> > work unless you are *absolutely* sure about it." > >>>> > 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.") > >>>> I compiled gettok, mrd_skip, strnumber, sxaddpar, sxdelpar, sxpar, >>>> valid_num, and readfits. They all worked. Then I run readfits and it >>>> does not work. > >>> How does it fail then? > >>> Paolo- Hide quoted text - > >>> - Show quoted text - > >> Hello Paolo, >> how are you? > >> Here is what I get as error message: >> It is not able to locate any of the files. I am not sure how to pick/ >> search for them. > >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\readfits.pro" >> Compiled module: READFITS. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\readfits.pro" >> Compiled module: READFITS. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\strnumber.pro" >> Compiled module: STRNUMBER. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\sxaddpar.pro" >> Compiled module: SXADDPAR. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\sxdelpar.pro" >> Compiled module: SXDELPAR. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\sxpar.pro" >> Compiled module: SXPAR. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\tbget.pro" >> Compiled module: TBGET. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\valid_num.pro" >> Compiled module: VALID_NUM. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\ftget.pro" >> Compiled module: FTGET. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\gettok.pro" >> Compiled module: GETTOK. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\mrd_skip.pro" >> Compiled module: MRD_SKIP. >> IDL> files=['S_08189493.fit','S_08189494.fit','S_08189495.fit', >> 'S_08189496.fit'] ; >> IDL> sum = READFITS( files[0], /NOSCALE) >> READFITS: ERROR - Unable to locate file S_08189493.fit > > It doesn't know where this file is - probably because it is in a > folder IDL doesn't know about. IDL has a list of directories that it > looks for whenever trying to read or run anything (this is also how > you get around manually compiling all of these files -IDL > automatically looks in these folders and will automatically compile > the code it needs to if it can find it). I have an older version of > IDL, but there should be something like edit->preferences in IDL. > Then, find the tab called 'path', choose to add a new directory to the > path, and then add in all of the folders where you keep IDL code or > files you want IDL to read. Then, things should compile and read much > more easily. Note, you should be able to check a box that searches in > all of the subdirectories of a given folder as well. > > Once you set up these paths, go ahead and dump the ENTIRE IDL astro > library in one of the folders in your path. Then, you never need to > worry about compiling them again. > > chris- Hide quoted text - > > - Show quoted text - Hi Chris, Thank you for your help. Griffons
On Nov 6, 2:50 pm, "R.G. Stockwell" <notha...@noemail.com> wrote: > "Griffons" <griffon...@gmail.com> wrote in message > > news:dd8c46c9-8ac9-435f-8822-b549d7ba118a@d10g2000pra.google groups.com... > ... > >> IDL> files=['S_08189493.fit','S_08189494.fit','S_08189495.fit', >> 'S_08189496.fit'] ; >> IDL> sum = READFITS( files[0], /NOSCALE) >> READFITS: ERROR - Unable to locate file S_08189493.fit > > well, if you don't know where your files are, how is > IDL supposed to know? > > This means that the file is not in your current directory. > Include the full path for the file, and it should work. > > Cheers, > bob Hi Bob, Thank you very much. It works now. Griffons
On Nov 6, 12:32 pm, Wox <s...@nomail.com> wrote: > On Thu, 6 Nov 2008 09:14:30 -0800 (PST), Griffons > > <griffon...@gmail.com> wrote: >> I downloaded readfits, writefits and the other files required. >> I am not sure what to do next. I compiled and ran readfits and >> writefits, but then what to do? > > files=['test1.fits','test2.fits',...] ; use e.g. file_search for this > sum = READFITS( files[0], /NOSCALE) > for i=1,n_elements(files)-1 do $ > sum += READFITS( files[i], /NOSCALE) > writefits, 'sum_filename', sum > > Both readfits and writefits depend on some other procedures from the > ASTRO library. Make sure you compiled them too. Hello Wox, Thank you very much for your help. It works well now. Griffons
I think you may have been confused by the posts about automatically locate files.... these are important for IDL source code, but when you are dealing with data, you have to spacifiy the full path. Normally I use something as file=dir+filename such that when I need to move the files somewhere else I only need to change the dir in one place. Ciao, Paolo Griffons wrote: > On Nov 6, 2:35�pm, Paolo <pgri...@gmail.com> wrote: >> Griffons wrote: >>> On Nov 6, 1:57 pm, David Fanning <n...@dfanning.com> wrote: >>>> Griffons writes: >>>> > Thank you for your help. >>>> > I compiled all the procedures related to readfits and writefits. >>>> > When I run readfits, it gives this error: >>>> > Attempt to call undefined procedure/function: 'READFITS'. >>>> > Execution halted at: $MAIN$ >> >>>> > As a result, the files cannot be read when they are called: >>>> > files=3D['test1.fits','test2.fits',...] ; I tried files_search it does >>>> > not work. >> >>>> > writefits work when is run. >> >>>> > What could I do? >> >>>> The next step is to read this article: >> >>>> http://www.catb.org/~esr/faqs/smart-questions.html >> >>>> Especially the part about "don't say program XXX doesn't >>>> work unless you are *absolutely* sure about it." >> >>>> 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.") >> >>> I compiled gettok, mrd_skip, strnumber, sxaddpar, sxdelpar, sxpar, >>> valid_num, and readfits. �They all worked. Then I run readfits and it >>> does not work. >> >> How does it fail then? >> >> Paolo- Hide quoted text - >> >> - Show quoted text - > > Hello Paolo, > how are you? > > Here is what I get as error message: > It is not able to locate any of the files. I am not sure how to pick/ > search for them. > > > IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents > \Data_Reduction\code\READFITS_code\readfits.pro" > Compiled module: READFITS. > IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents > \Data_Reduction\code\READFITS_code\readfits.pro" > Compiled module: READFITS. > IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents > \Data_Reduction\code\READFITS_code\strnumber.pro" > Compiled module: STRNUMBER. > IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents > \Data_Reduction\code\READFITS_code\sxaddpar.pro" > Compiled module: SXADDPAR. > IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents > \Data_Reduction\code\READFITS_code\sxdelpar.pro" > Compiled module: SXDELPAR. > IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents > \Data_Reduction\code\READFITS_code\sxpar.pro" > Compiled module: SXPAR. > IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents > \Data_Reduction\code\READFITS_code\tbget.pro" > Compiled module: TBGET. > IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents > \Data_Reduction\code\READFITS_code\valid_num.pro" > Compiled module: VALID_NUM. > IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents > \Data_Reduction\code\READFITS_code\ftget.pro" > Compiled module: FTGET. > IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents > \Data_Reduction\code\READFITS_code\gettok.pro" > Compiled module: GETTOK. > IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents > \Data_Reduction\code\READFITS_code\mrd_skip.pro" > Compiled module: MRD_SKIP. > IDL> files=['S_08189493.fit','S_08189494.fit','S_08189495.fit', > 'S_08189496.fit'] ; > IDL> sum = READFITS( files[0], /NOSCALE) > READFITS: ERROR - Unable to locate file S_08189493.fit
On Nov 6, 3:16 pm, Paolo <pgri...@gmail.com> wrote: > I think you may have been confused by the posts > about automatically locate files.... these are important for > IDL source code, but when you are dealing with data, > you have to spacifiy the full path. > > Normally I use something as > file=dir+filename > such that when I need to move the files somewhere else > I only need to change the dir in one place. > > Ciao, > Paolo > > > > Griffons wrote: >> On Nov 6, 2:35 pm, Paolo <pgri...@gmail.com> wrote: >>> Griffons wrote: >>>> On Nov 6, 1:57 pm, David Fanning <n...@dfanning.com> wrote: >>>> > Griffons writes: >>>> > > Thank you for your help. >>>> > > I compiled all the procedures related to readfits and writefits. >>>> > > When I run readfits, it gives this error: >>>> > > Attempt to call undefined procedure/function: 'READFITS'. >>>> > > Execution halted at: $MAIN$ > >>>> > > As a result, the files cannot be read when they are called: >>>> > > files=3D['test1.fits','test2.fits',...] ; I tried files_search it does >>>> > > not work. > >>>> > > writefits work when is run. > >>>> > > What could I do? > >>>> > The next step is to read this article: > >>>> >http://www.catb.org/~esr/faqs/smart-questions.html > >>>> > Especially the part about "don't say program XXX doesn't >>>> > work unless you are *absolutely* sure about it." > >>>> > 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.") > >>>> I compiled gettok, mrd_skip, strnumber, sxaddpar, sxdelpar, sxpar, >>>> valid_num, and readfits. They all worked. Then I run readfits and it >>>> does not work. > >>> How does it fail then? > >>> Paolo- Hide quoted text - > >>> - Show quoted text - > >> Hello Paolo, >> how are you? > >> Here is what I get as error message: >> It is not able to locate any of the files. I am not sure how to pick/ >> search for them. > >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\readfits.pro" >> Compiled module: READFITS. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\readfits.pro" >> Compiled module: READFITS. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\strnumber.pro" >> Compiled module: STRNUMBER. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\sxaddpar.pro" >> Compiled module: SXADDPAR. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\sxdelpar.pro" >> Compiled module: SXDELPAR. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\sxpar.pro" >> Compiled module: SXPAR. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\tbget.pro" >> Compiled module: TBGET. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\valid_num.pro" >> Compiled module: VALID_NUM. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\ftget.pro" >> Compiled module: FTGET. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\gettok.pro" >> Compiled module: GETTOK. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\mrd_skip.pro" >> Compiled module: MRD_SKIP. >> IDL> files=['S_08189493.fit','S_08189494.fit','S_08189495.fit', >> 'S_08189496.fit'] ; >> IDL> sum = READFITS( files[0], /NOSCALE) >> READFITS: ERROR - Unable to locate file S_08189493.fit- Hide quoted text - > > - Show quoted text - Hello Paolo, Thank you for your help. Griffons
> Hello Paolo, > > Thank you for your help. I think that as a general rule, it is best to just thank everybody in one post at the end of the thread instead of posting 5 different thank messages ;-) Ciao, Paolo > > Griffons
On 6 nov, 14:53, Chris <beaum...@ifa.hawaii.edu> wrote: > On Nov 6, 9:38 am, Griffons <griffon...@gmail.com> wrote: > > > > > >> On Nov 6, 2:35 pm, Paolo <pgri...@gmail.com> wrote: > >>> Griffons wrote: >>>> On Nov 6, 1:57 pm, David Fanning <n...@dfanning.com> wrote: >>>> > Griffons writes: >>>> > > Thank you for your help. >>>> > > I compiled all the procedures related to readfits and writefits. >>>> > > When I run readfits, it gives this error: >>>> > > Attempt to call undefined procedure/function: 'READFITS'. >>>> > > Execution halted at: $MAIN$ > >>>> > > As a result, the files cannot be read when they are called: >>>> > > files=3D['test1.fits','test2.fits',...] ; I tried files_search it does >>>> > > not work. > >>>> > > writefits work when is run. > >>>> > > What could I do? > >>>> > The next step is to read this article: > >>>> >http://www.catb.org/~esr/faqs/smart-questions.html > >>>> > Especially the part about "don't say program XXX doesn't >>>> > work unless you are *absolutely* sure about it." > >>>> > 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.") > >>>> I compiled gettok, mrd_skip, strnumber, sxaddpar, sxdelpar, sxpar, >>>> valid_num, and readfits. They all worked. Then I run readfits and it >>>> does not work. > >>> How does it fail then? > >>> Paolo- Hide quoted text - > >>> - Show quoted text - > >> Hello Paolo, >> how are you? > >> Here is what I get as error message: >> It is not able to locate any of the files. I am not sure how to pick/ >> search for them. > >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\readfits.pro" >> Compiled module: READFITS. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\readfits.pro" >> Compiled module: READFITS. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\strnumber.pro" >> Compiled module: STRNUMBER. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\sxaddpar.pro" >> Compiled module: SXADDPAR. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\sxdelpar.pro" >> Compiled module: SXDELPAR. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\sxpar.pro" >> Compiled module: SXPAR. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\tbget.pro" >> Compiled module: TBGET. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\valid_num.pro" >> Compiled module: VALID_NUM. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\ftget.pro" >> Compiled module: FTGET. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\gettok.pro" >> Compiled module: GETTOK. >> IDL> .COMPILE "C:\Documents and Settings\Owner\My Documents >> \Data_Reduction\code\READFITS_code\mrd_skip.pro" >> Compiled module: MRD_SKIP. >> IDL> files=['S_08189493.fit','S_08189494.fit','S_08189495.fit', >> 'S_08189496.fit'] ; >> IDL> sum = READFITS( files[0], /NOSCALE) >> READFITS: ERROR - Unable to locate file S_08189493.fit > > It doesn't know where this file is - probably because it is in a > folder IDL doesn't know about. IDL has a list of directories that it > looks for whenever trying to read or run anything (this is also how > you get around manually compiling all of these files -IDL > automatically looks in these folders and will automatically compile > the code it needs to if it can find it). I have an older version of > IDL, but there should be something like edit->preferences in IDL. > Then, find the tab called 'path', choose to add a new directory to the > path, and then add in all of the folders where you keep IDL code or > files you want IDL to read. Then, things should compile and read much > more easily. Note, you should be able to check a box that searches in > all of the subdirectories of a given folder as well. > > Once you set up these paths, go ahead and dump the ENTIRE IDL astro > library in one of the folders in your path. Then, you never need to > worry about compiling them again. > > chris- Ocultar texto de la cita - > > - Mostrar texto de la cita - Hello Chris, How do you reverse the process you told me about? Thank you. Griffons