Thursday, July 26, 2007

Multiple output files

If one wants to write out multiple fits files at a time which have same inname and inclass just different inseq no. how does one do that?

8 comments:

Laura said...

See this comment by Ian. I think it's the most relevant thing I've found.

Scorpionqueen said...

Thanks! But my problem is specific to the types of files I want to export out of AIPS. The wrtprocs (i checked) is useful for for files written serially in the catalog and the not the ones which have same filename.classname.seqn (i.e only the seq. no. is different). These could be in any order in the catalog. So, I want to be able to select at a time same files just with a different sequence number.

Ian said...

Hello.

You could try a procedure such as this one which defines an array of catalogue numbers and then automatically exports them to FITS files:

$

proc init_var

scalar i

finish

proc export

array maparray(6)
maparray 4 9 10 15 21 24

for i = 1 to 6 ; getn maparray(i)
outfil='PWD:'!!inna!!'_'!!char(inseq)!!'.FITS'
go fittp ; wait fittp
end

finish


As you can probably tell the above example (hopefully!) gets cat numbers 4, 9, 10, 15, 21 and 24 and exports them to the current directory with filenames of the form:

INNAME_INSEQ.FITS

You can use the task CATA to get the list of numbers, just set INNAME, INTYPE and INCLASS accordingly and set INSEQ to zero. Remember to change the length of the array when it gets defined too.

Typing out the results of CATA into the procedure, even if you copy and paste them, is going to be tedious if you've got hundreds of them. I'd probably try to devise a Perl script and run AIPS in batch mode if this was the case, although if anyone knows how to pipe output such as that from CATA into other procedures I'd be glad to hear it.

Good luck.

emily said...

hey ian, would you like to be added as an contributor so you can post as well as comment?

Ian said...

Sure, that'd be great. I like to help out if I can, I stumbled across this blog a while ago and found it useful, and it's always nice to give something back.

emily said...

hi ian, i had blogger send an email invite to the email address of the person i think you are. let me know if you don't get anything and then i'll just ask you for your email. :)

Ian said...

Yep, got it.

Thanks!

Scorpionqueen said...

Hi Ian,
Thanks, that's what I wanted :)