fulldset.py 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import snlay as snlay
  2. import h5py
  3. import numpy as np
  4. from scattnlay import scattnlay
  5. import time
  6. import progressbar
  7. num_lpoints = 250
  8. lam_min = 300
  9. lam_max = 1200
  10. size_min = 30
  11. size_max = 70
  12. #dataset_size = 100000
  13. ## parameters of the dataset
  14. #num_layers = 8
  15. ##make the materials list here
  16. #mats = [3, 4, 3, 4, 3, 4, 3, 4] # 2 - silicon, silicon.dat, 1 - gold, gold.dat
  17. # # 3 - silica, silica.dat, 4 - titania, tio2.dat
  18. ##generate a huge array and then reshape
  19. #dataset_X = np.random.randint(size_min,size_max+1,num_layers*dataset_size).astype(float).reshape(dataset_size, num_layers)
  20. #lams = np.linspace(lam_min, lam_max, num_lpoints)
  21. #dataset_Y = np.zeros((dataset_size,num_lpoints))
  22. #for ind in progressbar.progressbar(np.arange(dataset_size)):
  23. # kr, m = snlay.make_xm(dataset_X[ind,:], mats, lams)
  24. # terms, dataset_Y[ind,:], Qsca, Qabs, Qbk, Qpr, g, Albedo, S1, S2 = scattnlay(kr, m)
  25. #h5f = h5py.File('./datasets/full_sio2tio2.h5', 'w')
  26. #h5f.create_dataset('sizes', data=dataset_X)
  27. #h5f.create_dataset('spectrum', data=dataset_Y)
  28. #h5f.close()