Skip to content

Commit

Permalink
Minor restructuring:mMoved model parameters to top of file in create_…
Browse files Browse the repository at this point in the history
…and_save_all_data_files
  • Loading branch information
daniel-muthukrishna committed May 13, 2018
1 parent df25945 commit 1ba3571
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions dash/create_and_save_all_data_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@


if __name__ == '__main__':
modelName = 'zeroZ_trainOnAll'
modelName = 'zeroZ'
trainWithHost = True
classifyHost = False
trainFraction = 0.8
minZ = 0.
maxZ = 0.
numOfRedshifts = 1

dataDirName = os.path.join(scriptDirectory, 'data_files_{0}/'.format(modelName))
dataFilenames = []
if not os.path.exists(dataDirName):
Expand All @@ -23,13 +30,13 @@
with open(modelInfoFilename, "w") as f:
f.write("Date Time: %s\n" % time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime()))
f.write("Directory: %s\n" % dataDirName)
f.write("Add Host: True\n")
f.write("Add Host: {}\n".format(trainWithHost))
f.write("SN-Host fractions: [0.99, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1]\n")
f.write("Classify Host: False\n")
f.write("Classify Host: {}\n".format(classifyHost))
f.write("Redshift: Zero\n")
f.write("Redshift Range: 0. to 0.\n")
f.write("Num of Redshifts: 1\n")
f.write("Fraction of Training Set Used: 1.0\n")
f.write("Redshift Range: {} to {}\n".format(minZ, maxZ))
f.write("Num of Redshifts: {}\n".format(numOfRedshifts))
f.write("Fraction of Training Set Used: {}\n".format(numOfRedshifts))
f.write("Training Amount: 50 x 500000\n")
f.write("Changed wavelength range to 3000 to 10000A\n")
f.write("Set outer region to 0.5\n")
Expand All @@ -44,7 +51,7 @@
print("time spent: {0:.2f}".format(t2 - t1))

# CREATE TRAINING SET FILES
trainingSetFilename = create_training_set_files(dataDirName, minZ=0., maxZ=0., numOfRedshifts=1, trainWithHost=True, classifyHost=False, trainFraction=1.0)
trainingSetFilename = create_training_set_files(dataDirName, minZ=minZ, maxZ=maxZ, numOfRedshifts=numOfRedshifts, trainWithHost=trainWithHost, classifyHost=classifyHost, trainFraction=trainFraction)
dataFilenames.append(trainingSetFilename)
t3 = time.time()
print("time spent: {0:.2f}".format(t3 - t2))
Expand Down

0 comments on commit 1ba3571

Please sign in to comment.