Welcome to iraf.net Friday, March 29 2024 @ 03:08 PM GMT


 Forum Index > Help Desk > Systems New Topic Post Reply
 problems declaring image data
   
dan
 02/27/2006 01:33PM (Read 7814 times)  
+----
Newbie

Status: offline


Registered: 12/04/2005
Posts: 3
Hi,I'm having a problem re-creating a declaration in "A User's Introduction to the IRAF Command Language". Section 6.5 has the followingcl> real image rarray[50,50] {min=0, max=100}And I get the following response** Syntax error
**: real image rarray[50,50] {min=0, max=100}
^
>>> I can't find anything in the help pages or online about this type of declaration and I can't see what i'm doing wrong. The reason for wanting to write an array to disk is because i'm unable to create an array in memory of the size I want, i.ecl> int testarray[1056,2304]
INTERNAL ERROR: dictionary fullcheersDan

 
Profile Email
 Quote
fitz
 02/27/2006 01:33PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
[quote:3828f9d900]I'm having a problem re-creating a declaration in "A User's Introduction to the IRAF Command Language". Section 6.5 has the following cl> real image rarray[50,50] {min=0, max=100} ......
[/quote:3828f9d900]This is one of the early design documents and not too surprisingly, what was finally implemented in the CL is not quite what you read here. This example is in fact not legal in the current CL, specifically the 'image' qualifier isn't implemented.[quote:3828f9d900]The reason for wanting to write an array to disk is because i'm unable to create an array in memory of the size I want, i.e cl> int testarray[1056,2304]
INTERNAL ERROR: dictionary full [/quote:3828f9d900]You can search the forums for the 'dictionary full' message to find a method for recompiling the CL with a larger dictionary, and some cautions about relying too heavily on arrays in the CL. In most cases there are better ways to deal with arrays as large as this, keep in mind the RTEXT/WTEXT and IMPORT/EXPORT tasks can help get general rasters in/out of the system as images. It might help if you described more about what you're doing, there might be other suggestions as well.
Hope this helps.Cheers,
-Mike

 
Profile Email
 Quote
dan
 02/27/2006 01:33PM  
+----
Newbie

Status: offline


Registered: 12/04/2005
Posts: 3
Hi Mike,Thanks for the prompt reply. I had a feeling something was up when this type of declaration wasn't included in the help pages for 'language.declarations'.The reason for asking about this issue is because I'm working with bad pixel masks. I want do do some operations on a boolean bad pixel mask such that I can convert it into a BPM suitable for use with proto.fixpix, e.g. a BPM with pixels set to 0,1,2. I know imred.ccdred.ccdmask exists but i'm using images.imutil.imexpr to create 3 different BPMs (dead,hot and non-linear pixels) and then combine them into a master boolean BPM. Then i'm trying to alter the master BPM into something fixpix can work with.Other than ccdmask, I don't know of any 'off the shelf' tasks to create this kinda mask, so I thought I roll my own. It seems to me that if I want to do this within 'iraf' i'll need to do a bit of SPP coding. I've tried, briefly, to read a boolean BPM into IDL but that hasn't worked. Header problems??I'll try the SPP route for now.cheers,
-Dan

 
Profile Email
 Quote
fitz
 02/27/2006 01:33PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Dan,
One thing I noticed is that your mask has values 0/1/2 for dead/hot/nonlinear pixels. However, FIXPIX assumes that a mask value of zero is a good pixel, in your mask it is a dead pixel. Could this be the problem?
Almost any task can be used to produce a mask by simply supplying a .pl extension to the output image. See also MSKEXPR and TEXT2MASK for other
common ways to create masks. Also be sure there isn't any confusion between a masked named in a BPM keyword and one specified as a parameter.Cheers,
-Mike

 
Profile Email
 Quote
dan
 02/27/2006 01:33PM  
+----
Newbie

Status: offline


Registered: 12/04/2005
Posts: 3
Hi Mike,I think I may have caused a slight confusion with the 0,1,2 - dead/hot/non-linear thing. All the bad pixels (dead, hot and NL) will have a value of 1 or 2 depending on the direction I want to interpolate over when using fixpix. Like you say, the good pixels will be set to 0. Determining the direction and so which value (1 or 2) to assign to the bad pixel is, in principle, trivial. The problem I'm having is that I somehow need to 'write' the master_bpm.pl (which is boolean) to an array, such that I can then mess with the pixel values and convert this 0/1 BPM into a 0/1/2 BPM. But i'm unable to create big enough arrays in CL and that brings us to the first post you replied to. So, either I increase the size of the dictionary or find a work around. Even if I increase the size of the dictionary I'm unsure if I can actually read the .pl file into an array via the CL. The crux of this issue, at least I think it is for the way i'm approaching things, is to copy the boolean BPM into an array. Work on the array and then spit the new array out to a new .pl file. I've been looking at SPP and it seems all the tools I need are there, but it will be a while before I figure it all out.cheers
-Dan

 
Profile Email
 Quote
pyrafuser
 02/27/2006 01:33PM  
+----
Newbie

Status: offline


Registered: 01/30/2006
Posts: 4
You can also try pyraf/python (and the pyfits module). I've found it to be much easier to use than SPP, and creating additional modules in C is quite straightforward (although all of your work with the BPM can probably be done in python quite easily without needing to use C).

 
Profile Email
 Quote
fitz
 02/27/2006 01:33PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Dan,
A couple of suggestions that might help, although if you could post your criteria for determining whether to do a row/col interpolation (i.e. which is a 1 and which is a 2) I might be able to offer something more specific. First, in the unlikely event you have, say, two masks: row.pl and col.pl each with a 0/1 mask these can be combined simply using IMEXPR as reset imclobber = yes
imcopy row.pl master.pl
imexpr "(a ? 2 : 0)" master.pl a=col.plThe IMCOPY preserves the 1 value for the row-interpolated mask, the IMEXPR simply overwrites the mask with a 2 value for the col-interpolated mask (the 'imclobber' needs to be reset to allow this). This could probably also be a one-liner using a more complex expression or user-defined functions in an expression database. To programmatically do this there are approaches other than just SPP, even if they're not as elegant. PyRAF is one such approach but if you're not familiar with python or have it installed you could simply use smaller arrays based on image subsections and loop over the image (probably with some overlap of each region needed). Another method is to simply create a mask as a raw binary raster using a programming language of your choice in a task declared as a foreign task. The IMPORT task could convert this raster to a .pl mask. Similarly, a small Fortran/C program could use the IMFORT interface to create a .imh "mask" image you'd simply IMCOPY to a .pl file. These are hacks but might get the job done. By default FIXPIX will interpolate across the smallest dimension so specifying the direction is needed only when you need to force it. Let me know how you're deciding on the direction and we could perhaps come up with an expression that'll do it in IMEXPR/MSKEXPR more easily.Cheers,
-Mike

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