Пример #1
0
                            f"Computing model cube statistics with scheduler {scheduler} and sched args {modcube._scheduler_kwargs}",
                            flush=True)
                        modstats = modcube.statistics()
                        modmin = modstats['min']
                        modmax = modstats['max']
                        modstd = modstats['sigma']
                        modsum = modstats['sum']
                        modmean = modstats['mean']

                        del modcube
                        del modstats

                        if os.path.exists(psffn):
                            (residual_peak, peakloc_as, frac, epsilon,
                             firstnull, r_sidelobe, _) = get_psf_secondpeak(
                                 psffn,
                                 specslice=slice(cube.shape[0] // 2,
                                                 cube.shape[0] // 2 + 1))

                        del cube

                        row = (
                            [
                                field, band, config, spw, line, suffix, fn,
                                beam.major.value, beam.minor.value,
                                beam.pa.value, restfreq, minfreq, maxfreq
                            ] + [
                                history[key] if key in history else ''
                                for key in colnames_fromheader
                            ] + [min, max, std, sum, mean] +
                            [modmin, modmax, modstd, modsum, modmean, epsilon])
                        rows.append(row)
Пример #2
0
        files = glob.glob(str(itpath / globstr))
        if len(files) > 1:
            raise ValueError("Too many files")
        elif len(files) == 0:
            if field == 'W43-MM1' and band == 'B6':
                raise ValueError(
                    "W43-MM1 is still missing! (but it should exist now)")
            else:
                raise ValueError("Not enough files")

        psffn = files[0]

        ax = pl.subplot(3, 5, ii + 1)
        ax.set_title(field)
        log.info(f"{field} {band}")
        get_psf_secondpeak(psffn,
                           show_image=True,
                           min_radial_extent=2.5 * u.arcsec,
                           max_radial_extent=5 * u.arcsec)

        if ii not in (0, 5, 10):
            ax.set_ylabel("")
        if ii < 10:
            ax.set_xlabel("")

    pl.subplots_adjust(wspace=0.32)
    fig.savefig(releasepath / f'figures/{band}_psfs.png',
                bbox_inches='tight',
                dpi=300)
    fig.savefig(releasepath / f'figures/{band}_psfs.pdf', bbox_inches='tight')