uk.ac.starlink.splat.ast
Class ASTFITSChan

java.lang.Object
  extended by uk.ac.starlink.splat.ast.ASTFITSChan

public class ASTFITSChan
extends Object

Class to create and manipulate AST FITS channels. Uses of this are to read in a series of FITS headers and create an AST frameset that describes any coordinate systems and the reverse process of encoding a frameset as a series of FITS header cards.

Since:
07-SEP-2000
See Also:
"Starlink User Note 211", ASTJ

Field Summary
protected  uk.ac.starlink.ast.FitsChan fitsChan
          Reference to the AST FITS channel.
 
Constructor Summary
ASTFITSChan()
          Default constructor.
ASTFITSChan(String encoding)
          Default constructor.
 
Method Summary
 void add(String card)
          Add a card to the channel.
 String findCard(String pattern)
          Read a FITS card back from the channel.
 uk.ac.starlink.ast.FitsChan getFitsChan()
          Return native AST reference to the channel.
 String nextCard()
          Read the next FITS card back from the channel.
 uk.ac.starlink.ast.FrameSet read()
          Read the channel, creating an AST frameset.
 void rewind()
          Rewind the channel.
 boolean write(uk.ac.starlink.ast.FrameSet frameset)
          Write a frameset into the channel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fitsChan

protected uk.ac.starlink.ast.FitsChan fitsChan
Reference to the AST FITS channel.

Constructor Detail

ASTFITSChan

public ASTFITSChan()
Default constructor. Creates a channel with null source and sink and native encoding.


ASTFITSChan

public ASTFITSChan(String encoding)
Default constructor. Creates a channel with null source and sink and the given encoding.

Parameters:
encoding - the AST FITS channel encoding.
Method Detail

add

public void add(String card)
Add a card to the channel.

Parameters:
card - the FITS card to add.

rewind

public void rewind()
Rewind the channel.


read

public uk.ac.starlink.ast.FrameSet read()
Read the channel, creating an AST frameset.

Returns:
the AST frameset created from the channel.

write

public boolean write(uk.ac.starlink.ast.FrameSet frameset)
Write a frameset into the channel. Uses the current encoding, if this fails then the routine returns false.

Parameters:
frameset - reference to an AST frameset.

findCard

public String findCard(String pattern)
Read a FITS card back from the channel. Returns "" if not found.

Parameters:
pattern - keyword template used to match card.
See Also:
"SUN 211"

nextCard

public String nextCard()
Read the next FITS card back from the channel. Returns "" when last card has been returned.


getFitsChan

public uk.ac.starlink.ast.FitsChan getFitsChan()
Return native AST reference to the channel.



Copyright © 2018 Central Laboratory of the Research Councils. All Rights Reserved.