sel = random.randint(0, len(allmoadata) - 1) datafiles.append(allmoadata[sel]) # Load OGLE magnitudes for given type of variable star. oglemags = prep_data.load_ogle(sys.argv[1]) # Load MOA magnitudes contained in datafiles #moamags_all, moaerrs_all = prep_data.load_nanmags(allmoadata) # Not enough memory to load all MOA data moamags, moaerrs = prep_data.load_nanmags( datafiles) # Use random subset instead #datapoints = mkltcurve.LinkErrs(10) # Old code: idea was to create a class in order to link errors to magnitude values. #for n in range(10): # # datapoints.put_meas(moamags[n], moaerrs[n], n) # #print datapoints.mag, datapoints.err # ogle_hist, ogle_bins = mkltcurve.mk_hist(oglemags, 0.05) moa_hist, moa_bins = mkltcurve.mk_hist(moamags, 0.01) #moa_hist2, moa_bins2 = mkltcurve.mk_hist(othermags, 0.05) moa_mean = mkltcurve.mk_hist_mean(moamags, 0.01) print '-- Photometry --' + '\n', datafiles print '# OGLE values:', len(oglemags), 'Range:', str(round( min(oglemags), 3)) + '-' + str(round(max(oglemags), 3)), 'Median:', round( numpy.median(oglemags), 3), 'Mean:', round(numpy.mean(oglemags), 3) print '# MOA values:', len(moamags), 'Range:', str(round( min(moamags), 3)) + '-' + str(round(max(moamags), 3)), 'Median:', round( numpy.median(moamags), 3), 'Mean:', round(numpy.mean(moamags), 3) corrctn_factor = 2.6 filename = '/projects/uoa00357/moa/training/' + str(sys.argv[1]) + '.arff'
sel = random.randint(0, len(allmoadata) - 1) datafiles.append(allmoadata[sel]) # Load OGLE magnitudes for given type of variable star. oglemags = prep_data.load_ogle(sys.argv[1]) # Load MOA magnitudes contained in datafiles #moamags_all, moaerrs_all = prep_data.load_nanmags(allmoadata) # Not enough memory to load all MOA data moamags, moaerrs = prep_data.load_nanmags( datafiles) # Use random subset instead #datapoints = mkltcurve.LinkErrs(10) # Old code: idea was to create a class in order to link errors to magnitude values. #for n in range(10): # # datapoints.put_meas(moamags[n], moaerrs[n], n) # #print datapoints.mag, datapoints.err # moa_hist, moa_bins = mkltcurve.mk_hist(moamags, 0.01) #moa_hist2, moa_bins2 = mkltcurve.mk_hist(othermags, 0.05) moa_mean = mkltcurve.mk_hist_mean(moamags, 0.01) print '-- Photometry --' + '\n', datafiles print '# OGLE values:', len(oglemags), 'Range:', str( round(min(oglemags), 3)) + '-' + str(round( max(oglemags), 3)), 'Median:', round(numpy.median(oglemags), 3), 'Mean:', round( numpy.mean(oglemags), 3) print '# MOA values:', len(moamags), 'Range:', str(round( min(moamags), 3)) + '-' + str(round(max(moamags), 3)), 'Median:', round( numpy.median(moamags), 3), 'Mean:', round(numpy.mean(moamags), 3) mags, errs, times, star_type = mkltcurve.template(str(sys.argv[1]),