Welcome to iraf.net Thursday, May 02 2024 @ 09:46 AM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 dividing a large image in half
   
kkwitter
 07/24/2006 06:07PM (Read 3943 times)  
+++--
Chatty

Status: offline


Registered: 01/19/2006
Posts: 42
Hi-I have an image: xxx.fits[256,256,16383] which is 2.1MB. Is there a way to split this in half for easier manipulation (it's a time series)?Thanks!KK

 
Profile Email Website
 Quote
fitz
 07/24/2006 06:07PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Hi Karen,[quote:85f6b923f9]I have an image: xxx.fits[256,256,16383] which is 2.1MB. Is there a way to split this in half for easier manipulation (it's a time series)? [/quote:85f6b923f9]I assume you mean 2.1 GB not MB and are running into the 32-bit limit?You can't do anything with it in iraf for that reason but I had a similar question walk in my door (literally) just recently so I'll give the same advice. One way to approach this is to first split the file into the FITS header and data, then split the data as a raw raster, prepend the header to each half and then edit keywords as needed. An alternative is to see if there is a task in FITSIO/CFITSIO that can do this more elegantly.In the first case you can use the unix 'dd' command as a tool for plowing through the binary file, specifically the 'skip' and 'count' parameters along with the knowledge of the file block size can be used. For example, if your header is 3 FITS records long you can pull off the header using[code:1:85f6b923f9]prompt% dd of=xxx.fits of=xxx.hdr bs=2880 count=3[/code:1:85f6b923f9]where if/of specify the input/output filename and 'bs' is the block size. The resulting 'xxx.hdr' file should then be just the padded header. To get the data you do something similar but skip the first three records, e.g.[code:1:85f6b923f9]prompt% dd if=xxx.fits of=xxx.dat1 bs=2880 skip=3 count=372736[/code:1:85f6b923f9]where 372736 FITS records into the you should be at the start of plane 8190 of the image and about halfway through the file. Check my math, note Im asssuming 16-bit pixels. Then do something similar to get the second half of the data, but skip (372736 + 3) records. Paste the header and data parts back into .fits files, verify the sizes are multiples of 2880 and you can use HFIX to modify the headers as needed.Hope this helps, or at least gives you some ideas.Cheers,
-Mike

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