Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /branches/ein16/synth/d2/set.py
ViewVC logotype

View of /branches/ein16/synth/d2/set.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4257 - (download) (as text) (annotate)
Mon Jul 25 15:23:32 2016 UTC (2 years, 11 months ago) by cchiw
File size: 1156 byte(s)
fixed image shape issue
#include <math.h>
import random

#-------------- constants ----------------------
#position bounds
lpos=  -0.4
upos= 0.4
num_pos = 5 # number of positions
#coeff bounds
lcoeff=1
ucoeff=5
# number of samples
samples=70
samples_d3=70

# name of programs and data
p_Observ="p_observ"                     # name of diderot program testing function created
output="data/output5_"+p_Observ         # name of output file with observed data
inputfile="data/inputfile"              # name of synthetic field created

#--------------------samples, positions --------------------
#outSize
def get_size(dim):
    return samples

# testing positions
def get_positions(dim):
    if(dim==1):
        posL=[]
        for s in range(num_pos):
            # random number for positions
            x=random.uniform(lpos, upos)
            posL.append(round(x ,2))
        return posL
    else:
        posL=[]
        for s in range(num_pos):
            pos=[]
            for i in range(dim):
                # random number for positions
                x=random.uniform(lpos, upos)
                pos.append(round(x ,2))
            posL.append(pos)
        return posL

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0