Welcome to iraf.net Saturday, April 20 2024 @ 09:11 AM GMT


 Forum Index > Help Desk > Applications New Topic Post Reply
 Problem with hselect?
   
massey
 02/10/2006 06:40PM (Read 8573 times)  
+++++
Active Member

Status: offline


Registered: 02/10/2006
Posts: 162
We think we may have found a bug in HSELECT's string comparison operator "?=" .Consider the following:cl> hselect *.fit $I,i_title yes
img01.fit Tr14
img02.fit Tr14
img03.fit Tr14
img04.fit Tr16
img05.fit Tr16
img06.fit Tr16
img07.fit NGC3603
img08.fit NGC3603
img09.fit NGC3602
img10.fit NGC3602
cl>
cl> hselect *.fit $I,i_title "(i_title ?= '*16*')"
img01.fit Tr14 ***** wrong
img02.fit Tr14 ***** wrong
img03.fit Tr14 ***** wrong
img04.fit Tr16
img05.fit Tr16
img06.fit Tr16
cl>
cl> hselect *.fit $I,i_title "(i_title ?= '*03*')"
img07.fit NGC3603
img08.fit NGC3603
img09.fit NGC3602 ***** wrong
img10.fit NGC3602 ***** wrong
The substring comparison (as detailed in the HEDIT help page) is only
comparing the first character of the substring, and not the whole substring.

 
Profile Email Website
 Quote
fitz
 02/10/2006 06:40PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Hi Phil,[quote:0ba4247782]We think we may have found a bug in HSELECT's string comparison operator "?=" [/quote:0ba4247782] Actually, you found something like 4 bugs. The problem is first that the pattern matching buffer wasn't properly initialized and the second is that the wrong buffer was being used to create the pattern. This affects both the evexpr [b:0ba4247782]and[/b:0ba4247782] evvexpr expression code (2bug times 2 files = 4).Since the '?=' operator basically already does a substring search the workaround is to simply remove the '*' from both sides of your string and you should get the proper headers. The code change is trivial but requires a recompile of the system. Email if you want the change but otherwise it'll be fixed in the next release (i.e. the upcoming intel port).-Mike

 
Profile Email
 Quote
sebastian
 02/10/2006 06:40PM  
+++--
Chatty

Status: offline


Registered: 03/20/2007
Posts: 45
Hi! I'm having strange issues with hselect.
Consider the followng:[code:1:05e060a697]hselect("Zy*%.fits%%","$I","(filterid='"//filt//"' &&((i_title ?='SKY')||(i_title ?='Sky')||(i_title ?='sky')||(i_title ?='even')||(i_title ?= 'twi')||(i_title ?='Twi')||(i_title ?='morn')))",>"skys")[/code:1:05e060a697]
This seems to work, extracted from a script of Massey (y4kflat)
Now, I'm trying to use
[code:1:05e060a697]hselect("@lista", "$I","(IMAGETYP ='zero' && (lectura = '100khz') )" , > 'bias_list')
hselect("@lista","$I","(IMAGETYP ='object'&& (lectura='100khz' ))" , > 'object_list')
hselect("@lista","$I","(IMAGETYP ='flat'&& (lectura = '100khz' ))", > 'domeflat_list')
hselect("@lista","$I","(IMAGETYP ='skyflat' && (lectura='100khz')) ", > 'skyflat_list')[/code:1:05e060a697]
and what I get is:ERROR: Image header parameter not found (lectura)
"hselect("@lista", "$I","(IMAGETYP ='zero' && (lectura = '100khz') ) ..."
line 8: select.cl
called as: `select ()'And the bias_list file is written with the correct images on it. So it "works".
the field lectura (frecuency reading format, related to readout noise) is present in all images.
Suggestions?Thanks in advance
Seba

 
Profile Email
 Quote
fitz
 02/10/2006 06:40PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Try using the string comparison operator '?=' instead of just '='. Can you run hselect to select just on the lectura keyword, i.e. [code:1:6a93f03b61]hselect @list $I "lectura ?= '100khz'"[/code:1:6a93f03b61]-Mike

 
Profile Email
 Quote
sebastian
 02/10/2006 06:40PM  
+++--
Chatty

Status: offline


Registered: 03/20/2007
Posts: 45
Sure, I will filter images in two steps, I was trying to select them using one single hselect sentence.
I wil try the ?= operator instead.
Thank you
seba

 
Profile Email
 Quote
sebastian
 02/10/2006 06:40PM  
+++--
Chatty

Status: offline


Registered: 03/20/2007
Posts: 45
I'm afraid that I must keep asking about this,
[code:1:0470a723dc]
hselect("*.fit","$I"," BIN ?=1", > "bin_lista1")
[/code:1:0470a723dc]
returns:
ERROR: Image header parameter not found (BIN)
"hselect("*.fit","$I"," BIN ?=2", > "bin_lista2")"
line 126: hedit_casleo_K.cl
called as: `hedit_casleo_K ()'with a correct list of images but it stops,
BUT:
[code:1:0470a723dc]
hselect("*.fit","$I, BIN ?=1", > "bin_lista1")
[/code:1:0470a723dc]
returns all the images, not filtering them by bin factor with no "ERROR" output. So it doesn't work
Bin is defined as an integer in my cl scriptAn extract from the image header looks like:Biask3.fit[1340,1310][short]:
No bad pixels, min=0., max=0. (old)
Line storage mode, physdim [1340,1310], length of user area 1215 s.u.
Created Sun 18:45:43 05-Apr-2009, Last modified Sun 18:55:26 05-Apr-2009
Pixel file "Biask3.fit" [ok]
EXTEND = F / File may contain extensions
ORIGIN = 'NOAO-IRAF FITS Image Kernel July 2003' / FITS file originator
DATE = '2009-04-05T20:45:43' / Date FITS file was generated
IRAF-TLM= '18:55:26 (05/04/2009)' / Time of last modification
EXPTIME = 0.00 / exposure time - seconds
OBSERVAT= 'CASLEO ' / observatory
DATE-OBS= '2009-04-04 ' / date (yyyy-mm-dd) of obs.
UT = 21:33:26 / universal time
ST = 05:53:08 / sidereal time
HA = +00:00:00 / hour angle
RA = 05:53:08 / right ascension
DEC = -31:47:57 / declination
EPOCH = 2000 / epoch of ra and dec
ZD = 0.0 / zenith distance
AIRMASS = 1.0 / airmass
IMAGETYP= 'zero ' / object, dark, zero, etc.
INSTRUME= 'Direct CCD '
OBSERVER= 'Tancredi '
COMMENT = 'CCD Roper , sin R Focal, rueda de filtros con V y R '
COMMENT = ' '
FILTER01= '(3) V ' / Filter wheel No.1 (Lower)
FILTER02= '(2) Libre ' / Filter wheel No.2 (Upper)
LECTURA = '100khz '
BIN = 1thank you 'again' in advance
seba

 
Profile Email
 Quote
fitz
 02/10/2006 06:40PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
The '?=' is a string comparison, if BIN is an integer you should be using simply the '=' comparison. Also, your message had a space before the keyword, was that a typo or does something else happen if you don't include the space?-Mike

 
Profile Email
 Quote
sebastian
 02/10/2006 06:40PM  
+++--
Chatty

Status: offline


Registered: 03/20/2007
Posts: 45
well, I keep trying
[code:1:b64b451889]
hselect("*.fit","$I,BIN=1", > "bin_lista1")
[/code:1:b64b451889]"spits" every single image[code:1:b64b451889]
hselect("*.fit","$I","BIN=1", > "bin_lista1")
[/code:1:b64b451889]
"spits" the right ones but with "ERROR".It space before the keyword was a mistake.

 
Profile Email
 Quote
fitz
 02/10/2006 06:40PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Does *every* image have a BIN/LECTURA keyword? What I'm thinking is that you're getting the right list because those images have the keywords with the proper value, but you're getting the error message from those image that don't have the keyword at all.For an image you know should work, run the command on a single image. If the input list is "*.fit" and you get errors then that is a clue and we should look at how '*.fit' expands into a list of files and which of those images is causing the problem.-Mike

 
Profile Email
 Quote
sebastian
 02/10/2006 06:40PM  
+++--
Chatty

Status: offline


Registered: 03/20/2007
Posts: 45
I'm sorry that it took me some days to wirte back. I've got sick and today I started working again. Yes, there was a problem with the keywords not being present at all imagens. (actually just one of them got the missing keywords, one in 500)
Now it works properly.
Thank you.
sebastian

 
Profile Email
 Quote
   
Content generated in: 0.33 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