Changeset 116


Ignore:
Timestamp:
12/01/04 13:47:09 (20 years ago)
Author:
mar637
Message:

Added SDFITS writing.

Location:
trunk/python
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/__init__.py

    r113 r116  
    4848            set_restfreqs   - give a list of rest frequencies
    4949            flag_spectrum   - flag a whole Beam/IF/Pol
    50             save            - save the scantable to disk
     50            save            - save the scantable to disk as either 'ASAP'
     51                              or 'SDFITS'
    5152            nbeam,nif,nchan,npol - the number of beams/IFs/Pols/Chans
    5253    [Math]
  • trunk/python/scantable.py

    r113 r116  
    1919        self._p = None
    2020        sdtable.__init__(self, filename)
     21
     22    def save(self, name, format='ASAP'):
     23        """
     24        Store the scantable on disk. This can be a asap file or SDFITS/MS2.
     25        Parameters:
     26            name:        the name of the outputfile
     27            format:      an optional file format. Default is ASAP.
     28                         Alllowed are 'ASAP', 'SDFITS' and 'MS2'
     29        Example:
     30            scan.save('myscan.asap')
     31            scan.save('myscan.sdfits','SDFITS')
     32        """
     33        if format == 'ASAP':
     34            self._save(name)
     35        else:
     36            from asap._asap import sdwriter as _sw
     37            w = _sw()
     38            if format == 'SDFITS':
     39                w.write(self, name)
     40        return
    2141
    2242    def _verbose(self, *args):
Note: See TracChangeset for help on using the changeset viewer.