I want to use hselect to parse out all images of a given filter.. the relevant header keyword used in these images is FILTER but unfortunately the value assigned to this keyword has an apostrophe as in:
FILTER = u'
FILTER = g'
FILTER = i'
etc.
so when I use what would be the correct command to parse out the images with u filter, the apostrophe creates an error. - command is:
Code:
hselect @list.txt $I "(FILTER ?= 'r'')"
error returned is:
Quote:
ERROR: missing closing quote in string constant
is there an escape character that can be used to get hselect to recognise the apostrophe?
Assuming the apostrophe is done properly in the header (i.e. that a value like "O'Hara" is written as "O''Hara"), the you can use either the same double-apostrophe trick or a '\' to escape the value. For example
Joined: 10 Oct 2010 Posts: 33 Location: Galway Ireland
Posted: Sat Jul 23, 2011 7:15 pm Post subject:
thanks for your reply - although I realise now that it is not necessary to include the apostrophe....simply:
Code:
hselect @list.txt $I "(FILTER ?= 'r')"
is sufficient to parse out all images with:
[QOUTE]
FILTER = r'
[/QOUTE]
But the problem that was causing this in the first place is that some images in list.txt do not have the keyword FILTER and so when hselect encounters one of these images it returns the error:
Quote:
ERROR: Image header parameter not found (FILTER)
hedit is obviously the task to do remedy this but I am having trouble getting to grips with what each of its parameters actually does..
for example I thought the following command would add a keyword value FILTER with dummy value X to any image who's header currently does not contain the keyword FILTER:
however, the output returned suggested that not only did hselect add keyword FILTER with value X to images that currently did not have that keyword but it also changed the keyword value for all other images that already had the keyword FILTER, here is a sample of the output returned to me:
Quote:
.........
DATE/nov21/full_moon_033.fit,FILTER: u' -> X
add DATE/nov21/bias_001.fit,FILTER = X
add DATE/nov21/bias_050.fit,FILTER = X
DATE/nov21/full_moon_083.fit,FILTER: u' -> X
DATE/nov21/full_moon_015.fit,FILTER: u' -> X
add DATE/nov21/bias_110.fit,FILTER = X
DATE/nov21/full_moon_089.fit,FILTER: u' -> X
add DATE/nov21/bias_134.fit,FILTER = X
add DATE/nov21/bias_158.fit,FILTER = X
add DATE/nov21/bias_116.fit,FILTER = X
....and so on
first off, I only wanted wanted it to add the keyword FILTER if it didn't exist, not to update it if it did already exist!! - that was probably down to my misunderstanding what each of the parameters actually does....
But more surprising than that is that despite the output of hedit as quoted above, if after running hedit I then check the keyword FILTER of any of the images that it supposedly updated, the value for FILTER remains at its old value or if the keyword FILTER did not exist for a particular image it will still not exist although the output of hedit suggests otherwise. For example, from the above output, if I were to check the keyword FILTER of
DATE/nov21/full_moon_089.fit, it would still be FILTER = u'...or if I check FILTER value for DATE/nov21/bias_116.fit, the keyword FILTER will still not exist for this image..
Why is this?
(and apologies for longwinded post!)
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum