Welcome to iraf.net Tuesday, May 07 2024 @ 02:06 AM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 Can someone running iraf on a Sun help me ?
   
Houdebine
 07/23/2008 06:40AM (Read 4084 times)  
+----
Newbie

Status: offline


Registered: 07/12/2008
Posts: 8
I created some iraf files on a Sun station some years ago. I can't read them on my PC anymore. Unfortunately I don't have access to a sun station anymore. Could someone working on a sun station help me ?
Regards
Eric

 
Profile Email
 Quote
fitz
 07/23/2008 06:40AM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
A Mac system has the same byte order and should be able to read the files. If you can't find one of those, put a tarball of the image directory on ftp://iraf.noao.edu/pub and I'll have a look.-Mike

 
Profile Email
 Quote
Houdebine
 07/23/2008 06:40AM  
+----
Newbie

Status: offline


Registered: 07/12/2008
Posts: 8
Hello MikeThanks for your advices. I put my files into iraf.noao.edu/pub.
Let me know if you can read them.
Regards
Eric

 
Profile Email
 Quote
fitz
 07/23/2008 06:40AM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Eric,The tar file appears to be corrupted, untarring terminates with an error. Also, I need to have BOTH the .imh and .pix files. Please try resending. When I'm done I put back a tarball of FITS images you should be able to read.-Mike

 
Profile Email
 Quote
Houdebine
 07/23/2008 06:40AM  
+----
Newbie

Status: offline


Registered: 07/12/2008
Posts: 8
I put again a tar file into /pub. Its called houdebine.tar.gz. It contains all .pix and .imf files.
Thanks

 
Profile Email
 Quote
jturner
 07/23/2008 06:40AM  
+++++
Active Member

Status: offline


Registered: 12/29/2005
Posts: 165
Hi Eric,I think you could also do something like this in C, which worked for me some years ago.Cheers,James.[code:1:5b962c8147]/* Convert from 32 bit DEC Alpha binary to Sun binary */
/* James Turner, Nov.97 */#include<stdio.h>int main(int argc, char **argv){ char c[4], ct, n, newname[255];
FILE *input, *output; if (argc==1)
{ printf("Usage: %s <filenames>\n(ouput files have .sun appended)\n",
*argv);
return 1;
} printf("Converting %d %s\n", argc-1, argc > 2 ? "files" : "file"); while (--argc) { argv++; if ((input = fopen(*argv, "r")) == NULL)
{ printf("Can't open input file %s.\n", argv);
return 1;
} n = 0;
while (newname[n] = (*argv)[n++]); newname[--n] = '.';
newname[++n] = 's';
newname[++n] = 'u';
newname[++n] = 'n';
newname[++n] = 0; if ((output = fopen(newname, "w")) == NULL)
{ printf("Can't open %s for writing.\n", newname);
fclose(input);
return 1;
} n = 4; while(fread(c, 1, 4, input) == 4)
{ ct = c[0];
c[0] = c[3];
c[3] = ct; ct = c[1];
c[1] = c[2];
c[2] = ct; fwrite(c, 1, 4, output);
} fclose(output);
fclose(input);
}
}
[/code:1:5b962c8147]

 
Profile Email
 Quote
fitz
 07/23/2008 06:40AM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Sorry James, a simple byte-swap like this won't work to make the images readable. Aside from reconnecting the .pix and .imh files, the actual disk layout of the headers for these file needs to be rewritten to swap only certain things. A special task could be written, but was never a priority.In any case, Eric: I've replaced the houdebine.tar.gz file with one that contains 1) the rewritten .imh images that reconnect to the data (these are in the newer machine-independent format), 2) a subdirectory of the headers as text output (these appear to be MIDAS-written files and might have lost some keywords), and 3) a 'fits' subdirectory containing all the images as regular FITS files. You should be able to get at the data again.Cheers,
-Mike

 
Profile Email
 Quote
jturner
 07/23/2008 06:40AM  
+++++
Active Member

Status: offline


Registered: 12/29/2005
Posts: 165
OK. Sorry to confuse the issue. It works for some binary files, but I might have guessed it wouldn't work for data with headers.

 
Profile Email
 Quote
Houdebine
 07/23/2008 06:40AM  
+----
Newbie

Status: offline


Registered: 07/12/2008
Posts: 8
Thanks for your help Mike !!I've got the data. It works fine !!!
Eric

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