Esempio n. 1
0
def main():
    parser = OptionParser()
    imsimUtils.addOptions(parser)
    (opt, args) = parser.parse_args()

    inButler = imsimUtils.getInputButler(opt)
    allkeys = imsimUtils.getAllKeys(opt, inButler)

    solvedindex = []
    for keys in allkeys:
        pmatches = inButler.get('icMatch', **keys)
        matchmeta = pmatches.getSourceMatchMetadata()
        indexid = matchmeta.getInt('ANINDID')
        print('Solved with', indexid)
        solvedindex.append(indexid)

    solvedindex = np.array(solvedindex)
    U = np.unique(solvedindex)
    U.sort()
    Ntotal = len(solvedindex)
    for ind in U:
        N = sum(solvedindex == ind)
        print('Index', ind, 'solved', N,
              'or %.1f %%' % (100. * N / float(Ntotal)))

    plt.clf()
    plt.hist(solvedindex)
    plt.xlabel('Astrometry.net index ID')
    plt.ylabel('Number of CCDs solved')
    plt.savefig('solvedindex.png')
def main():
    parser = OptionParser()
    imsimUtils.addOptions(parser, input=True, output=True)
    parser.add_option('-T', '--threads', dest='threads', default=None,
                      help='run N processes at once', type='int')
    (opt, args) = parser.parse_args()

    if not os.path.isdir(opt.outRoot):
        os.makedirs(opt.outRoot)

    if not opt.registry and not os.path.exists(os.path.join(opt.outRoot, "registry.sqlite3")):
        opt.registry = os.path.join(opt.inRoot, "registry.sqlite3")

    inButler = imsimUtils.getInputButler(opt)
    outButler = imsimUtils.getOutputButler(opt)

    allkeys = imsimUtils.getAllKeys(opt, inButler)

    if opt.threads is None:
        for keys in allkeys:
            process(keys, inButler, outButler)
    else:
        import multiprocessing
        p = multiprocessing.Pool(opt.threads)
        p.map(process, [(k, inButler, outButler) for k in allkeys])
Esempio n. 3
0
def main():
    parser = OptionParser()
    imsimUtils.addOptions(parser)
    (opt, args) = parser.parse_args()

    inButler = imsimUtils.getInputButler(opt)
    allkeys = imsimUtils.getAllKeys(opt, inButler)

    solvedindex = []
    for keys in allkeys:
        pmatches = inButler.get('icMatch', **keys)
        matchmeta = pmatches.getSourceMatchMetadata()
        indexid = matchmeta.getInt('ANINDID')
        print('Solved with', indexid)
        solvedindex.append(indexid)

    solvedindex = np.array(solvedindex)
    U = np.unique(solvedindex)
    U.sort()
    Ntotal = len(solvedindex)
    for ind in U:
        N = sum(solvedindex == ind)
        print('Index', ind, 'solved', N, 'or %.1f %%' % (100. * N / float(Ntotal)))

    plt.clf()
    plt.hist(solvedindex)
    plt.xlabel('Astrometry.net index ID')
    plt.ylabel('Number of CCDs solved')
    plt.savefig('solvedindex.png')
Esempio n. 4
0
def main():
    parser = OptionParser()
    imsimUtils.addOptions(parser, input=True, output=True)
    parser.add_option('-T',
                      '--threads',
                      dest='threads',
                      default=None,
                      help='run N processes at once',
                      type='int')
    (opt, args) = parser.parse_args()

    if not os.path.isdir(opt.outRoot):
        os.makedirs(opt.outRoot)

    if not opt.registry and not os.path.exists(
            os.path.join(opt.outRoot, "registry.sqlite3")):
        opt.registry = os.path.join(opt.inRoot, "registry.sqlite3")

    inButler = imsimUtils.getInputButler(opt)
    outButler = imsimUtils.getOutputButler(opt)

    allkeys = imsimUtils.getAllKeys(opt, inButler)

    if opt.threads is None:
        for keys in allkeys:
            process(keys, inButler, outButler)
    else:
        import multiprocessing
        p = multiprocessing.Pool(opt.threads)
        p.map(process, [(k, inButler, outButler) for k in allkeys])
def main():
    parser = OptionParser()
    imsimUtils.addOptions(parser)
    parser.add_option('--fixup', dest='fixup', action='store_true', default=False, help='Fix up problems with PT1.1-current outputs')
    parser.add_option('--photometry', '-P', dest='dophotometry', action='store_true', default=False, help='Make photometry plot?')
    parser.add_option('--corr', '-C', dest='docorr', action='store_true', default=False, help='Make correspondences plot?')
    parser.add_option('--distortion', '-D', dest='dodistortion', action='store_true', default=False, help='Make distortion plot?')
    parser.add_option('--matches', '-M', dest='domatches', action='store_true', default=False, help='Make matches plot?')
    parser.add_option('--prefix', '-p', dest='prefix', default='', help='Plot output filename prefix')
    (opt, args) = parser.parse_args()

    if (opt.dophotometry is False and
        opt.docorr       is False and
        opt.dodistortion is False and
        opt.domatches    is False):
        plots = None
    else:
        plots = []
        if opt.dophotometry:
            plots.append('photom')
        if opt.docorr:
            plots.append('corr')
        if opt.dodistortion:
            plots.append('distortion')
        if opt.domatches:
            plots.append('matches')
        
    inButler = imsimUtils.getInputButler(opt)

    allkeys = imsimUtils.getAllKeys(opt, inButler)

    for keys in allkeys:
        plotsForField(inButler, keys, opt.fixup, plots, opt.prefix)
Esempio n. 6
0
def main():
    parser = OptionParser()
    imsimUtils.addOptions(parser)
    parser.add_option('--fixup',
                      dest='fixup',
                      action='store_true',
                      default=False,
                      help='Fix up problems with PT1.1-current outputs')
    parser.add_option('--photometry',
                      '-P',
                      dest='dophotometry',
                      action='store_true',
                      default=False,
                      help='Make photometry plot?')
    parser.add_option('--corr',
                      '-C',
                      dest='docorr',
                      action='store_true',
                      default=False,
                      help='Make correspondences plot?')
    parser.add_option('--distortion',
                      '-D',
                      dest='dodistortion',
                      action='store_true',
                      default=False,
                      help='Make distortion plot?')
    parser.add_option('--matches',
                      '-M',
                      dest='domatches',
                      action='store_true',
                      default=False,
                      help='Make matches plot?')
    parser.add_option('--prefix',
                      '-p',
                      dest='prefix',
                      default='',
                      help='Plot output filename prefix')
    (opt, args) = parser.parse_args()

    if (opt.dophotometry is False and opt.docorr is False
            and opt.dodistortion is False and opt.domatches is False):
        plots = None
    else:
        plots = []
        if opt.dophotometry:
            plots.append('photom')
        if opt.docorr:
            plots.append('corr')
        if opt.dodistortion:
            plots.append('distortion')
        if opt.domatches:
            plots.append('matches')

    inButler = imsimUtils.getInputButler(opt)

    allkeys = imsimUtils.getAllKeys(opt, inButler)

    for keys in allkeys:
        plotsForField(inButler, keys, opt.fixup, plots, opt.prefix)