Ejemplo n.º 1
0
from bgpe.io.readchi2 import Chi2
from bgpe.fit.stats import percentiles
from bgpe.io.readlibrary import Library

from bgpe.plots.labels import aux_name_props #FIXME: Temporal. This should come from an XML file!

db_dir = '/home/william/databases/'
#db_dir = '/Users/william/Downloads/databases/'

lib_file = '%s/database_JPAS51_BA.hdf5' % db_dir
chi2_file = '%s/chi2_1k_0.%s.hdf5' % (db_dir, sys.argv[1])
stats_file = '%s/stats_1k_0.%s.hdf5' % (db_dir, sys.argv[1])


lib = Library(lib_file)
lib.get_filtersys(lib.filtersystems [0])

chi2 = Chi2(chi2_file)
chi2.get_path(chi2.list_paths()[-1])

f_L_range = np.arange(1,30,2)
stats = {'BMX': np.int,
         'P_999': np.float,
         'AVG': np.float,
         'STD': np.float,
         'P16': np.float,
         'P50': np.float,
         'P84': np.float}

# Create stats_file and populate it with respective datasets.
Ejemplo n.º 2
0
              'figure.figsize': fig_size}
    pylab.rcParams.update(params)

#####################################################################################################################

def get_zslice(l, z):
    return l.library[np.argwhere(l.z == z),:]

filtersys = 'JPAS_51'
ccd = '1'
## Library
_dir = '/Users/william/Downloads/databases/'
f1 = _dir+'database_JPAS51_OB.hdf5'
f2 = _dir+'database_JPAS51_BA.hdf5'

l1 = Library(f1) #obj
l2 = Library(f2) #tmpl

l1.get_filtersys(filtersys, ccd)
l2.get_filtersys(filtersys, ccd)

##

ds_path = '/%s/%s/' % (filtersys, ccd)
h5file = _dir+'chi2_1k_0.01.hdf5'
#h5file = '../../scripts/testchi2.hdf5'

f = h5py.File(h5file)


o_list = get_zslice(l1, f.attrs.get('z'))
Ejemplo n.º 3
0
        print 'CTRL+C pressed... exiting...'
        return 0
    
    except Exception, e:
        if DEBUG or TESTRUN:
            raise(e)
        indent = len(program_name) * " "
        sys.stderr.write(program_name + ": " + repr(e) + "\n")
        sys.stderr.write(indent + "  for help use --help")
        return 2
    

    
#    inp = Library(args.input)
    inp = Input(args.input)
    lib = Library(args.Library)
    
    inp.get_filtersys(args.filtersystem, args.ccd) # obj
    lib.get_filtersys(args.filtersystem, args.ccd) # libra
    
    
    o_list = inp.data
    if args.Nmax != None:
        o_list = o_list[:np.int(args.Nmax)]
    
    N_obj = len(o_list)
    
    try:
        f = h5py.File(args.output, mode = 'w-')
    except IOError:
        raise BGPECLIError('File %s already exists.' % args.output)