Welcome to iraf.net Monday, May 20 2024 @ 11:57 PM GMT


 Forum Index > Help Desk > Applications New Topic Post Reply
 hedit/hselect boolean query on imagetyp field
   
rbroberts
 09/28/2006 03:11AM (Read 4948 times)  
++---
Junior

Status: offline


Registered: 09/26/2006
Posts: 18
I'm stuck trying to select a set of images based on imagetyp which need to have their imagetyp changed. I've tried about every permutation of comparison I can think of but consistently get this error in every case:[code:1:2373794b8e]ERROR: Impossible type conversion when accessing image header parameter (imagetype)
[/code:1:2373794b8e]I've tried[code:1:2373794b8e]hselect 0*.fit $I "imagetyp ?= '*DARK*'"
hselect 0*.fit $I "imagetyp == DARK"
hselect 0*.fit $I "imagetyp ?= DARK"
hselect 0*.fit $I "imagetyp = DARK"
hselect 0*.fit $I "imagetyp == 'DARK'"
[/code:1:2373794b8e]and probably some others. The actual field in the headers reads[code:1:2373794b8e]IMAGETYP = DARK[/code:1:2373794b8e]Can someone give me a clue on how to select these?

Roland B. Roberts, PhD RL Enterprises Brooklyn, NY
 
Profile Email Website
 Quote
fitz
 09/28/2006 03:11AM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Try[code:1:ec8170e90b]hselect *.fits $I "imagetyp ?= 'DARK'"[/code:1:ec8170e90b]The '?=' is the string-equality operator and the value needs to be in a single quote.-Mike

 
Profile Email
 Quote
rbroberts
 09/28/2006 03:11AM  
++---
Junior

Status: offline


Registered: 09/26/2006
Posts: 18
How is that different from my first example which should have matched anything with DARK in it? It gives the same error, as does the one you suggest. I'm baffled....NB: I also realized I mistyped some of the examples, which I have now corrected; they said "imagetype" instead of "imagetyp".regards,roland

Roland B. Roberts, PhD RL Enterprises Brooklyn, NY
 
Profile Email Website
 Quote
fitz
 09/28/2006 03:11AM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
[quote:0aa0b9c45c]How is that different from my first example which should have matched anything with DARK in it? It gives the same error, as does the one you suggest. I'm baffled.... [/quote:0aa0b9c45c]
The answer is in how you listed the value of the IMAGETYP keyword itself, i.e.[code:1:0aa0b9c45c]IMAGETYP = DARK[/code:1:0aa0b9c45c]The DARK is meant to be a string value and should be in quotes, i.e.[code:1:0aa0b9c45c]IMAGETYPE = 'DARK'[/code:1:0aa0b9c45c]In that case your first example would have worked.-Mike

 
Profile Email
 Quote
rbroberts
 09/28/2006 03:11AM  
++---
Junior

Status: offline


Registered: 09/26/2006
Posts: 18
Hmm, okay, so that creates a bit of a problem. If they should have said 'DARK', how can I select them to change them to say 'DARK'?

Roland B. Roberts, PhD RL Enterprises Brooklyn, NY
 
Profile Email Website
 Quote
fitz
 09/28/2006 03:11AM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
You can use the HFIX task to run an arbitrary command over all the image headers and edit only those that match "DARK", e.g.[code:1:52b84a4d4b]
hfix *.fits command="!cat $fname | sed -e \"s/DARK/\\'DARK\\'/g\" > _z ; mv _z $fname"[/code:1:52b84a4d4b]The various backslashes are escapes needed for the quotes, but basically you're using 'sed' to edit the headers.-Mike

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