Esempio n. 1
0
    def attach_table(self, name, version, **kwds):
        """Attach an extension table to this image.

        A new extension table is created if the extension table NAME
        with version VERSION doesn't exist.  If VERSION is 0, a new
        extension table is created with a version that is one higher
        than the highest available version."""

        if not name.startswith("AIPS "):
            name = "AIPS " + name

        if version == 0:
            version = Obit.ImageGetHighVer(self._data.me, name) + 1

        no_parms = 0
        if "no_parms" in kwds:
            no_parms = kwds["no_parms"]
        data = Obit.ImageCastData(self._data.me)
        if name == "AIPS CC":
            Obit.TableCC(data, [version], 3, name, no_parms, self._err.me)
        elif name == "AIPS FG":
            Obit.TableFG(data, [version], 3, name, self._err.me)
        elif name == "AIPS PS":
            Obit.TablePS(data, [version], 3, name, self._err.me)
        elif name == "AIPS SN":
            Obit.TableSN(data, [version], 3, name, kwds["no_pol"],
                         kwds["no_if"], self._err.me)
        else:
            msg = "Attaching %s tables is not implemented yet" % name
            raise NotImplementedError(msg)
        if self._err.isErr:
            raise RuntimeError
        return _AIPSTable(self._data, name, version)
Esempio n. 2
0
    def attach_table(self, name, version, **kwds):
        """Attach an extension table to this UV data set.

        A new extension table is created if the extension table NAME
        with version VERSION doesn't exist.  If VERSION is 0, a new
        extension table is created with a version that is one higher
        than the highest available version."""

        if not name.startswith("AIPS "):
            name = "AIPS " + name

        if version == 0:
            version = Obit.UVGetHighVer(self._data.me, name) + 1

        header = self._data.Desc.Dict
        jlocif = header["jlocif"]
        no_if = header["inaxes"][jlocif]
        if "no_if" in kwds:
            no_if = kwds["no_if"]
            pass
        no_pol = len(self.polarizations)
        if "no_pol" in kwds:
            no_pol = kwds["no_pol"]
            pass
        data = Obit.UVCastData(self._data.me)
        if name == "AIPS AI":
            Obit.TableAI(data, [version], 3, name, kwds["no_term"],
                         self._err.me)
        elif name == "AIPS CL":
            Obit.TableCL(data, [version], 3, name, no_pol, no_if,
                         kwds["no_term"], self._err.me)
        elif name == "AIPS FQ":
            Obit.TableFQ(data, [version], 3, name, no_if, self._err.me)
        elif name == "AIPS NI":
            Obit.TableNI(data, [version], 3, name, kwds["num_coef"],
                         self._err.me)
        elif name == "AIPS PS":
            Obit.TablePS(data, [version], 3, name, self._err.me)
        elif name == "AIPS SN":
            Obit.TableSN(data, [version], 3, name, no_pol, no_if, self._err.me)
        elif name == "AIPS SU":
            Obit.TableSU(data, [version], 3, name, no_if, self._err.me)
        else:
            msg = "Attaching %s tables is not implemented yet" % name
            raise NotImplementedError(msg)
        if self._err.isErr:
            raise RuntimeError
        return _AIPSTable(self._data, name, version)