Skip to content

Commit c08be7d

Browse files
committed
Add a function used to save data in .dat files
1 parent cec3125 commit c08be7d

File tree

6 files changed

+58
-31
lines changed

6 files changed

+58
-31
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.ipynb_checkpoints
2+
*.dat

data/readme

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The .dat files saved by the program appear here.

src/KPpack/Project.toml

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
1212
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
1313
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1414
Match = "7eb4fadd-790c-5f42-8a69-bfa0b872bfbf"
15+
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
1516
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
1617
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"
1718
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

src/KPpack/src/KPpack.jl

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ using DelimitedFiles
88
using SparseArrays, BlockBandedMatrices
99
using Arpack
1010
using PyCall, PyPlot, LaTeXStrings
11+
using Printf
1112
#export Materials, parMat, DOS, DiagM, Plotbands, PlotDOS,
1213

1314
#materials parameters

src/KPpack/src/Params.jl

+9-1
Original file line numberDiff line numberDiff line change
@@ -170,4 +170,12 @@ end
170170
# Modern Physics B, 2017
171171
#
172172
# * I. Vurgaftman and J. R. Meyer , Band parameters for III–V compound semiconductors and their alloys", Journal of Applied Physics 89, 5815-5875 # (2001)
173-
# =================================================================================================================
173+
# =================================================================================================================
174+
175+
function writefile(data,name)
176+
path="../../data/$(name).dat"
177+
fout=open(path,"w")
178+
datstr=(a->(@sprintf "%10.3f" a)).(data);
179+
writedlm(fout, datstr, "" , quotes=false)
180+
close(fout)
181+
end

src/KPpack/test_Project.ipynb

+45-30
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)