Esempio n. 1
0
    def _get_bl_prop(self, array_name):

        # In case a bl_array is selected
        """

        Args:
            array_name: 

        Returns:
            object: 

        """
        if array_name not in CONF_LIM['minbase'].keys():
            id1 = self._arrays_info.query(
                'SE_ARRAYNAME == "%s"' % array_name).iloc[0].SE1
            ap = self._arrays_info.query(
                'SE_ARRAYNAME == "%s" and SE1 == %d' % (array_name, id1)
            )[['AV1']]

            ap.rename(columns={'AV1': 'antenna'}, inplace=True)
            ap = ap[ap.antenna.str.contains('CM') == False]
            if len(ap) == 0:
                ap = self._arrays_info.query(
                        'SE_ARRAYNAME == "%s" and SE1 == %d' %
                        (array_name, id1))[['AV1']]
                ap.rename(columns={'AV1': 'antenna'}, inplace=True)

            conf = pd.merge(ap, self._ante_pad,
                            left_on='antenna', right_on='antenna')[
                ['pad', 'antenna']]
            conf_file = self._dsa_path + 'conf/%s.txt' % array_name
            conf.to_csv(conf_file, header=False,
                        index=False, sep=' ')
            ac = rUV.ac.ArrayConfigurationCasaFile()
            ac.createCasaConfig(conf_file)
            ruv = rUV.compute_radialuv(conf_file + ".cfg")
            num_bl = len(ruv)
            num_ant = len(ap)
            array_ar = rUV.compute_array_ar(ruv)

        # If C36 is selected
        else:
            conf_file = (self._dsa_path +
                         'conf/%s.cfg' % array_name)
            ruv = rUV.compute_radialuv(conf_file)
            # noinspection PyTypeChecker
            array_ar = rUV.compute_array_ar(ruv)
            num_bl = len(ruv)
            if array_name.startswith('C40'):
                num_ant = 40
            else:
                num_ant = 36

        return array_ar, num_bl, num_ant, ruv
Esempio n. 2
0
    def _get_sbbased_bl_prop(ruv, blmin, blmax, arrayfam):

        """

        Args:
            ruv: 
            blmin: 
            blmax: 
            arrayfam: 

        Returns:
            Pandas.Series: 

        """
        if arrayfam != "TWELVE-M":
            return pd.Series(
                [pd.np.NaN, 0],
                index=['array_ar_cond', 'num_bl_use'])

        ruv = ruv[(ruv >= blmin) & (ruv <= blmax)]
        if len(ruv) < 400.:
            return pd.Series(
                [pd.np.NaN, 0],
                index=['array_ar_cond', 'num_bl_use'])
        num_bl = len(ruv)
        array_ar = rUV.compute_array_ar(ruv)

        return pd.Series([array_ar, num_bl],
                         index=['array_ar_cond', 'num_bl_use'])
Esempio n. 3
0
    def _get_sbbased_bl_prop(ruv, blmin, blmax):

        """

        :param ruv:
        :param blmin:
        :param blmax:
        :return:
        """
        ruv = ruv[(ruv >= blmin) & (ruv <= blmax)]
        if len(ruv) < 300.:
            return pd.Series(
                [pd.np.NaN, 0],
                index=['array_ar_cond', 'num_bl_use'])
        num_bl = len(ruv)
        array_ar = rUV.compute_array_ar(ruv)

        return pd.Series([array_ar, num_bl],
                         index=['array_ar_cond', 'num_bl_use'])