Why me Lord?
douglas brenner wrote on Sep 25, 2009
In two scripts- one not used in days, one after many successful executions- fscan no longer reads whole lines from a file. It first seems to read the file's directory and then seems to treat _ as an end of line.
Mike Fitzpatrick wrote on Sep 25, 2009
If you seriously want a reply to this, please post something useful like the script, input file or comments on what you've changed since it last worked. IRAF can do lots of things, but theories that it can spontaneously gain conciousness to rewrite its own code and torture a specific user should be addressed by trained mental health professionals 8-)
douglas brenner wrote on Sep 25, 2009
I do believe that iraf is alive. I sent you the code but it managed to prevent from arriving.
Here it is again
procedure SR2 (object , date, deltaslice)
string object, date
struct *flist
int deltaslice
begin
struct line
string home, obj, day, filelist, image, cleaned, cleaning, imgshorter , targetimage, imglonger , output, targeting, dim, annulus, formula
int tmp
int k, cube, dslice, m, ring
real factor[8,44], start, stop, i, min
real r, c, rmin, cmin, imin, startr, stopr, rfactor[8,44], cfactor[8,44], startc, stopc
real stddev, mn, med
obj = object
day = date
home = "/data/processed/"//obj//"/"//day//"/"//"series/"
annulus = "/data/masks/ring.fits"
dslice = deltaslice
dim = str(250)//","//str(250)
cd (home)
if ( !access("filelist.lis") )
!ls *.fits > "filelist.lis"
cleaning = home//"cleaning"
cleaned = home//"cleaned"
if (!access(cleaning))
mkdir (cleaning)
if (!access(cleaned))
mkdir (cleaned)
filelist = home//"filelist.lis"
flist = filelist
cd (cleaning)
output = cleaned//"/result.fits"
cube = 0
m = 0
imcopy (input = "/data/masks/zero.fits", output = output//"[0,overwrite]")
#print (line)
while (fscan (flist, line) != EOF)
{
cube += 1
delete "*.fits"
*****FAILS HERE ******
line = home//line
print ("file: ", line)
DIDN"T READ THE LINE.
file: /data/processed/ALCOR/2009-03-16/series//data/processed/ALCOR/2009-03-16/series/
Warning: Cannot open image (/data/processed/ALCOR/2009-03-16/seriesdata/processed/ALCOR/2009-03-16/series/)
fscan is no longer reads the list.
If I terminate the script here with
} end
I get this
/data/masks/zero.fits -> /data/processed/ALCOR/2009-03-16/series/cleaned/result.fits[0,overwrite]
file: /data/processed/ALCOR/2009-03-16/series//data/processed/ALCOR/2009-03-16/series/
file: /data/processed/ALCOR/2009-03-16/series/ALCOR
file: /data/processed/ALCOR/2009-03-16/series/2009-03-16
file: /data/processed/ALCOR/2009-03-16/series//data/processed/ALCOR/2009-03-16/series/filelist.lis
Here is a portion of filelist.lis
ALCOR_O_2009-03-16_300_f004.fits
ALCOR_O_2009-03-16_300_f005.fits
ALCOR_O_2009-03-16_300_f006.fits
ALCOR_O_2009-03-16_300_f007.fits
ALCOR_O_2009-03-16_300_f008.fits
Here it is again
procedure SR2 (object , date, deltaslice)
string object, date
struct *flist
int deltaslice
begin
struct line
string home, obj, day, filelist, image, cleaned, cleaning, imgshorter , targetimage, imglonger , output, targeting, dim, annulus, formula
int tmp
int k, cube, dslice, m, ring
real factor[8,44], start, stop, i, min
real r, c, rmin, cmin, imin, startr, stopr, rfactor[8,44], cfactor[8,44], startc, stopc
real stddev, mn, med
obj = object
day = date
home = "/data/processed/"//obj//"/"//day//"/"//"series/"
annulus = "/data/masks/ring.fits"
dslice = deltaslice
dim = str(250)//","//str(250)
cd (home)
if ( !access("filelist.lis") )
!ls *.fits > "filelist.lis"
cleaning = home//"cleaning"
cleaned = home//"cleaned"
if (!access(cleaning))
mkdir (cleaning)
if (!access(cleaned))
mkdir (cleaned)
filelist = home//"filelist.lis"
flist = filelist
cd (cleaning)
output = cleaned//"/result.fits"
cube = 0
m = 0
imcopy (input = "/data/masks/zero.fits", output = output//"[0,overwrite]")
#print (line)
while (fscan (flist, line) != EOF)
{
cube += 1
delete "*.fits"
*****FAILS HERE ******
line = home//line
print ("file: ", line)
DIDN"T READ THE LINE.
file: /data/processed/ALCOR/2009-03-16/series//data/processed/ALCOR/2009-03-16/series/
Warning: Cannot open image (/data/processed/ALCOR/2009-03-16/seriesdata/processed/ALCOR/2009-03-16/series/)
fscan is no longer reads the list.
If I terminate the script here with
} end
I get this
/data/masks/zero.fits -> /data/processed/ALCOR/2009-03-16/series/cleaned/result.fits[0,overwrite]
file: /data/processed/ALCOR/2009-03-16/series//data/processed/ALCOR/2009-03-16/series/
file: /data/processed/ALCOR/2009-03-16/series/ALCOR
file: /data/processed/ALCOR/2009-03-16/series/2009-03-16
file: /data/processed/ALCOR/2009-03-16/series//data/processed/ALCOR/2009-03-16/series/filelist.lis
Here is a portion of filelist.lis
ALCOR_O_2009-03-16_300_f004.fits
ALCOR_O_2009-03-16_300_f005.fits
ALCOR_O_2009-03-16_300_f006.fits
ALCOR_O_2009-03-16_300_f007.fits
ALCOR_O_2009-03-16_300_f008.fits
douglas brenner wrote on Sep 25, 2009
thanks.
Last post on Sep 25, 2009