Welcome to iraf.net Friday, March 29 2024 @ 10:38 AM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 How to specify FITS extension for apall within script?
   
jsb3r
 09/29/2015 04:29PM (Read 2962 times)  
+----
Newbie

Status: offline


Registered: 10/19/2008
Posts: 5
I'm having trouble getting a script to specify the fits extension for apall within a huge ECHELLE reduction package. Below is the error I keep getting.

***************************************************************
Resampling the spectrum by a factor of 4 in the y direction...

DQTaue.0128.fits
Magnify image DQTaue.0128.fits to image DQTaue.0128.fits.
Interpolation is spline3.
Boundary extension is nearest.
Output coordinates in terms of input coordinates:
x1 = 1., x2 = 2048., dx = 1.
y1 = 1., y2 = 2048., dy = 0.25
Removing scattered inter-order light from the spectrum...
Extracting the spectrum to one dimension...
Big GrinQTaue.0128.fits[0]:
Warning: FXF: must specify which FITS extension (DQTaue.0128)
Resampling the spectrum by a factor of 4 in the y direction...
**************************************************************
Below is the portion of the script that is calling that apall that seems to not be able to find the extension. Note that I have added the line
s1=s1//"[0]" to try to specify the extension. While that definitely adds the [0] to the .fits file from the output included above, it still doesn't seem to solve my problem. I'm at a loss as to how to proceed. Everything else in the procedure seems to working just fine.

Thanks,

Jeff

*************************************************************
PHP Formatted Code
list = "all.list"
while (fscan (list,s1) !=EOF) {
print "Resampling the spectrum by a factor of 4 in the y direction..."

magnify(input=s1,output=s1,xmag=1.,ymag=4.,x1=INDEF,x2=INDEF,dx=INDEF,y1=INDEF,y2=INDEF,dy=INDEF,interpolatio="spline3",boundary="nearest",constant=0.,fluxconserve=yes,logfile="STDOUT",mode="ql")

print "Removing scattered inter-order light from the spectrum..."
s2="noscat"//s1

imcopy(input=s1,output=s2,verbose=no,mode="ql")
#imdelete(images=s1,verify=no,default_acti=yes,mode="ql")

apscatter input=(s2) output=(s1) apertures="" scatter="" references=magnified_flat interactive=no find=no recent=yes resize=yes edit=no trace=no fittrace=no subtract=yes smooth=yes fitscatter=yes fitsmooth=yes line=INDEF nsum=-10

imdelete(images=s2,verify=no,default_acti=yes,mode="ql")

s1=s1//"[0]"

 print "Extracting the spectrum to one dimension..."
 print (":"//s1//":")

apall input=(s1) nfind=1 output="" apertures="" format="echelle" references=magnified_flat profiles="" interac=no find=no recenter=yes resize=yes edit=no trace=no fittrace=no extract=yes extras=no review=yes line=INDEF nsum=10 lower=-2. upper=2. apidtable="" b_funct="chebyshev" b_order=1 b_sample="-6:-3,3:6" b_naverage=1 b_niterate=0 b_low_reject=3. b_high_rejec=3. b_grow=0. width=12 radius=16 threshold=0. minsep=5. maxsep=1000. order="increasing" aprecenter="" npeaks=INDEF shift=no llimit=INDEF ulimit=INDEF ylevel=0.05 peak=yes bkg=yes r_grow=0. avglimits=no t_nsum=10 t_step=10 t_nlost=3 t_function="legendre" t_order=5 t_sample="200:1850,*" t_naverage=3 t_niterate=3 t_low_reject=3. t_high_reject=3. t_grow=0. background="none" skybox=1 weights="none" pfit="fit1d" clean=no saturation=INDEF readnoise="0." gain="1." lsigma=4. usigma=4. nsubaps=1 mode="ql"

}

***************************************************************************************

 
Profile Email
 Quote
fitz
 09/29/2015 04:48PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040

Two things to check: If this really is a problem with extension syntax then you might try

cl\$this->_split2($m[0]) reset use_new_imt = no

before you run your script, and assuming this is a v2.16 system. This will bypass the new image template code and use the old version and is know to work around some issues.

Second, I notice you are recycling the 's1' name in your call to APSCATTER, is this really adding an extension to the file or simply overwriting it? If the latter then you shouldn't need to use an extension number at all. What was the original error message before you added the '[0]' explicitly? Is there really an image in the zero extension of the file?

 
Profile Email
 Quote
jsb3r
 09/29/2015 06:33PM  
+----
Newbie

Status: offline


Registered: 10/19/2008
Posts: 5
I just tried the first suggestion, running the reset command. I also commented out the sentence I added to force the addition of the extension. I thought that might work, since this is a pretty well tested script for APO ECHELLE data. However, I received the same FITS extension error. I'm not certain if the error is coming from the input or the output.
*****
Resampling the spectrum by a factor of 4 in the y direction...

DQTaue.0128.fits
Magnify image DQTaue.0128.fits to image DQTaue.0128.fits.
Interpolation is spline3.
Boundary extension is nearest.
Output coordinates in terms of input coordinates:
x1 = 1., x2 = 2048., dx = 1.
y1 = 1., y2 = 2048., dy = 0.25
Removing scattered inter-order light from the spectrum...
Extracting the spectrum to one dimension...
Big GrinQTaue.0128.fits:
Warning: FXF: must specify which FITS extension (DQTaue.0128)
****

Per your second question, I ran the script a few times before I added the s1 = s1//"[0]" statement trying to force the issue. Yes, there is a 1D spectrum in the [0] extension. There are also a few apertures present. Would it make sense to use a different list for the output than s1?

That was going to be my next attempt.

Thanks,

Jeff

 
Profile Email
 Quote
fitz
 09/29/2015 06:47PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Is there a reason you have parentheses around the 's1' in the APALL call?

Also, are you sure you're not confusing extensions with image sections? I'm not aware of APSCATTER creating FITS extensions, but if it's producing a 2-D or 3-D image you need to specify an image section (e.g. "[1,*]" for the first row a 2-D image or "[*,*,1]" for the first plane of a 3-D image). The error is complaining about the input image name.

 
Profile Email
 Quote
jsb3r
 09/29/2015 08:17PM  
+----
Newbie

Status: offline


Registered: 10/19/2008
Posts: 5
My understanding of the parentheses around the (s1) is that it means it holds a filename. If there are no parentheses then it will look for file s1.

I gather that from doing a "print s1" and then a "print (s1)".

If APSCATTER doesn't create fits extensions there shouldn't be a problem with apall reading in the image. This makes sense to me since apall is the procedure that will extract the 1D spectra.

So I am at a loss as to what the ERROR is really telling me.

(I tried removing the parentheses and running the script. apall looks for a file called s1, which I think means it is behaving the way that I thought it would.)

Any other thoughts?

Thanks,

Jeff

 
Profile Email
 Quote
   
Content generated in: 0.21 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login