コード例 #1
0
import time
import pickle
import zipfile

ubersttime = time.time()
 
# initializations 
infile = 'NatfishFinalAllobs_20110513.CSV' # filename for the main input
inparfile = 'comps1.par'
# read parfile
compsrange = np.loadtxt(inparfile,dtype=int)
# set the range of all indices to knock out
indsrange = [92861]

# read and parse the input file
DL, MASTERKEY, SpC, Event = cu.read_and_parse_input(infile)

# convert to arrays the lists which need to be referenced as arrays
SpC = np.array(SpC,dtype='int')
Event = np.array(Event,dtype='int')
MASTERKEY = np.array(MASTERKEY,dtype='int')
DL = np.array(DL, dtype='int')

total_length = len(MASTERKEY)
all_inds = np.arange(0,total_length)
currresults = []
#------------------------------------------------------------------------------------
# Now, run through the indices to knock out and save down the comparable MASTERKEYS
#------------------------------------------------------------------------------------
for cind in indsrange:
    currinds = np.nonzero(all_inds!=cind)[0]
コード例 #2
0
ファイル: test12.py プロジェクト: mnfienen/2011_FINAL_fishhg
# initializations 
infile = 'NatfishFinalAllobs_20111110_MNF.CSV' # filename for the main input
#infile = 'NatfishFinalAllobs_20110617_MNF.CSV'
cind = 2653


# initializations
sttime = time.time()
max_iter = 15  # maximum allowable iterations
c_iter = 0     # iteration counter starting at zero
converged = False # flag to indicate when convergence has been achieved
compcount = [np.inf] # a "comparable_count" variable compcount that keeps track of how many samples are comparable

# read and parse the input file

DL, ID, SpC, Event = cu.read_and_parse_input(infile)

# convert to arrays the lists which need to be referenced as arrays
SpC = np.array(SpC,dtype='int')
Event = np.array(Event,dtype='int')
ID = np.array(ID,dtype='int')
DL = np.array(DL, dtype='int')

total_length = len(ID)
all_inds = np.copy(ID)
lenallinds = len(all_inds)
currinds = np.nonzero(all_inds!=cind)[0]
SpC = SpC[currinds]
Event = Event[currinds]
ID = ID[currinds]
cc = ID[ID==currID]