This commit is contained in:
softlandia 2020-06-21 19:00:28 +04:00
Родитель e0a17919fe
Коммит 814e1a221c
41 изменённых файлов: 4167 добавлений и 984 удалений

Просмотреть файл

@ -1,4 +1,11 @@
## ver 0.1.11 // 2020.06.2 ##
## ver 0.2.0 // 2020.06.21 ##
- replace las.Logs to slice
- full change ReadDataSec
- full change SaveToBuf
- change format of Warning
## ver 0.1.11 // 2020.06.2 ##
- add new check on read
- add example/lasin -- very simple but useful

Просмотреть файл

@ -42,7 +42,7 @@ NNB : NNB
171 6.473 0 0 526.478 2215.58
172 4.481 0 0 525.681 2215.58
173 4.979 0 0 525.681 2215.58
177 6.473 0 0 525.681 2215.58
--177 6.473 0 0 525.681 2215.58
178 6.473 0 0 525.681 2215.58
179 6.722 0 0 526.478 2215.58
@ -51,8 +51,9 @@ NNB : NNB
184 6.473 0 0 526.478 2215.58
185 6.473 0 0 526.478 2215.58
186 0 1 1 1 2
186 6 4 4 4 4
186 6 4 4 4 4
2.2e11 186 6 4 4 4 4 -3 -4 -5 -6 -f -1.e10
-x 186 6 4 4 4 4
a1 1 2 3 4

Просмотреть файл

@ -1,43 +1,28 @@
**file: data\more_20_warnings.las**
0, line: 23, "__WRN__ STRT: 0.000 == STOP: 0.000"
1, line: 23, "__WRN__ STEP parameter equal 0"
2, line: 24, "can't convert string: '6.2.2' to number, set to NULL"
3, line: 25, "not all column are read, set log value to NULL"
4, line: 25, "not all column are read, set log value to NULL"
5, line: 26, "actual number of data lines more than expected, check: STRT, STOP, STEP"
6, line: 26, "expand number of points"
7, line: 27, "can't convert string: '6.2.2' to number, set to NULL"
8, line: 29, "can't convert string: '5.97.' to number, set to NULL"
9, line: 30, "actual number of data lines more than expected, check: STRT, STOP, STEP"
10, line: 30, "expand number of points"
11, line: 31, "can't convert string: '6.47.' to number, set to NULL"
12, line: 33, "actual step 64.00 ≠ global STEP 1.00"
13, line: 33, "step 64.00 ≠ previously step 1.00"
14, line: 33, "can't convert string: '5.97.' to number, set to NULL"
15, line: 35, "actual step 47.00 ≠ global STEP 1.00"
16, line: 35, "step 47.00 ≠ previously step 64.00"
17, line: 35, "can't convert string: '5.47.' to number, set to NULL"
18, line: 37, "step 1.00 ≠ previously step 47.00"
19, line: 37, "can't convert string: '4.7.' to number, set to NULL"
20, line: 38, "actual number of data lines more than expected, check: STRT, STOP, STEP"
21, line: 38, "expand number of points"
22, line: 38, "can't convert string: '4.7.' to number, set to NULL"
23, line: 40, "line: 40 is empty, ignore"
24, line: 41, "actual step -117.20 ≠ global STEP 1.00"
25, line: 41, "step -117.20 ≠ previously step 1.00"
26, line: 41, "not all column are read, set log value to NULL"
27, line: 42, "actual step 170.20 ≠ global STEP 1.00"
28, line: 42, "step 170.20 ≠ previously step -117.20"
29, line: 43, "step 1.00 ≠ previously step 170.20"
30, line: 45, "actual step 4.00 ≠ global STEP 1.00"
31, line: 45, "step 4.00 ≠ previously step 1.00"
32, line: 46, "step 1.00 ≠ previously step 4.00"
33, line: 49, "actual number of data lines more than expected, check: STRT, STOP, STEP"
34, line: 49, "expand number of points"
35, line: 49, "actual step 3.00 ≠ global STEP 1.00"
36, line: 49, "step 3.00 ≠ previously step 1.00"
37, line: 50, "step 1.00 ≠ previously step 3.00"
38, line: 54, "actual step 0.00 ≠ global STEP 1.00"
39, line: 54, "step 0.00 ≠ previously step 1.00"
40, line: 55, "actual step 0.00 ≠ global STEP 1.00"
0, line: 24, "__WRN__ STRT: 0.000 == STOP: 0.000"
1, line: 24, "__WRN__ STEP parameter equal 0"
2, line: 24, "error convert string: '6.2.24' to number, set to NULL"
3, line: 25, "line contains 5 columns, expected: 6"
4, line: 25, "error convert string: '528.07202215.58' to number, set to NULL"
5, line: 25, "for column 6 data not present, value set to NULL"
6, line: 27, "error convert string: '6.2.24' to number, set to NULL"
7, line: 29, "error convert string: '5.97.5' to number, set to NULL"
8, line: 31, "error convert string: '6.47.3' to number, set to NULL"
9, line: 33, "error convert string: '5.97.5' to number, set to NULL"
10, line: 35, "error convert string: '5.47.7' to number, set to NULL"
11, line: 37, "error convert string: '4.7.3' to number, set to NULL"
12, line: 38, "error convert string: '4.7.3' to number, set to NULL"
13, line: 40, "line contains 1 columns, expected: 6"
14, line: 40, "for column 2 data not present, value set to NULL"
15, line: 40, "for column 3 data not present, value set to NULL"
16, line: 40, "for column 4 data not present, value set to NULL"
17, line: 40, "for column 5 data not present, value set to NULL"
18, line: 40, "for column 6 data not present, value set to NULL"
19, line: 41, "line contains 9 columns, expected: 6"
20, line: 45, "dept:'--177' not numeric, line ignore"
21, line: 54, "line contains 13 columns, expected: 6"
22, line: 55, "line contains 7 columns, expected: 6"
23, line: 55, "dept:'-x' not numeric, line ignore"
24, line: 56, "line contains 5 columns, expected: 6"
25, line: 56, "dept:'a1' not numeric, line ignore"

Просмотреть файл

@ -20,9 +20,10 @@ A.US/M : 2 SONIC TRANSIT TIME
B.K/M3 : 3 BULK DENSITY
SP.V/V : 4 SP
-EL- . :
-EL-1.m :
-EL-2.v/v :
-EL-3. :
-EL-5.m :
-EL-6.v/v :
-EL-7.m V :
-EL-58.m :
~Params ----------------------------------------------------
BHT .DEGC 35.5 : BOTTOM HOLE TEMPERATURE
BS .MM 200.0 : BIT SIZE
@ -35,6 +36,7 @@ DFD .K/M3 1525.0 : DRILL FLUID DENSITY
Note: The logging tools became stuck at 625 meters causing the data
between 625 meters and 615 meters to be invalid.
~ASCII -----------------------------------------------------
1670.00000 123.45000 2550.00000 0.45000 123.45000 123.45000 110.20000 105.60000
1669.87500 123.45000 2550.00000 0.45000 123.45000 123.45000 110.20000 105.60000
1669.75000 123.45000 2550.00000 0.45000 123.45000 123.45000 110.20000 105.60000
# DEPT | A | B | SP | -EL- | -EL-5 | -EL-6 | -EL-7 | -EL-58 |
1670.000 123.450 2550.0000 0.4500 123.4500 123.4500 110.2000 105.6000 0
1669.875 123.450 2550.0000 0.4500 123.4500 123.4500 110.2000 105.6000 1
1669.750 123.450 2550.0000 0.4500 123.4500 123.4500 110.2000 105.6000 2

Просмотреть файл

@ -23,6 +23,7 @@ SP.V/V : 4 NEUTRON POROSITY
.m :
.v/v :
.m V :
-EL-5.m :
~Params ----------------------------------------------------
BHT .DEGC 35.5 : BOTTOM HOLE TEMPERATURE
BS .MM 200.0 : BIT SIZE
@ -35,6 +36,6 @@ DFD .K/M3 1525.0 : DRILL FLUID DENSITY
Note: The logging tools became stuck at 625 meters causing the data
between 625 meters and 615 meters to be invalid.
~ASCII -----------------------------------------------------
1670.00000 123.45000 2550.00000 0.45000 123.45000 123.45000 110.20000 105.60000
1669.87500 123.45000 2550.00000 0.45000 123.45000 123.45000 110.20000 105.60000
1669.75000 123.45000 2550.00000 0.45000 123.45000 123.45000 110.20000 105.60000
1670.00000 123.45000 2550.00000 0.45000 123.45000 123.45000 110.20000 105.60000 0
1669.87500 123.45000 2550.00000 0.45000 123.45000 123.45000 110.20000 105.60000 1
1669.75000 123.45000 2550.00000 0.45000 123.45000 123.45000 110.20000 105.60000 2

Просмотреть файл

@ -1,23 +1,21 @@
**file: data\more_20_warnings.las**
0, line: 23, "__WRN__ STRT: 0.000 == STOP: 0.000"
1, line: 23, "__WRN__ STEP parameter equal 0"
2, line: 24, "can't convert string: '6.2.2' to number, set to NULL"
3, line: 25, "not all column are read, set log value to NULL"
4, line: 25, "not all column are read, set log value to NULL"
5, line: 26, "actual number of data lines more than expected, check: STRT, STOP, STEP"
6, line: 26, "expand number of points"
7, line: 27, "can't convert string: '6.2.2' to number, set to NULL"
8, line: 29, "can't convert string: '5.97.' to number, set to NULL"
9, line: 30, "actual number of data lines more than expected, check: STRT, STOP, STEP"
10, line: 30, "expand number of points"
11, line: 31, "can't convert string: '6.47.' to number, set to NULL"
12, line: 33, "actual step 64.00 ≠ global STEP 1.00"
13, line: 33, "step 64.00 ≠ previously step 1.00"
14, line: 33, "can't convert string: '5.97.' to number, set to NULL"
15, line: 35, "actual step 47.00 ≠ global STEP 1.00"
16, line: 35, "step 47.00 ≠ previously step 64.00"
17, line: 35, "can't convert string: '5.47.' to number, set to NULL"
18, line: 37, "step 1.00 ≠ previously step 47.00"
19, line: 37, "can't convert string: '4.7.' to number, set to NULL"
20, line: 0, "*maximum count* of warning reached, change parameter 'maxWarningCount' in 'glas.ini'"
line: 24, "__WRN__ STRT: 0.000 == STOP: 0.000"
line: 24, "__WRN__ STEP parameter equal 0"
line: 24, "error convert string: '6.2.24' to number, set to NULL"
line: 25, "line contains 5 columns, expected: 6"
line: 25, "error convert string: '528.07202215.58' to number, set to NULL"
line: 25, "for column 6 data not present, value set to NULL"
line: 27, "error convert string: '6.2.24' to number, set to NULL"
line: 29, "error convert string: '5.97.5' to number, set to NULL"
line: 31, "error convert string: '6.47.3' to number, set to NULL"
line: 33, "error convert string: '5.97.5' to number, set to NULL"
line: 35, "error convert string: '5.47.7' to number, set to NULL"
line: 37, "error convert string: '4.7.3' to number, set to NULL"
line: 38, "error convert string: '4.7.3' to number, set to NULL"
line: 40, "line contains 1 columns, expected: 6"
line: 40, "for column 2 data not present, value set to NULL"
line: 40, "for column 3 data not present, value set to NULL"
line: 40, "for column 4 data not present, value set to NULL"
line: 40, "for column 5 data not present, value set to NULL"
line: 40, "for column 6 data not present, value set to NULL"
line: 41, "line contains 9 columns, expected: 6"
line: 0, "*maximum count* of warning reached, change parameter 'maxWarningCount' in 'glas.ini'"

Просмотреть файл

@ -7,12 +7,15 @@ import (
"github.com/softlandia/glasio"
)
//Пример чтения и сохранения нескольких LAS файлов
// Sample
// read one file and print to stdout all warnings:
// warning number, number of line in las file, message
func main() {
if len(os.Args) == 1 {
fmt.Printf("using:\nlasin fileName.las\n")
os.Exit(0)
}
//glasio.MaxWarningCount = 100
las := glasio.NewLas()
_, err := las.Open(os.Args[1])
if err != nil {

Просмотреть файл

@ -0,0 +1,76 @@
~Version information
VERS. 1.20: CWLS LAS - VERSION 1.20
WRAP. NO: One line per depth step
~Well information
# MNEM.UNIT DATA TYPE INFORMATION
# ====.================================: ===================
STRT.M 0.000: First depth in file
STOP.M 0.000: Last depth in file
STEP.M 0.000: Depth increment
NULL.M -32768.000: Null values
COMP. COMPANY:
WELL. WELL: 6
FLD . FIELD: <20>ਬ¥à­®¥
~Curve information
# MNEM.UNIT API CODE CURVE DESCRIPTION
# ====.================================:====================
DEPT.M : Depth curve
GK : GK
NNM : NNM
NNB : NNB
¯¥à¢ë© : íàòÿæåíè
¢â®à®© ª à®â ¦ :
~ASCII Log Data
1 6.2.24 -0 0 528.072 2215.58
2 5.228 -32768 -32768.0 528.07202215.58
3 6.2.24 0 0 528.869 2215.58
4 5.97.5 0 0 528.072 2215.58
5 6.47.3 0 0 528.072 2215.58
69 5.97.5 0 0 527.275 2215.58
116 5.47.7 0 0 526.478 2215.58
117 4.7.3 0 0 526.478 2215.58
118 4.7.3 0 0 525.681 2215.58
9
.8000 2.792 2.444 230.369 3.352 347.843 331.759 363.413 7.326
171 6.473 0 0 526.478 2215.58
172 4.481 0 0 525.681 2215.58
173 4.979 0 0 525.681 2215.58
--177 6.473 0 0 525.681 2215.58
178 6.473 0 0 525.681 2215.58
179 6.722 0 0 526.478 2215.58
182 6.224 0 0 527.275 2215.58
183 6.473 0 0 526.478 2215.58
184 6.473 0 0 526.478 2215.58
185 6.473 0 0 526.478 2215.58
186 0 1 1 1 2
2.2e11 186 6 4 4 4 4 -3 -4 -5 -6 -f -1.e10
-x 186 6 4 4 4 4
a1 1 2 3 4

Просмотреть файл

@ -0,0 +1,89 @@
~Version Information
VERS. 1.20: CWLS log ASCII Standard -VERSION 1.20
WRAP. YES: Multiple lines per depth step
~Well Information
#MNEM.UNIT Data Type Information
#--------- ------------- ------------------------------
STRT.M 910.000:
STOP.M 901.000:
STEP.M -0.1250:
NULL. -999.2500: Null value
COMP. COMPANY: ANY OIL COMPANY INC.
WELL. WELL: ANY ET AL XX-XX-XX-XX
FLD . FIELD: WILDCAT
LOC . LOCATION: XX-XX-XX-XXW3M
PROV. PROVINCE: SASKATCHEWAN
SRVC. SERVICE COMPANY: ANY LOGGING COMPANY INC.
SON . SERVICE ORDER : 142085
DATE. LOG DATE: 13-DEC-86
UWI . UNIQUE WELL ID:
~Curve Information
#MNEM.UNIT API CODE Curve Description
#--------- ------------- ------------------------------
DEPT.M : Depth
DT .US/M : 1 Sonic Travel Time
RHOB.K/M : 2 Density-Bulk Density
NPHI.V/V : 3 Porosity -Neutron
RX0 .OHMM : 4 Resistivity -Rxo
RESS.OHMM : 5 Resistivity -Shallow
RESM.OHMM : 6 Resistivity -Medium
RESD.OHMM : 7 Resistivity -Deep
SP .MV : 8 Spon. Potential
GR .GAPI : 9 Gamma Ray
CALI.MM : 10 Caliper
DRHO.K/M3 : 11 Delta-Rho
EATT.DBM : 12 EPT Attenuation
TPL .NS/M : 13 TP -EPT
PEF . : 14 PhotoElectric Factor
FFI .V/V : 15 Porosity -NML FFI
DCAL.MM : 16 Caliper-Differential
RHGF.K/M3 : 17 Density-Formation
RHGA.K/M3 : 18 Density-Apparent
SPBL.MV : 19 Baselined SP
GRC .GAPI : 20 Gamma Ray BHC
PHIA.V/V : 21 Porosity -Apparent
PHID.V/V : 22 Porosity -Density
PHIE.V/V : 23 Porosity -Effective
PHIN.V/V : 24 Porosity -Neut BHC
PHIC.V/V : 25 Porosity -Total HCC
R0 .OHMM : 26 Ro
RWA .OHMM : 27 Rfa
SW . : 28 Sw -Effective
MSI . : 29 Sh Idx -Min
BVW . : 30 BVW
FGAS. : 31 Flag -Gas Index
PIDX. : 32 Prod Idx
FBH . : 33 Flag -Bad Hole
FHCC. : 34 Flag -HC Correction
LSWB. : 35 Flag -Limit SWB
~A Log data section
910.000000
-999.2500 2692.7075 0.3140 19.4086 19.4086 13.1709 12.2681
-1.5010 96.5306 204.7177 30.5822 -999.2500 -999.2500 3.2515
-999.2500 4.7177 3025.0264 3025.0264 -1.5010 93.1378 0.1641
0.0101 0.1641 0.3140 0.1641 11.1397 0.3304 0.9529
0.0000 0.1564 0.0000 11.1397 0.0000 0.0000 0.0000
909.875000
-999.2500 2712.6460 0.2886 23.3987 23.3987 13.6129 12.4744
-1.4720 90.2803 203.1093 18.7566 -999.2500 -999.2500 3.7058
-999.2500 3.1093 3004.6050 3004.6050 -1.4720 86.9078 0.1456
-0.0015 0.1456 0.2886 0.1456 14.1428 0.2646 1.0000
0.0000 0.1456 0.0000 14.1428 0.0000 0.0000 0.0000
909.750000
-999.2500 2692.8137 0.2730 22.5909 22.5909 13.6821 12.6146
-1.4804 89.8492 201.9287 3.1551 -999.2500 -999.2500 4.3124
-999.2500 1.9287 2976.4451 2976.4451 -1.4804 86.3465 0.1435
0.0101 0.1435 0.2730 0.1435 14.5674 0.2598 1.0000
0.0000 0.1435 0.0000 14.5674 0.0000 0.0000 0.0000
909.625000
-999.2500 2644.3650 0.2765 18.4831 18.4831 13.4159 12.6900
-1.5010 93.3999 201.5826 -6.5861 -999.2500 -999.2500 4.3822
-999.2500 1.5826 2955.3528 2955.3528 -1.5010 89.7142 0.1590
0.0384 0.1590 0.2765 0.1590 11.8600 0.3210 0.9667
0.0000 0.1538 0.0000 11.8600 0.0000 0.0000 0.0000
909.500000
-999.2500 2586.2822 0.2996 13.9187 13.9187 12.9195 12.7016
-1.4916 98.1214 201.7126 -4.5574 -999.2500 -999.2500 3.5967
-999.2500 1.7126 2953.5940 2953.5940 -1.4916 94.2670 0.1880
0.0723 0.1880 0.2996 0.1880 8.4863 0.4490 0.8174
0.0000 0.1537 0.0000 8.4863 0.0000 0.0000 0.0000

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,142 @@
~Version information
VERS. 2.0 : glas (c) softlandia@gmail.com
WRAP. NO : ONE LINE PER DEPTH STEP
~Well information
STRT.M 0.050 :START DEPTH
STOP.M 136.600 :STOP DEPTH
STEP.M 0.050 :STEP
NULL. -99999.000 :NULL VALUE
WELL. Scorpio E1 :WELL
~Curve Information Section
DEPT.M :
CALI.MM :
DFAR.G/CM3 :
DNEAR.G/CM3 :
GAMN.GAPI :
NEUT.CPS :
PR.OHM/M :
SP.MV :
COND.MS/M :
~ASCII Log Data
# DEPT | CALI | DFAR | DNEAR | GAMN | NEUT | PR | SP | COND |
12.0000 101.7800 0.8830 0.8140 65.0846 1152.0100 50499.9000 100.5920 822.6800
12.0500 101.7380 0.8830 0.8430 65.0800 1233.9900 50499.9000 100.5100 810.8240
12.1000 101.7380 0.8730 0.8080 53.4612 1212.0000 50499.9000 100.5800 801.4390
12.1500 101.8580 0.8780 0.8130 79.0231 1161.0100 50499.9000 100.5550 796.7450
12.2000 101.7980 0.8780 0.7870 41.8448 1080.0200 50499.9000 100.5520 785.1370
12.2500 101.7560 0.8690 0.7650 81.3450 1188.9800 50499.9000 100.5370 772.2930
12.3000 101.8040 0.8820 0.8110 67.4063 1164.0000 50499.9000 100.5800 757.9660
12.3500 101.7980 0.8800 0.8230 74.3767 1169.0000 50499.9000 100.5430 757.9650
12.4000 101.8520 0.8770 0.8230 62.7573 1202.0000 50499.9000 100.5430 735.7380
12.4500 101.8700 0.8780 0.8260 58.1080 1168.0100 50499.9000 100.5860 716.9670
12.5000 101.9060 0.8700 0.8500 60.4316 1179.0000 50499.9000 100.5400 715.4810
12.5500 101.8160 0.8830 0.8620 69.7281 1146.0000 50499.9000 100.5100 713.9990
12.6000 101.7140 0.8640 0.8150 53.4621 1169.0000 50499.9000 100.5490 730.5450
12.6500 101.7680 0.8630 0.8020 81.3478 1182.0000 50499.9000 100.5190 738.6980
12.7000 101.8160 0.8690 0.8080 51.1413 1156.0100 50499.9000 100.5370 757.4670
12.7500 101.8280 0.8750 0.7970 83.6700 1154.0000 50499.9000 100.5400 775.7460
12.8000 101.6960 0.8650 0.9070 58.1094 1142.0000 50499.9000 100.5430 790.3210
12.8500 101.6900 0.8670 0.8080 65.0787 1146.0000 50499.9000 100.5160 790.3220
12.9000 101.7440 0.8510 0.8260 72.0522 1171.0000 50499.9000 100.4940 806.8690
12.9500 101.6600 0.8510 0.7960 53.4629 1119.0100 50499.9000 100.5280 816.7490
13.0000 101.6000 0.8370 0.8150 67.4029 1070.0100 50499.9000 100.5310 826.3830
13.0500 101.7080 0.8390 0.8130 74.3773 1150.9900 50499.9000 100.5190 835.5220
13.1000 101.7800 0.8380 0.8280 81.3497 1256.9800 50499.9000 100.5310 848.8580
13.1500 101.7920 0.8370 0.8090 79.0263 1291.0000 50499.9000 100.5130 861.2100
13.2000 101.6180 0.8470 0.7610 97.6171 1301.0000 50499.9000 100.5310 861.2110
13.2500 101.5760 0.8460 0.7970 65.0850 1371.9900 50499.9000 100.5430 881.4620
13.3000 101.6060 0.8450 0.7670 85.9970 1358.0000 50499.9000 100.5280 885.4170
13.3500 101.5040 0.8220 0.8390 65.0840 1368.0000 50499.9000 100.4820 885.9110
13.4000 101.5160 0.7930 0.8760 85.9966 1482.9900 50499.9000 100.5400 889.6160
13.4500 101.5400 0.7260 0.8960 65.0844 1423.0100 50499.9000 100.5190 895.2960
13.5000 101.5460 0.7250 0.8970 111.5590 1350.0100 50499.9000 100.5100 900.7300
13.5500 101.4500 0.7250 0.8940 74.3815 1156.0200 50499.9000 100.5430 905.6710
13.6000 101.6120 0.7630 0.8990 90.6449 1013.0300 50499.9000 100.4850 906.6590
13.6500 101.7440 0.7550 0.8350 81.3521 876.0160 50499.9000 100.4730 894.8040
13.7000 101.7620 0.7930 0.8090 58.1119 798.0160 50499.9000 100.4970 883.1960
13.7500 101.7620 0.8360 0.7830 62.7553 629.0260 50499.9000 100.4760 915.5460
13.8000 101.7920 0.9590 0.6830 69.7283 618.0010 50499.9000 100.4760 945.1880
13.8500 101.8160 1.0450 0.6570 76.7007 659.9920 50499.9000 100.4700 945.9320
13.9000 101.6960 1.1330 0.8000 58.1091 689.9970 50499.9000 100.4760 922.7170
13.9500 101.6960 1.2310 1.1110 79.0216 765.9840 50499.9000 100.4910 757.0120
14.0000 101.6660 1.3400 1.4340 60.4348 753.0020 50499.9000 100.4330 941.7050
14.0500 101.6900 1.3860 1.4630 67.4043 741.0010 50499.9000 100.4240 1071.6400
14.1000 101.8580 1.3580 1.4620 74.3767 734.0010 50499.9000 100.4000 1215.1300
14.1500 101.8100 1.3570 1.4710 53.4614 767.9960 50499.9000 100.3810 863.9680
14.2000 101.7920 1.3540 1.5580 55.7825 730.0080 50499.9000 100.3420 699.7070
14.2500 101.8280 1.3780 1.6660 67.4032 747.9970 50499.9000 100.3600 333.1810
14.3000 101.8100 1.3720 1.7420 62.7564 762.9990 50499.9000 100.2960 36.2593
14.3500 101.5400 1.4230 1.7780 62.7560 793.9940 50499.9000 100.3140 26.8468
14.4000 101.5400 1.4250 1.6670 53.4601 776.0020 50499.9000 100.2750 24.3753
14.4500 101.5160 1.4170 1.6080 74.3736 854.9830 50499.9000 100.2990 89.3224
14.5000 101.5160 1.4160 1.5420 46.4903 827.0040 50499.9000 100.2140 479.2890
14.5500 101.4980 1.4120 1.5570 60.4307 886.9940 50499.9000 100.2140 282.7560
14.6000 101.5040 1.4480 1.6720 60.4320 869.0030 50499.9000 100.3750 398.8050
14.6500 101.5400 1.4300 1.5900 69.7279 863.0010 50499.9000 100.5550 411.6700
14.7000 101.3480 1.4130 1.5780 32.5478 869.9990 50499.9000 100.6070 697.6370
14.7500 101.3660 1.4360 1.5810 88.3145 884.9980 50499.9000 100.6100 1003.4400
14.8000 101.4200 1.3820 1.5140 85.9992 919.9970 50499.9000 100.5980 1050.1600
14.8500 101.4080 1.3910 1.5430 92.9707 879.0080 50499.9000 100.6010 944.4700
14.9000 101.3600 1.4090 1.5060 81.3523 909.9960 50499.9000 100.5620 819.7290
14.9500 101.3180 1.3840 1.5160 60.4364 931.9950 50499.9000 100.5620 805.8860
15.0000 101.3240 1.3820 1.4390 72.0512 954.9960 50499.9000 100.5680 758.2190
15.0500 101.3480 1.3900 1.5100 76.7016 986.9970 50499.9000 100.5620 733.7610
15.1000 101.3070 1.3980 1.5000 123.1790 970.0030 50499.9000 100.5740 685.3560
15.1500 101.2830 1.4230 1.5290 60.4392 953.0020 50499.9000 100.5490 647.0660
15.2000 101.3780 1.4270 1.5380 67.4035 925.0060 50499.9000 100.5920 631.5040
15.2500 101.2950 1.4180 1.5400 106.9120 899.0040 50499.9000 100.5740 613.2260
15.3000 101.2830 1.4090 1.4680 83.6772 952.9950 50499.9000 100.5620 589.5130
15.3500 101.3960 1.3980 1.4790 85.9986 967.9970 50499.9000 100.6620 570.7430
15.4000 101.3600 1.4380 1.4710 74.3793 926.0050 50499.9000 100.6040 560.3660
15.4500 101.3720 1.4370 1.5500 58.1104 924.0000 50499.9000 100.6160 544.5600
15.5000 101.3480 1.4290 1.5430 95.2903 936.9980 50499.9000 100.6100 528.5040
15.5500 101.4080 1.4200 1.5370 69.7314 968.9970 50499.9000 100.6320 525.2910
15.6000 101.4020 1.4370 1.5530 76.7007 922.0090 50499.9000 100.6010 510.7210
15.6500 101.4980 1.4480 1.5110 97.6186 934.9990 50499.9000 100.5860 505.0380
15.7000 101.4320 1.4660 1.5500 81.3544 931.0010 50499.9000 100.5950 504.0490
15.7500 101.5160 1.4370 1.4850 72.0544 945.9980 50499.9000 100.5980 495.4050
15.8000 101.5940 1.4370 1.4810 69.7292 913.0030 50499.9000 100.6130 492.1930
15.8500 101.5280 1.4310 1.5090 76.7007 903.0020 50499.9000 100.5710 481.3270
15.9000 101.5340 1.4520 1.5240 72.0535 964.9930 50499.9000 100.5860 478.8550
15.9500 101.5280 1.4400 1.5390 67.4060 937.0060 50499.9000 100.6070 471.9400
16.0000 101.5280 1.4630 1.5680 69.7286 925.0020 50499.9000 100.6010 466.2590
16.0500 101.5280 1.4780 1.5590 65.0804 909.0010 50499.9000 100.6160 465.0230
16.1000 101.6600 1.4920 1.5560 69.7281 920.9980 50499.9000 100.6290 453.6630
16.1500 101.7320 1.4870 1.5680 85.9971 924.0000 50499.9000 100.6290 449.7090
16.2000 101.6960 1.4710 1.6060 95.2939 906.0040 50499.9000 100.6410 448.9680
16.2500 101.7140 1.4970 1.5800 113.8880 980.9890 50499.9000 100.6320 448.9680
16.3000 101.6960 1.4870 1.6000 74.3810 949.0020 50499.9000 100.6320 444.2750
16.3500 101.6600 1.4780 1.5870 90.6449 908.0080 50499.9000 100.6130 437.8540
16.4000 101.6660 1.5030 1.5850 88.3233 899.0010 50499.9000 100.6160 433.9010
16.4500 101.7800 1.4870 1.5570 83.6761 934.9920 50499.9000 100.6160 432.9130
16.5000 101.7200 1.4880 1.5680 60.4355 956.9970 50499.9000 100.6040 423.5280
16.5500 101.6240 1.4910 1.5760 104.5900 969.9990 50499.9000 100.6290 413.6480
16.6000 101.6960 1.4860 1.5720 123.1840 954.0030 50499.9000 100.6530 399.5710
16.6500 101.6960 1.5010 1.5980 88.3270 933.0020 50499.9000 100.6410 386.4780
16.7000 101.6840 1.4950 1.5470 51.1435 1023.9800 50499.9000 100.5980 381.5380
16.7500 101.7080 1.4930 1.5820 79.0217 950.0110 50499.9000 100.6320 374.1280
16.8000 101.6900 1.4830 1.5300 58.1086 1002.0000 50499.9000 100.6260 362.7660
16.8500 101.6900 1.4900 1.5340 74.3749 1030.9900 50499.9000 100.6010 349.4300
16.9000 101.7620 1.4740 1.5250 67.4058 1074.0000 50499.9000 100.5950 345.4750
16.9500 101.8400 1.5050 1.5430 120.8520 1161.9800 50499.9000 100.6160 334.6090
17.0000 101.6360 1.4820 1.5620 69.7368 1113.0100 50499.9000 100.6040 328.9270
17.0500 101.6120 1.4890 1.5270 69.7290 1051.0000 50499.9000 100.6290 303.4870
17.1000 101.5760 1.4760 1.5240 99.9392 1067.0000 50499.9000 100.6200 270.8870
17.1500 101.6180 1.4550 1.5220 55.7881 1167.9900 50499.9000 100.6070 256.5570
17.2000 101.4920 1.4820 1.5320 83.6686 1312.9700 50499.9000 100.5950 221.4890
17.2500 102.7150 1.4870 1.4990 109.2380 1478.9700 50499.9000 100.5310 227.9020
17.3000 101.1570 1.4770 1.4560 76.7045 1536.0000 50499.9000 100.5550 199.2530
17.3500 101.4320 1.4550 1.5480 83.6737 1584.9900 50499.9000 100.5310 168.8760
17.4000 101.6360 1.4440 1.5300 69.7306 1592.0000 50499.9000 100.5190 128.6140
17.4500 101.5940 1.4550 1.4800 62.7576 1483.0200 50499.9000 100.5620 125.6460
17.5000 101.4740 1.4600 1.4600 76.6999 1557.9900 50499.9000 100.5190 108.8520
17.5500 101.5460 1.4180 1.4870 76.7020 1546.0000 50499.9000 100.5430 101.9340
17.6000 101.3660 1.4290 1.4890 81.3501 1604.9900 50499.9000 100.5490 98.2287
17.6500 101.3180 1.3740 1.4900 85.9985 1546.0100 50499.9000 100.5370 85.1385
17.7000 101.3840 1.4010 1.4770 90.6469 1518.0100 50499.9000 100.5490 76.2470
17.7500 101.3840 1.3910 1.4660 81.3524 1469.0100 50499.9000 100.5650 78.4677
17.8000 101.2950 1.3740 1.4900 104.5910 1438.0000 50499.9000 100.5550 65.1310
17.8500 101.2230 1.3820 1.4650 88.3261 1403.0100 50499.9000 100.5550 66.1178
17.9000 101.2410 1.4170 1.4820 90.6477 1413.0000 50499.9000 100.5370 68.8347
17.9500 101.2350 1.3780 1.4510 95.2949 1316.0200 50499.9000 100.5580 69.3289
18.0000 101.2590 1.3810 1.4260 88.3241 1347.0000 50499.9000 100.5620 65.3776

Просмотреть файл

@ -0,0 +1,23 @@
~Version information
VERS. 2.0 : glas (c) softlandia@gmail.com
WRAP. NO : ONE LINE PER DEPTH STEP
~Well information
STRT.M 1670.000 :START DEPTH
STOP.M 1660.000 :STOP DEPTH
STEP.M -0.125 :STEP
NULL. -999.250 :NULL VALUE
WELL. ANY ET AL OIL WELL #12 :WELL
~Curve Information Section
DEPT.M :
DT.US/M :
RHOB.K/M3 :
NPHI.V/V :
SFLU.OHMM :
SFLA.OHMM :
ILM.OHMM :
ILD.OHMM :
~ASCII Log Data
# DEPT | DT | RHOB | NPHI | SFLU | SFLA | ILM | ILD |
1670.0000 123.4500 2550.0000 0.4500 123.4500 123.4500 110.2000 105.6000
1669.8750 123.4500 2550.0000 0.4500 123.4500 123.4500 110.2000 105.6000
1669.7500 123.4500 2550.0000 0.4500 123.4500 123.4500 110.2000 105.6000

Просмотреть файл

@ -0,0 +1,23 @@
~Version information
VERS. 2.0 : glas (c) softlandia@gmail.com
WRAP. NO : ONE LINE PER DEPTH STEP
~Well information
STRT.M 1670.000 :START DEPTH
STOP.M 1660.000 :STOP DEPTH
STEP.M -0.125 :STEP
NULL. -999.250 :NULL VALUE
WELL. AAAAA_2 :WELL
~Curve Information Section
DEPT.M :
DT.US/M 60 520 32 00 :
RHOB.K/M3 45 350 01 00 :
NPHI.V/V 42 890 00 00 :
SFLU.OHMM 07 220 04 00 :
SFLA.OHMM 07 222 01 00 :
ILM.OHMM 07 120 44 00 :
ILD.OHMM 07 120 46 00 :
~ASCII Log Data
# DEPT | DT | RHOB | NPHI | SFLU | SFLA | ILM | ILD |
1670.0000 123.4500 2550.0000 0.4500 123.4500 123.4500 110.2000 105.6000
1669.8750 123.4500 2550.0000 0.4500 123.4500 123.4500 110.2000 105.6000
1669.7500 123.4500 2550.0000 0.4500 123.4500 123.4500 110.2000 105.6000

Просмотреть файл

@ -0,0 +1,23 @@
~Version information
VERS. 2.0 : glas (c) softlandia@gmail.com
WRAP. NO : ONE LINE PER DEPTH STEP
~Well information
STRT.M 1670.000 :START DEPTH
STOP.M 1660.000 :STOP DEPTH
STEP.M -0.125 :STEP
NULL. -999.250 :NULL VALUE
WELL. ANY ET AL OIL WELL #12 :WELL
~Curve Information Section
DEPT.M :
DT.US/M :
RHOB.K/M3 :
NPHI.V/V :
SFLU.OHMM :
SFLA.OHMM :
ILM.OHMM :
ILD.OHMM :
~ASCII Log Data
# DEPT | DT | RHOB | NPHI | SFLU | SFLA | ILM | ILD |
1670.0000 123.4500 2550.0000 0.4500 123.4500 123.4500 110.2000 105.6000
1669.8750 123.4500 2550.0000 0.4500 123.4500 123.4500 110.2000 105.6000
1669.7500 123.4500 2550.0000 0.4500 123.4500 123.4500 110.2000 105.6000

Просмотреть файл

@ -0,0 +1,19 @@
~Version information
VERS. 2.0 : glas (c) softlandia@gmail.com
WRAP. NO : ONE LINE PER DEPTH STEP
~Well information
STRT.M 1670.000 :START DEPTH
STOP.M 1660.000 :STOP DEPTH
STEP.M -0.125 :STEP
NULL. -999.250 :NULL VALUE
WELL. ANY ET AL OIL WELL #12 :WELL
~Curve Information Section
DEPT.M :
A.US/M :
B.K/M3 :
C.V/V :
~ASCII Log Data
# D | A | B | C |
1670.0000 123.4500 2550.0000 0.4500
1669.8750 123.4500 2550.0000 0.4500
1669.7500 123.4500 2550.0000 0.4500

Просмотреть файл

@ -0,0 +1,23 @@
~Version information
VERS. 2.0 : glas (c) softlandia@gmail.com
WRAP. NO : ONE LINE PER DEPTH STEP
~Well information
STRT.M 1670.000 :START DEPTH
STOP.M 1660.000 :STOP DEPTH
STEP.M -0.125 :STEP
NULL. -999.250 :NULL VALUE
WELL. AAAAA_2 :WELL
~Curve Information Section
DEPT.M :
DT.US/M 60 520 32 00 :
RHOB.K/M3 45 350 01 00 :
NPHI.V/V 42 890 00 00 :
SFLU.OHMM 07 220 04 00 :
SFLA.OHMM 07 222 01 00 :
ILM.OHMM 07 120 44 00 :
ILD.OHMM 07 120 46 00 :
~ASCII Log Data
# DEPT | DT | RHOB | NPHI | SFLU | SFLA | ILM | ILD |
1670.0000 123.4500 2550.0000 0.4500 123.4500 123.4500 110.2000 105.6000
1669.8750 123.4500 2550.0000 0.4500 123.4500 123.4500 110.2000 105.6000
1669.7500 123.4500 2550.0000 0.4500 123.4500 123.4500 110.2000 105.6000

Просмотреть файл

@ -0,0 +1,23 @@
~Version information
VERS. 2.0 : glas (c) softlandia@gmail.com
WRAP. NO : ONE LINE PER DEPTH STEP
~Well information
STRT.M 1670.000 :START DEPTH
STOP.M 1660.000 :STOP DEPTH
STEP.M -0.125 :STEP
NULL. -999.250 :NULL VALUE
WELL. AAAAA_2 :WELL
~Curve Information Section
DEPT.M :
DT.US/M 60 520 32 00 :
RHOB.K/M3 45 350 01 00 :
NPHI.V/V 42 890 00 00 :
SFLU.OHMM 07 220 04 00 :
SFLA.OHMM 07 222 01 00 :
ILM.OHMM 07 120 44 00 :
ILD.OHMM 07 120 46 00 :
~ASCII Log Data
# DEPT | DT | RHOB | NPHI | SFLU | SFLA | ILM | ILD |
1670.0000 123.4500 2550.0000 0.4500 123.4500 123.4500 110.2000 105.6000
1669.8750 123.4500 2550.0000 0.4500 123.4500 123.4500 110.2000 105.6000
1669.7500 123.4500 2550.0000 0.4500 123.4500 123.4500 110.2000 105.6000

Просмотреть файл

@ -0,0 +1,23 @@
~Version information
VERS. 2.0 : glas (c) softlandia@gmail.com
WRAP. NO : ONE LINE PER DEPTH STEP
~Well information
STRT.M 1670.000 :START DEPTH
STOP.M 1660.000 :STOP DEPTH
STEP.M -0.125 :STEP
NULL. -999.250 :NULL VALUE
WELL. ANY ET AL OIL WELL #12 :WELL
~Curve Information Section
DEPT.M :
DT.US/M :
RHOB.K/M3 :
NPHI.V/V :
SFLU.OHMM :
SFLA.OHMM :
ILM.OHMM :
ILD.OHMM :
~ASCII Log Data
# DEPT | DT | RHOB | NPHI | SFLU | SFLA | ILM | ILD |
1670.0000 123.4500 2550.0000 0.4500 123.4500 123.4500 110.2000 105.6000
1669.8750 123.4500 2550.0000 0.4500 123.4500 123.4500 110.2000 105.6000
1669.7500 123.4500 2550.0000 0.4500 123.4500 123.4500 110.2000 105.6000

Просмотреть файл

@ -0,0 +1,41 @@
~Version ---------------------------------------------------
VERS. 1.2 : CWLS LOG ASCII STANDARD - VERSION 1.2
WRAP. NO : ONE LINE PER DEPTH STEP
~Well ------------------------------------------------------
STRT .M 1670.0 :
STOP .M 1669.75 :
STEP .M -0.125 :
NULL . -999.25 :
COMPANY. COMPANY : # ANY OIL COMPANY LTD.
WELL . WELL : ANY ET AL OIL WELL #12
FLD . FIELD : EDAM
LOC . LOCATION : A9-16-49-20W3M
PROV . PROVINCE : SASKATCHEWAN
SRVC . SERVICE : The company that did this logging has a very very long name....
DATE . LOG DATE : 25-DEC-1988
UWI . WELL ID : 100091604920W300
~Curve Information -----------------------------------------
D.M : 1 DEPTH
A.US/M : 2 SONIC TRANSIT TIME
B.K/M3 : 3 BULK DENSITY
SP.V/V : 4 NEUTRON POROSITY
. :
.m :
.v/v :
.m V :
-EL-5.m :
~Params ----------------------------------------------------
BHT .DEGC 35.5 : BOTTOM HOLE TEMPERATURE
BS .MM 200.0 : BIT SIZE
FD .K/M3 1000.0 : FLUID DENSITY
MATR. 0.0 : NEUTRON MATRIX(0=LIME,1=SAND,2=DOLO)
MDEN. 2710.0 : LOGGING MATRIX DENSITY
RMF .OHMM 0.216 : MUD FILTRATE RESISTIVITY
DFD .K/M3 1525.0 : DRILL FLUID DENSITY
~Other -----------------------------------------------------
Note: The logging tools became stuck at 625 meters causing the data
between 625 meters and 615 meters to be invalid.
~ASCII -----------------------------------------------------
1670.00000 123.45000 2550.00000 0.45000 123.45000 123.45000 110.20000 105.60000
1669.87500 123.45000 2550.00000 0.45000 123.45000 123.45000 110.20000 105.60000
1669.75000 123.45000 2550.00000 0.45000 123.45000 123.45000 110.20000 105.60000

Просмотреть файл

@ -0,0 +1,24 @@
~Version information
VERS. 2.0 : glas (c) softlandia@gmail.com
WRAP. NO : ONE LINE PER DEPTH STEP
~Well information
STRT.M 1670.000 :START DEPTH
STOP.M 1669.750 :STOP DEPTH
STEP.M -0.125 :STEP
NULL. -999.250 :NULL VALUE
WELL. ANY ET AL OIL WELL #12 :WELL
~Curve Information Section
DEPT.M :
A.US/M :
B.K/M3 :
SP.V/V :
-EL-. :
-EL-5.m :
-EL-6.v/v :
-EL-7.m V :
-EL-58.m :
~ASCII Log Data
# D | A | B | SP | -EL- | -EL-5 | -EL-6 | -EL-7 | -EL-58 |
1670.0000 123.4500 2550.0000 0.4500 123.4500 123.4500 110.2000 105.6000 -999.2500
1669.8750 123.4500 2550.0000 0.4500 123.4500 123.4500 110.2000 105.6000 -999.2500
1669.7500 123.4500 2550.0000 0.4500 123.4500 123.4500 110.2000 105.6000 -999.2500

19
examples/simple/empty.las Normal file
Просмотреть файл

@ -0,0 +1,19 @@
~Version information
VERS. 2.0 : glas (c) softlandia@gmail.com
WRAP. NO : ONE LINE PER DEPTH STEP
~Well information
STRT.M 0.201 :START DEPTH
STOP.M 10.010 :STOP DEPTH
STEP.M 0.010 :STEP
NULL. -99.990 :NULL VALUE
WELL. <20>ਬ¥à­ ï-101/¡¨á :WELL
~Curve Information Section
DEPT.M :
SP.mV :
~ASCII Log Data
# DEPT | SP |
0.0000 0.0000
1.0000 0.0100
2.0000 0.0200
3.0000 0.0300
4.0000 0.0400

Просмотреть файл

@ -0,0 +1,23 @@
~Version information
VERS. 2.0 : glas (c) softlandia@gmail.com
WRAP. NO : ONE LINE PER DEPTH STEP
~Well information
STRT.M 1.000 :START DEPTH
STOP.M 1.000 :STOP DEPTH
STEP.M 0.100 :STEP
NULL. -9999.000 :NULL VALUE
WELL. 12-Ñïëîøíàÿ :WELL
~Curve Information Section
DEPT.M :
àÏÑ.ä.åä. :
àÏÑ2.óñë.åä. :
àÏÑ3. :
~ASCII Log Data
# DEPT | àÏÑ | àÏÑ2 | àÏÑ3 |
1.0000 -9999.0000 -9999.0000 2.0000
1.1000 -9999.0000 11.5350 1.0000
1.2000 -9999.0000 -9999.0000 5.0000
1.3000 0.7620 -9999.0000 5.0000
1.4000 0.7070 16.0530 1.0000
1.5000 0.0000 -9999.0000 0.0000
1.6000 0.0000 -9999.0000 -9999.0000

Просмотреть файл

@ -0,0 +1,3 @@
**file: expand_points_01.las**
0, line: 23, "__WRN__ STRT: 1.000 == STOP: 1.000"

Просмотреть файл

@ -49,19 +49,15 @@ func test2() {
las.Stop = 10.01
las.Step = 0.01
las.Well = "Примерная-101/бис"
d := glasio.NewLasCurve("DEPT")
d.Init(0, "DEPT", "DEPT", 5)
sp := glasio.NewLasCurve("SP.mV :spontaniously")
sp.Init(1, "SP", "SP", 5)
d := glasio.NewLasCurve("DEPT", las)
sp := glasio.NewLasCurve("SP.mV :spontaniously", las)
for i := 0; i < 5; i++ {
d.D[i] = float64(i)
d.V[i] = float64(i) / 100
sp.D[i] = float64(i)
sp.V[i] = float64(i) / 100
d.D = append(d.D, float64(i))
sp.D = append(sp.D, float64(i))
sp.V = append(sp.V, float64(i) / 100)
}
las.Logs["DEPT"] = d
las.Logs["SP"] = sp
las.SetActuallyNumberPoints(5)
las.Logs = append(las.Logs, d)
las.Logs = append(las.Logs, sp)
err := las.Save("empty.las")
log.Printf("err: %v", err)
}

901
las.go

Разница между файлами не показана из-за своего большого размера Загрузить разницу

76
las_header_test.go Normal file
Просмотреть файл

@ -0,0 +1,76 @@
//(c) softland 2020
//softlandia@gmail.com
//test for HEADER section
package glasio
import (
"fmt"
fp "path/filepath"
"testing"
"github.com/stretchr/testify/assert"
)
type tLoadHeader struct {
fn string
ver float64
wrap string
strt float64
stop float64
step float64
null float64
well string
}
var dLoadHeader = []tLoadHeader{
{fp.Join("data/2.0/cp1251_2.0_well_name.las"), 2.0, "NO", 0.0, 39.9, 0.3, -999.25, "Примерная-1 / бис(ё)"},
{fp.Join("data/2.0/cp1251_2.0_based.las"), 2.0, "NO", 0.0, 39.9, 0.3, -999.25, "Примерная-1/бис(ё)"},
{fp.Join("data/expand_points_01.las"), 1.2, "NO", 1.0, 1.0, 0.1, -9999.00, "12-Сплошная"},
{fp.Join("data/expand_points_01.las"), 1.2, "NO", 1.0, 1.0, 0.1, -9999.0, "12-Сплошная"},
{fp.Join("data/1.2/sample.las"), 1.2, "NO", 1670.0, 1660.0, -0.1250, -999.2500, "ANY ET AL OIL WELL #12"},
{fp.Join("data/2.0/sample_2.0.las"), 2.0, "NO", 1670.0, 1660.0, -0.1250, -999.2500, "AAAAA_2"},
{fp.Join("data/broken_parameter.las"), 2.0, "NO", 0.0, 39.9, 0.3, -999.25, "Примерная-1 / бис(ё)"}, // file contain error on STRT
{fp.Join("data/broken_header.las"), 2.0, "NO", 0.0, 39.9, 0.3, -999.25, "Примерная-1 / бис(ё)"}, // file contain only part of header
{fp.Join("data/more_20_warnings.las"), 1.2, "NO", 0.0, 0.0, 0.0, -32768.0, "6"}, // TODO STEP=0.0 but this incorrect, LoadHeader must replace STEP to actual from data
{fp.Join("data/duplicate_step.las"), 1.2, "NO", 1670.0, 1660.0, -0.1200, -999.2500, "ANY ET AL OIL WELL #12"}, // duplicate_step.las contains two line with STEP:: STEP.M -0.1250: STEP.M -0.1200: using LAST parameter
{fp.Join("data/encodings_utf8.las"), 1.2, "NO", 1670.0, 1660.0, -0.1250, -999.2500, "Скв #12Ω"}, // well name contain unicode char
{fp.Join("test_files/warning-test-files/01-STOP-02.las"), 2.0, "NO", 0.0, -999.2500, 0.1, -999.25, "Скв #12"}, // STOP not exist
}
func TestLoadHeader(t *testing.T) {
var las *Las
for _, tmp := range dLoadHeader {
las = NewLas()
las.Open(tmp.fn)
las.LoadHeader()
assert.Equal(t, tmp.ver, las.Ver, fmt.Sprintf("<LoadHeader> file '%s' readed VER: %f, expected %f", las.FileName, las.Ver, tmp.ver))
assert.Equal(t, tmp.wrap, las.Wrap, fmt.Sprintf("<LoadHeader> file '%s' readed WRAP: %s, expected %s", las.FileName, las.Wrap, tmp.wrap))
assert.Equal(t, tmp.strt, las.Strt, fmt.Sprintf("<LoadHeader> file '%s' readed STRT: %f, expected %f", las.FileName, las.Strt, tmp.strt))
assert.Equal(t, tmp.stop, las.Stop, fmt.Sprintf("<LoadHeader> file '%s' readed STOP: %f, expected %f", las.FileName, las.Stop, tmp.stop))
assert.Equal(t, tmp.step, las.Step, fmt.Sprintf("<LoadHeader> file '%s' readed STEP: %f, expected %f", las.FileName, las.Step, tmp.step))
assert.Equal(t, tmp.null, las.Null, fmt.Sprintf("<LoadHeader> file '%s' readed NULL: %f, expected %f", las.FileName, las.Null, tmp.null))
assert.Equal(t, tmp.well, las.Well, fmt.Sprintf("<LoadHeader> file '%s' readed WELL: %s, expected %s", las.FileName, las.Well, tmp.well))
}
}
func TestLoadLasHeader(t *testing.T) {
for _, tmp := range dLoadHeader {
las, err := LoadLasHeader(tmp.fn)
assert.Nil(t, err)
assert.Equal(t, tmp.ver, las.Ver, fmt.Sprintf("<LoadHeader> file '%s' readed VER: %f, expected %f", las.FileName, las.Ver, tmp.ver))
assert.Equal(t, tmp.wrap, las.Wrap, fmt.Sprintf("<LoadHeader> file '%s' readed WRAP: %s, expected %s", las.FileName, las.Wrap, tmp.wrap))
assert.Equal(t, tmp.strt, las.Strt, fmt.Sprintf("<LoadHeader> file '%s' readed STRT: %f, expected %f", las.FileName, las.Strt, tmp.strt))
assert.Equal(t, tmp.stop, las.Stop, fmt.Sprintf("<LoadHeader> file '%s' readed STOP: %f, expected %f", las.FileName, las.Stop, tmp.stop))
assert.Equal(t, tmp.step, las.Step, fmt.Sprintf("<LoadHeader> file '%s' readed STEP: %f, expected %f", las.FileName, las.Step, tmp.step))
assert.Equal(t, tmp.null, las.Null, fmt.Sprintf("<LoadHeader> file '%s' readed NULL: %f, expected %f", las.FileName, las.Null, tmp.null))
assert.Equal(t, tmp.well, las.Well, fmt.Sprintf("<LoadHeader> file '%s' readed WELL: %s, expected %s", las.FileName, las.Well, tmp.well))
}
//test error case
las, err := LoadLasHeader("not_exist_file.las") //file not exist
assert.NotNil(t, err)
assert.Nil(t, las)
las, err = LoadLasHeader(fp.Join("data/utf-32be-bom.las")) //file exist, codepage not support
assert.NotNil(t, err)
assert.Nil(t, las)
}

Просмотреть файл

@ -3,6 +3,7 @@ package glasio
import (
"fmt"
"sort"
"strconv"
"strings"
"github.com/softlandia/xlib"
@ -96,12 +97,9 @@ func ParseCurveStr(s string) (f [3]string) {
}
f[0] = strings.TrimSpace(s[:iDot])
if len(f[0]) == 0 {
// case empty curve name
f[0] = defCurveName
f[0] = defCurveName // case empty curve name
}
/* s = strings.TrimSpace(s[iDot+1:])
f[1], _ = xlib.StrCopyStop(s, ' ', ':') */
f[1] = strings.TrimSpace(s[iDot+1:])
return
}
@ -169,25 +167,23 @@ func (o *LasCurve) SetLen(n int) {
o.V = t
}
// Init - initialize LasCurve, set index, name, mnemonic, make slice for store data
// перенести в NewLasCurve нельзя, в Init передаются обработанные данные кривой (словари, дублирование и т.д.)
func (o *LasCurve) Init(index int, mnemonic, name string, size int) {
o.Index = index
o.Mnemonic = mnemonic
o.Name = name
o.D = make([]float64, size)
o.V = make([]float64, size)
}
//NewLasCurve - create new object LasCurve
func NewLasCurve(s string) LasCurve {
// NewLasCurve - create new object LasCurve
// s - string from las header
// las - pointer to container
func NewLasCurve(s string, las *Las) LasCurve {
lc := LasCurve{}
curveFields := ParseCurveStr(s)
lc.Name = curveFields[0]
lc.IName = curveFields[0]
lc.Name = las.Logs.UniqueName(lc.IName)
lc.Unit = curveFields[1]
lc.Desc = curveFields[2]
lc.Index = 0
// index of new curve == number of curve already in container
lc.Index = len(las.Logs)
// мнемонику определяем по входному имени кривой
lc.Mnemonic = las.GetMnemonic(lc.IName)
// размер слайсов для хранения данных готовим равными количеству строк в исходном файле
lc.D = make([]float64, 0, las.ePoints)
lc.V = make([]float64, 0, las.ePoints)
return lc
}
@ -198,24 +194,47 @@ func (o LasCurve) String() string {
// LasCurves - container for store all curves of las file
// .Cmp(curves *LasCurves) bool - compare two curves containers
type LasCurves map[string]LasCurve
type LasCurves []LasCurve
// Text - return string represent all curves parameters: IName, Name, Unit etc
//TODO need realization
func (o LasCurves) Text() string {
return "-"
// Captions - return string represent all curves name with separators for las file
// use as comment string after section ~A
func (curves LasCurves) Captions() string {
var sb strings.Builder
sb.WriteString("# ") //готовим строчку с названиями каротажей глубина всегда присутствует
for _, curve := range curves { //Пишем названия каротажей
fmt.Fprintf(&sb, " %-8s|", curve.Name) //Собираем строчку с названиями каротажей
}
return sb.String()
}
// IsPresent - return true if curveName is already present in container
func (curves LasCurves) IsPresent(curveName string) bool {
for _, cn := range curves {
if cn.Name == curveName {
return true
}
}
return false
}
// UniqueName - make new unique name of curve if it duplicated
func (curves LasCurves) UniqueName(curveName string) string {
if curves.IsPresent(curveName) {
return curveName + strconv.Itoa(len(curves))
}
return curveName
}
// Cmp - compare current curves container with another
// сравниваются:
// количество кривых в контейнере
// два хеша от строк с именами всех кривых
func (o LasCurves) Cmp(curves LasCurves) (res bool) {
res = (len(o) == len(curves))
func (curves LasCurves) Cmp(otheCurves LasCurves) (res bool) {
res = (len(curves) == len(curves))
if res {
curvesName := make([]string, 0, len(curves))
for k := range o {
curvesName = append(curvesName, k)
for _, k := range curves {
curvesName = append(curvesName, k.Name)
}
sort.Strings(curvesName)
var sb strings.Builder
@ -224,8 +243,8 @@ func (o LasCurves) Cmp(curves LasCurves) (res bool) {
}
h1 := xlib.StrHash(sb.String())
curvesName = curvesName[:0]
for k := range curves {
curvesName = append(curvesName, k)
for _, k := range otheCurves {
curvesName = append(curvesName, k.Name)
}
sort.Strings(curvesName)
sb.Reset()

Просмотреть файл

@ -173,9 +173,9 @@ func TestParseCurveStr(t *testing.T) {
}
func TestNewLasCurveFromString(t *testing.T) {
var lc LasCurve
las := NewLas()
for _, tmp := range dParseCurveStr {
lc = NewLasCurve(tmp.s)
lc := NewLasCurve(tmp.s, las)
assert.Equal(t, tmp.f0, lc.Name)
assert.Equal(t, tmp.f1, lc.Unit)
assert.Equal(t, tmp.f2, lc.Desc)
@ -183,13 +183,10 @@ func TestNewLasCurveFromString(t *testing.T) {
}
func TestLasCurveSetLen(t *testing.T) {
curve := NewLasCurve("SP.mV :self")
curve.Init(0, "SP", "SP", 5)
curve.D[0] = 0.1
curve.D[1] = 0.2
curve.D[2] = 0.3
curve.D[3] = 0.4
curve.D[4] = 0.5
las := NewLas()
curve := NewLasCurve("SP.mV :self", las)
//curve.Init(0, "SP", "SP", 5)
curve.D = append(curve.D, 0.1, 0.2, 0.3, 0.4, 0.5)
curve.SetLen(3)
assert.Equal(t, 3, len(curve.D))
assert.Equal(t, 3, len(curve.V))
@ -213,14 +210,17 @@ func TestLasCurveSetLen(t *testing.T) {
assert.Equal(t, 0.2, curve.D[1])
}
// Тестирование отображения кривой в строковое представление
func TestLasCurveString(t *testing.T) {
las := makeLasFromFile(fp.Join("data/test-curve-sec-empty-mnemonic.las"))
//D.M : 1 DEPTH
assert.Equal(t, "[\n{\n\"IName\": \"D\",\n\"Name\": \"D\",\n\"Mnemonic\": \"\",\n\"Unit\": \"M\",\"Val\": \"\",\n\"Desc\": \"1 DEPTH\"\n}\n]", las.Logs["D"].String())
assert.Equal(t, "[\n{\n\"IName\": \"D\",\n\"Name\": \"D\",\n\"Mnemonic\": \"\",\n\"Unit\": \"M\",\"Val\": \"\",\n\"Desc\": \"1 DEPTH\"\n}\n]", las.Logs[0].String())
//A.US/M : 2 SONIC TRANSIT TIME
assert.Equal(t, "[\n{\n\"IName\": \"A\",\n\"Name\": \"A\",\n\"Mnemonic\": \"\",\n\"Unit\": \"US/M\",\"Val\": \"\",\n\"Desc\": \"2 SONIC TRANSIT TIME\"\n}\n]", las.Logs["A"].String())
assert.Equal(t, "[\n{\n\"IName\": \"A\",\n\"Name\": \"A\",\n\"Mnemonic\": \"\",\n\"Unit\": \"US/M\",\"Val\": \"\",\n\"Desc\": \"2 SONIC TRANSIT TIME\"\n}\n]", las.Logs[1].String())
//-EL-1. :
assert.Equal(t, "[\n{\n\"IName\": \"-EL-\",\n\"Name\": \"-EL-1\",\n\"Mnemonic\": \"\",\n\"Unit\": \"m\",\"Val\": \"\",\n\"Desc\": \"\"\n}\n]", las.Logs["-EL-1"].String())
assert.Equal(t, "[\n{\n\"IName\": \"-EL-\",\n\"Name\": \"-EL-2\",\n\"Mnemonic\": \"\",\n\"Unit\": \"v/v\",\"Val\": \"\",\n\"Desc\": \"\"\n}\n]", las.Logs["-EL-2"].String())
assert.Equal(t, "[\n{\n\"IName\": \"-EL-\",\n\"Name\": \"-EL-3\",\n\"Mnemonic\": \"\",\n\"Unit\": \"m V\",\"Val\": \"\",\n\"Desc\": \"\"\n}\n]", las.Logs["-EL-3"].String())
assert.Equal(t, "[\n{\n\"IName\": \"-EL-\",\n\"Name\": \"-EL-\",\n\"Mnemonic\": \"\",\n\"Unit\": \"\",\"Val\": \"\",\n\"Desc\": \"\"\n}\n]", las.Logs[4].String())
assert.Equal(t, "[\n{\n\"IName\": \"-EL-\",\n\"Name\": \"-EL-5\",\n\"Mnemonic\": \"\",\n\"Unit\": \"m\",\"Val\": \"\",\n\"Desc\": \"\"\n}\n]", las.Logs[5].String())
assert.Equal(t, "[\n{\n\"IName\": \"-EL-\",\n\"Name\": \"-EL-6\",\n\"Mnemonic\": \"\",\n\"Unit\": \"v/v\",\"Val\": \"\",\n\"Desc\": \"\"\n}\n]", las.Logs[6].String())
assert.Equal(t, "[\n{\n\"IName\": \"-EL-\",\n\"Name\": \"-EL-7\",\n\"Mnemonic\": \"\",\n\"Unit\": \"m V\",\"Val\": \"\",\n\"Desc\": \"\"\n}\n]", las.Logs[7].String())
assert.Equal(t, "[\n{\n\"IName\": \"-EL-5\",\n\"Name\": \"-EL-58\",\n\"Mnemonic\": \"\",\n\"Unit\": \"m\",\"Val\": \"\",\n\"Desc\": \"\"\n}\n]", las.Logs[8].String())
}

Просмотреть файл

@ -20,13 +20,13 @@ type tSummaryCheck struct {
step float64
null float64
well string
curv int //количество кривых в файле
nums int //количество точек в файле
werr bool
curv int //количество кривых в файле
nums int //количество точек в файле
werr bool //не используется
}
var dSummaryCheck = []tSummaryCheck{
{fp.Join("data/barebones.las"), 2.0, "NO", 200, -999.25, 1.1, -999.25, "", 1, 0, true},
{fp.Join("data/barebones.las"), 2.0, "NO", 200, -999.25, 1.1, -999.25, "", 1, 2, true},
{fp.Join("data/6038187_v1.2.las"), 2.0, "NO", 0.05, 136.6, 0.05, -99999, "Scorpio E1", 9, 2732, false},
{fp.Join("data/6038187_v1.2_short.las"), 2.0, "NO", 0.05, 136.6, 0.05, -99999, "Scorpio E1", 9, 121, false},
{fp.Join("data/1001178549.las"), 2.0, "YES", 1783.5, 1784.5, 0.25, -999.25, "1-28", 27, 0, true},
@ -49,21 +49,22 @@ var dSummaryCheck = []tSummaryCheck{
{fp.Join("data/missing_null.las"), 1.2, "NO", 1670, 1660, -0.125, -999.25, "ANY ET AL OIL WELL #12", 8, 3, false},
{fp.Join("data/missing_vers.las"), 2.0, "NO", 1670, 1660, -0.125, -999.25, "WELL", 8, 3, false},
{fp.Join("data/missing_wrap.las"), 1.2, "NO", 1670, 1660, -0.125, -999.25, "ANY ET AL OIL WELL #12", 8, 3, false},
{fp.Join("data/more_20_warnings.las"), 1.2, "NO", 0.0, 0.0, 1.0, -32768.0, "6", 6, 23, true}, //in file STEP=0.0 but this incorrect, LoadHeader replace STEP to actual from data
{fp.Join("data/more_20_warnings.las"), 1.2, "NO", 0.0, 0.0, 1.0, -32768.0, "6", 6, 22, true}, //in file STEP=0.0 but this incorrect, LoadHeader replace STEP to actual from data
{fp.Join("data/no-data-section.las"), 1.2, "NO", 0.0, 0.0, -32768.0, -32768.0, "6", 31, 0, true}, //in file STEP=0.0 but this incorrect, data section contain incorrect step too, result step equal NULL
{fp.Join("data/sample_bracketed_units.las"), 1.2, "NO", 1670, 1660, -0.125, -999.25, "ANY ET AL OIL WELL #12", 8, 3, true},
{fp.Join("data/test-curve-sec-empty-mnemonic.las"), 1.2, "NO", 1670, 1669.75, -0.125, -999.25, "ANY ET AL OIL WELL #12", 8, 3, true},
{fp.Join("data/test-curve-sec-empty-mnemonic.las"), 1.2, "NO", 1670, 1669.75, -0.125, -999.25, "ANY ET AL OIL WELL #12", 9, 3, true},
{fp.Join("data/UWI_API_leading_zero.las"), 1.2, "NO", 1670, 1660, -0.125, -999.25, "ANY ET AL OIL WELL #12", 8, 3, true},
}
// Основной тест по массиву готовых las файлов
// пока проверки только по параметра в заголовке, нужно сделать пару проверок на данные
func TestSummaryRead(t *testing.T) {
for _, tmp := range dSummaryCheck {
las := NewLas()
n, _ := las.Open(tmp.fn)
assert.Equal(t, tmp.nums, n)
assert.Equal(t, tmp.curv, len(las.Logs))
assert.Equal(t, tmp.ver, las.Ver)
assert.Equal(t, tmp.nums, n, fmt.Sprintf("<TestSummaryRead> nums fail on file: '%s'\n", tmp.fn))
assert.Equal(t, tmp.curv, len(las.Logs), fmt.Sprintf("<TestSummaryRead> curves fail on file: '%s'\n", tmp.fn))
assert.Equal(t, tmp.ver, las.Ver, fmt.Sprintf("<TestSummaryRead> ver fail on file: '%s'\n", tmp.fn))
assert.Equal(t, tmp.wrap, las.Wrap, fmt.Sprintf("<TestSummaryRead> wrap fail on file: '%s'\n", tmp.fn))
assert.Equal(t, tmp.strt, las.Strt, fmt.Sprintf("<TestSummaryRead> strt fail on file: '%s'\n", tmp.fn))
assert.Equal(t, tmp.stop, las.Stop, fmt.Sprintf("<TestSummaryRead> stop fail on file: '%s'\n", tmp.fn))
@ -73,13 +74,14 @@ func TestSummaryRead(t *testing.T) {
}
}
//Убрать тест
func TestCurveSec1(t *testing.T) {
las := NewLas()
n, err := las.Open(fp.Join("data/test-curve-sec-empty-mnemonic.las"))
assert.Nil(t, err)
assert.Equal(t, 3, n)
assert.Equal(t, "D", las.Logs["D"].Name)
assert.Equal(t, "M", las.Logs["D"].Unit)
assert.Equal(t, "D", las.Logs[0].Name)
assert.Equal(t, "M", las.Logs[0].Unit)
}
func TestCmpLas(t *testing.T) {
@ -97,7 +99,7 @@ func TestTabulatedData(t *testing.T) {
las := makeLasFromFile(fp.Join("data/tabulated_data.las"))
assert.True(t, cmpLas(correct, las))
assert.True(t, correct.Logs.Cmp(las.Logs))
l := las.Logs["NPHI"]
l := las.Logs[3]
assert.Equal(t, 0.451, l.V[1])
assert.Equal(t, "NPHI", l.Name)
}
@ -121,11 +123,11 @@ func TestLasCheck(t *testing.T) {
lasLog, err = LasDeepCheck(fp.Join("data/test-curve-sec-empty-mnemonic+.las"), fp.Join("data/mnemonic.ini"), fp.Join("data/dic.ini"))
assert.Nil(t, err)
s = lasLog.msgCurve.String(fp.Join("data/test-curve-sec-empty-mnemonic+.las"))
assert.Contains(t, s, "*input log: B internal: B mnemonic:*")
assert.Contains(t, s, "input log: SP internal: SP mnemonic: SP")
assert.Contains(t, s, "*input log: -EL-2 internal: -EL-2 mnemonic:*")
assert.Contains(t, s, "*input log: B mnemonic:*")
assert.Contains(t, s, "input log: SP mnemonic: SP")
assert.Contains(t, s, "*input log: -EL-58 mnemonic:*")
s = lasLog.missMnemonic.String()
assert.Contains(t, s, "-EL-1")
assert.Contains(t, s, "-EL-7")
assert.NotContains(t, s, "SP")
lasLog, err = LasDeepCheck(fp.Join("data/more_20_warnings.las"), fp.Join("data/mnemonic.ini"), fp.Join("data/dic.ini"))
@ -137,20 +139,22 @@ func TestLasCheck(t *testing.T) {
s = lasLog.msgCheck.String()
assert.Empty(t, s)
s = lasLog.msgCurve.String(fp.Join("data/more_20_warnings.las"))
assert.Contains(t, s, "*input log: второй каротаж internal: второй каротаж mnemonic:*")
assert.Contains(t, s, "input log: GK internal: GK mnemonic: GR")
assert.Contains(t, s, "*input log: первый internal: первый mnemonic:*")
assert.Contains(t, s, "*input log: второй каротаж mnemonic:*")
assert.Contains(t, s, "input log: GK mnemonic: GR")
assert.Contains(t, s, "*input log: первый mnemonic:*")
s = lasLog.missMnemonic.String()
assert.Contains(t, s, "NNB")
assert.Contains(t, s, "второй каротаж")
assert.NotContains(t, s, "GR")
// случай если файла нет
lasLog, err = LasDeepCheck(fp.Join("data/-test-curve-sec-empty-mnemonic+.las"), fp.Join("data/mnemonic.ini"), fp.Join("data/dic.ini"))
// случай если файла нет "data/-.las"
lasLog, err = LasDeepCheck(fp.Join("data/-.las"), fp.Join("data/mnemonic.ini"), fp.Join("data/dic.ini"))
assert.NotNil(t, lasLog)
assert.NotNil(t, lasLog.errorOnOpen)
// случай las файл WRAP
// случай если las файл WRAP
lasLog = LasCheck(fp.Join("data/1.2/sample_wrapped.las"))
assert.Contains(t, lasLog.msgCheck.String(), "WRAP=YES")
lasLog, _ = LasDeepCheck(fp.Join("data/1.2/sample_wrapped.las"), fp.Join("data/mnemonic.ini"), fp.Join("data/dic.ini"))
assert.Contains(t, lasLog.msgCheck.String(), "WRAP=YES")
}

32
las_support_test.go Normal file
Просмотреть файл

@ -0,0 +1,32 @@
//(c) softland 2020
//softlandia@gmail.com
package glasio
import (
"fmt"
fp "path/filepath"
"testing"
"github.com/stretchr/testify/assert"
)
func TestGetMnemonic(t *testing.T) {
Mnemonic, err := LoadStdMnemonicDic(fp.Join("data/mnemonic.ini"))
assert.Nil(t, err, fmt.Sprintf("load std mnemonic error: %v\n check out 'data\\mnemonic.ini'", err))
VocDic, err := LoadStdVocabularyDictionary(fp.Join("data/dic.ini"))
assert.Nil(t, err, fmt.Sprintf("load std vocabulary dictionary error: %v\n check out 'data\\dic.ini'", err))
las := NewLas()
mnemonic := las.GetMnemonic("1")
assert.Equal(t, mnemonic, "", fmt.Sprintf("<GetMnemonic> return '%s', expected ''\n", mnemonic))
las.LogDic = &Mnemonic
las.VocDic = &VocDic
mnemonic = las.GetMnemonic("GR")
assert.Equal(t, mnemonic, "GR", fmt.Sprintf("<GetMnemonic> return '%s', expected 'GR'\n", mnemonic))
mnemonic = las.GetMnemonic("ГК")
assert.Equal(t, mnemonic, "GR", fmt.Sprintf("<GetMnemonic> return '%s', expected 'GR'\n", mnemonic))
}

Просмотреть файл

@ -14,52 +14,6 @@ import (
"github.com/stretchr/testify/assert"
)
func TestGetMnemonic(t *testing.T) {
Mnemonic, err := LoadStdMnemonicDic(fp.Join("data/mnemonic.ini"))
assert.Nil(t, err, fmt.Sprintf("load std mnemonic error: %v\n check out 'data\\mnemonic.ini'", err))
VocDic, err := LoadStdVocabularyDictionary(fp.Join("data/dic.ini"))
assert.Nil(t, err, fmt.Sprintf("load std vocabulary dictionary error: %v\n check out 'data\\dic.ini'", err))
las := NewLas()
mnemonic := las.GetMnemonic("1")
assert.Equal(t, mnemonic, "", fmt.Sprintf("<GetMnemonic> return '%s', expected ''\n", mnemonic))
las.LogDic = &Mnemonic
las.VocDic = &VocDic
mnemonic = las.GetMnemonic("GR")
assert.Equal(t, mnemonic, "GR", fmt.Sprintf("<GetMnemonic> return '%s', expected 'GR'\n", mnemonic))
mnemonic = las.GetMnemonic("ГК")
assert.Equal(t, mnemonic, "GR", fmt.Sprintf("<GetMnemonic> return '%s', expected 'GR'\n", mnemonic))
}
//Проверка на достижение максимального количества варнингов
//По умолчанию MaxNumWarinig = 20
func TestReachingMaxAmountWarnings(t *testing.T) {
las := NewLas()
las.Open(fp.Join("data/more_20_warnings.las"))
//by default maximum warning count is 21
assert.Equal(t, 21, las.Warnings.Count(), fmt.Sprintf("<TestReachingMaxAmountWarnings> on 'data\\more_20_warnings.las' wrong count warning: %d\n", las.Warnings.Count()))
// system var glasio.ExpPoints indicates the size of the buffer for the data being read, in order to control the occurrence of the overflow processing
// event of this buffer, we reduce this buffer before reading
// decrease temporary buffer
ExpPoints = 2
las = NewLas()
las.maxWarningCount = 100
las.Open(fp.Join("data/more_20_warnings.las"))
assert.Equal(t, 41, las.Warnings.Count(), fmt.Sprintf("<TestReachingMaxAmountWarnings> on file 'data\\more_20_warnings.las' wrong warning number: %d expected 41\n", las.Warnings.Count()))
// SaveWarning() does not add to las.Warnings.
las.SaveWarning(fp.Join("data/more_20_warnings.wrn"))
assert.Equal(t, 41, las.Warnings.Count(), fmt.Sprintf("<TestReachingMaxAmountWarnings> after las.SaveWarning() number warning changed: %d expected 41\n", las.Warnings.Count()))
// test for error occure when SaveWarning() fails to write to the file
assert.NotNil(t, las.SaveWarning(""))
}
//test special cases
//empty file name, file in wrong encoding
func TestLasOpenSpeсial(t *testing.T) {
@ -88,82 +42,50 @@ func TestLasOpenSpeсial(t *testing.T) {
assert.Equal(t, "cpd: codepage not support encode/decode", err.Error())
}
type tLoadHeader struct {
fn string
ver float64
wrap string
strt float64
stop float64
step float64
null float64
well string
}
var dLoadHeader = []tLoadHeader{
{fp.Join("data/2.0/cp1251_2.0_well_name.las"), 2.0, "NO", 0.0, 39.9, 0.3, -999.25, "Примерная-1 / бис(ё)"},
{fp.Join("data/2.0/cp1251_2.0_based.las"), 2.0, "NO", 0.0, 39.9, 0.3, -999.25, "Примерная-1/бис(ё)"},
{fp.Join("data/expand_points_01.las"), 1.2, "NO", 1.0, 1.0, 0.1, -9999.00, "12-Сплошная"},
{fp.Join("data/expand_points_01.las"), 1.2, "NO", 1.0, 1.0, 0.1, -9999.0, "12-Сплошная"},
{fp.Join("data/1.2/sample.las"), 1.2, "NO", 1670.0, 1660.0, -0.1250, -999.2500, "ANY ET AL OIL WELL #12"},
{fp.Join("data/2.0/sample_2.0.las"), 2.0, "NO", 1670.0, 1660.0, -0.1250, -999.2500, "AAAAA_2"},
{fp.Join("data/broken_parameter.las"), 2.0, "NO", 0.0, 39.9, 0.3, -999.25, "Примерная-1 / бис(ё)"}, // file contain error on STRT
{fp.Join("data/broken_header.las"), 2.0, "NO", 0.0, 39.9, 0.3, -999.25, "Примерная-1 / бис(ё)"}, // file contain only part of header
{fp.Join("data/more_20_warnings.las"), 1.2, "NO", 0.0, 0.0, 0.0, -32768.0, "6"}, // TODO STEP=0.0 but this incorrect, LoadHeader must replace STEP to actual from data
{fp.Join("data/duplicate_step.las"), 1.2, "NO", 1670.0, 1660.0, -0.1200, -999.2500, "ANY ET AL OIL WELL #12"}, // duplicate_step.las contains two line with STEP:: STEP.M -0.1250: STEP.M -0.1200: using LAST parameter
{fp.Join("data/encodings_utf8.las"), 1.2, "NO", 1670.0, 1660.0, -0.1250, -999.2500, "Скв #12Ω"}, // well name contain unicode char
{fp.Join("test_files/warning-test-files/01-STOP-02.las"), 2.0, "NO", 0.0, -999.2500, 0.1, -999.25, "Скв #12"}, // STOP not exist
}
func TestLoadHeader(t *testing.T) {
var las *Las
for _, tmp := range dLoadHeader {
las = NewLas()
f, _ := os.Open(tmp.fn)
las.Reader, _ = cpd.NewReader(f)
las.FileName = tmp.fn
las.scanner = bufio.NewScanner(las.Reader)
las.LoadHeader()
assert.Equal(t, tmp.ver, las.Ver, fmt.Sprintf("<LoadHeader> file '%s' readed VER: %f, expected %f", las.FileName, las.Ver, tmp.ver))
assert.Equal(t, tmp.wrap, las.Wrap, fmt.Sprintf("<LoadHeader> file '%s' readed WRAP: %s, expected %s", las.FileName, las.Wrap, tmp.wrap))
assert.Equal(t, tmp.strt, las.Strt, fmt.Sprintf("<LoadHeader> file '%s' readed STRT: %f, expected %f", las.FileName, las.Strt, tmp.strt))
assert.Equal(t, tmp.stop, las.Stop, fmt.Sprintf("<LoadHeader> file '%s' readed STOP: %f, expected %f", las.FileName, las.Stop, tmp.stop))
assert.Equal(t, tmp.step, las.Step, fmt.Sprintf("<LoadHeader> file '%s' readed STEP: %f, expected %f", las.FileName, las.Step, tmp.step))
assert.Equal(t, tmp.null, las.Null, fmt.Sprintf("<LoadHeader> file '%s' readed NULL: %f, expected %f", las.FileName, las.Null, tmp.null))
assert.Equal(t, tmp.well, las.Well, fmt.Sprintf("<LoadHeader> file '%s' readed WELL: %s, expected %s", las.FileName, las.Well, tmp.well))
}
}
func TestLoadLasHeader(t *testing.T) {
for _, tmp := range dLoadHeader {
las, err := LoadLasHeader(tmp.fn)
assert.Nil(t, err)
assert.Equal(t, tmp.ver, las.Ver, fmt.Sprintf("<LoadHeader> file '%s' readed VER: %f, expected %f", las.FileName, las.Ver, tmp.ver))
assert.Equal(t, tmp.wrap, las.Wrap, fmt.Sprintf("<LoadHeader> file '%s' readed WRAP: %s, expected %s", las.FileName, las.Wrap, tmp.wrap))
assert.Equal(t, tmp.strt, las.Strt, fmt.Sprintf("<LoadHeader> file '%s' readed STRT: %f, expected %f", las.FileName, las.Strt, tmp.strt))
assert.Equal(t, tmp.stop, las.Stop, fmt.Sprintf("<LoadHeader> file '%s' readed STOP: %f, expected %f", las.FileName, las.Stop, tmp.stop))
assert.Equal(t, tmp.step, las.Step, fmt.Sprintf("<LoadHeader> file '%s' readed STEP: %f, expected %f", las.FileName, las.Step, tmp.step))
assert.Equal(t, tmp.null, las.Null, fmt.Sprintf("<LoadHeader> file '%s' readed NULL: %f, expected %f", las.FileName, las.Null, tmp.null))
assert.Equal(t, tmp.well, las.Well, fmt.Sprintf("<LoadHeader> file '%s' readed WELL: %s, expected %s", las.FileName, las.Well, tmp.well))
}
//test error case
las, err := LoadLasHeader("not_exist_file.las") //file not exist
assert.NotNil(t, err)
assert.Nil(t, las)
las, err = LoadLasHeader(fp.Join("data/utf-32be-bom.las")) //file exist, codepage not support
assert.NotNil(t, err)
assert.Nil(t, las)
// Проверка на достижение максимального количества варнингов
/* reading "more_20_warnings.las" generate warnings
*/
func TestReachingMaxAmountWarnings(t *testing.T) {
las := NewLas()
las.Open(fp.Join("data/more_20_warnings.las"))
//by default maximum warning count is 20 + 1 about reaching
assert.Equal(t, 21, las.Warnings.Count(), fmt.Sprintf("<TestReachingMaxAmountWarnings> on '%s' wrong count warning: %d\n", las.FileName, las.Warnings.Count()))
saveMaxWarningCount := MaxWarningCount
MaxWarningCount = 100
las = NewLas()
las.Open(fp.Join("data/more_20_warnings.las"))
assert.Equal(t, 26, las.Warnings.Count(), fmt.Sprintf("<TestReachingMaxAmountWarnings> on file '%s' wrong warning number: %d expected 26\n", las.FileName, las.Warnings.Count()))
MaxWarningCount = saveMaxWarningCount
// SaveWarning() does not add to las.Warnings
las.SaveWarning(fp.Join("data/more_20_warnings.wrn"))
assert.Equal(t, 26, las.Warnings.Count(), fmt.Sprintf("<TestReachingMaxAmountWarnings> after las.SaveWarning() number warning changed: %d expected 26\n", las.Warnings.Count()))
// test for error occure when SaveWarning() fails to write to the file
assert.NotNil(t, las.SaveWarning(""))
}
// test SaveWarningToWriter
func TestLasSaveWarning(t *testing.T) {
las := NewLas()
las.Open(fp.Join("data/more_20_warnings.las"))
err := las.SaveWarning(fp.Join("data/w1_more_20_warnings.txt"))
assert.Nil(t, err)
f, _ := os.Create("nul")
f, err := os.Create(fp.Join("data/w1_more_20_warnings.txt"))
buf := bufio.NewWriter(f)
n := las.SaveWarningToWriter(buf)
buf.Flush()
f.Close()
assert.Equal(t, 21, n)
//now read 'w1_more_20_warnings.txt'
//must be total 22 lines: 0-20 warnings, and last empty line with number 21
f, err = os.Open(fp.Join("data/w1_more_20_warnings.txt"))
assert.Nil(t, err)
sc := bufio.NewScanner(f)
i := 0
for ; sc.Scan(); i++ {
}
f.Close()
assert.Equal(t, 21, i)
}
type tGetDataStrt struct {
@ -216,22 +138,6 @@ var dExpandDept = []tExpandDept{
{fp.Join("data/expand_points_01.las"), 7, 5},
}
func TestExpandPoints(t *testing.T) {
// перед тестом установим маленькое количество ожидаемых точек, иначе надо делать огномный тестовый файл
// срабатывание добавления выполняется при переполнении буфера 1000
ExpPoints = 2
for _, tmp := range dExpandDept {
las := NewLas()
n, err := las.Open(tmp.fn)
assert.Nil(t, err, fmt.Sprintf("<TestExpandPoints> on '%s' return error: %v\n", tmp.fn, err))
assert.Equal(t, tmp.n, n, fmt.Sprintf("<TestExpandPoints> on '%s' return n: %d expect: %d\n", tmp.fn, n, tmp.n))
assert.Equal(t, tmp.n, las.NumPoints())
assert.Equal(t, tmp.nWrn, las.Warnings.Count(), fmt.Sprintf("<TestExpandPoints> '%s' return warning count %d, expected %d\n", tmp.fn, las.Warnings.Count(), tmp.nWrn))
assert.Contains(t, las.Warnings[2].String(), "line: 25", fmt.Sprintf("<TestExpandPoints> '%s' return: '%s' wrong warning index 2\n", tmp.fn, las.Warnings[2]))
assert.Contains(t, las.Warnings[4].String(), "line: 27", fmt.Sprintf("<TestExpandPoints> '%s' return: '%s' wrong warning index 4\n", tmp.fn, las.Warnings[4]))
}
}
func TestLasSetNull(t *testing.T) {
las := NewLas()
las.Open(fp.Join("data/expand_points_01.las"))
@ -239,11 +145,13 @@ func TestLasSetNull(t *testing.T) {
las.SetNull(-999.25)
assert.Equal(t, -999.25, las.Null)
las.Save("-tmp.las")
las = NewLas()
las.Open("-tmp.las")
assert.Equal(t, -999.25, las.Null)
log := las.Logs["аПС"]
log := las.Logs[1]
assert.Equal(t, las.Null, log.V[2])
assert.Equal(t, las.Null, las.Logs["аПС2"].V[6])
assert.Equal(t, las.Null, las.Logs[2].V[6])
err := os.Remove("-tmp.las")
assert.Nil(t, err, fmt.Sprintf("%v", err))
}
@ -277,6 +185,7 @@ func TestLasSave(t *testing.T) {
err := las.Save(tmp.fn)
assert.Nil(t, err)
las = NewLas()
n, err := las.Open(tmp.fn)
//os.Remove(tmp.fn)
assert.Nil(t, err)
@ -286,6 +195,11 @@ func TestLasSave(t *testing.T) {
assert.Equal(t, tmp.stop, las.Stop)
assert.Equal(t, tmp.step, las.Step)
assert.Equal(t, tmp.well, las.Well)
assert.Equal(t, "DEPT", las.Logs[0].Name)
assert.Equal(t, 1.1, las.Logs[0].D[1])
assert.Equal(t, 1.0, las.Logs[0].V[0])
assert.Equal(t, 1.2, las.Logs[1].D[2])
assert.Equal(t, 2.2, las.Logs[1].V[2])
}
}
@ -298,8 +212,7 @@ func TestSetNullOnEmptyLas(t *testing.T) {
func TestLasIsEmpty(t *testing.T) {
las := Las{}
assert.True(t, las.IsEmpty())
las = *NewLas()
assert.False(t, las.IsEmpty())
assert.False(t, NewLas().IsEmpty())
}
type tStdCheckLas struct {
@ -385,3 +298,22 @@ func BenchmarkSave2(b *testing.B) {
}
}
*/
/*
//TODO данный тест больше не нужен, ExpandPoints больше не вызывается
func TestExpandPoints(t *testing.T) {
// перед тестом установим маленькое количество ожидаемых точек, иначе надо делать огномный тестовый файл
// срабатывание добавления выполняется при переполнении буфера 1000
ExpPoints = 2
for _, tmp := range dExpandDept {
las := NewLas()
n, err := las.Open(tmp.fn)
assert.Nil(t, err, fmt.Sprintf("<TestExpandPoints> on '%s' return error: %v\n", tmp.fn, err))
assert.Equal(t, tmp.n, n, fmt.Sprintf("<TestExpandPoints> on '%s' return n: %d expect: %d\n", tmp.fn, n, tmp.n))
assert.Equal(t, tmp.n, las.NumPoints())
assert.Equal(t, tmp.nWrn, las.Warnings.Count(), fmt.Sprintf("<TestExpandPoints> '%s' return warning count %d, expected %d\n", tmp.fn, las.Warnings.Count(), tmp.nWrn))
assert.Contains(t, las.Warnings[2].String(), "line: 25", fmt.Sprintf("<TestExpandPoints> '%s' return: '%s' wrong warning index 2\n", tmp.fn, las.Warnings[2]))
assert.Contains(t, las.Warnings[4].String(), "line: 27", fmt.Sprintf("<TestExpandPoints> '%s' return: '%s' wrong warning index 4\n", tmp.fn, las.Warnings[4]))
}
}
*/

Просмотреть файл

@ -10,6 +10,7 @@ import (
"github.com/softlandia/cpd"
)
// isIgnoredLine - check string s to empty or LAS format comment
func isIgnoredLine(s string) bool {
if (len(s) == 0) || (s[0] == '#') {
return true
@ -54,13 +55,14 @@ func makeSampleLas(
las.Step = step
las.Well = well
curve := NewLasCurve("DEPT.m :")
curve.Init(len(las.Logs), "DEPT", "DEPT", las.GetExpectedPointsCount(las.Strt, las.Stop, las.Step))
las.Logs["DEPT"] = curve
curve = NewLasCurve("BK.ohmm :laterolog")
curve.Init(len(las.Logs), "BK", "LL3", las.GetExpectedPointsCount(las.Strt, las.Stop, las.Step))
las.Logs["BK"] = curve
las.SetActuallyNumberPoints(5)
curve := NewLasCurve("DEPT.m :", las)
curve.D = append(curve.D, 1.0, 1.1, 1.2, 1.3, 1.4)
las.Logs = append(las.Logs, curve)
curve = NewLasCurve("BK.ohmm :laterolog", las)
curve.D = append(curve.D, 1.0, 1.1, 1.2, 1.3, 1.4)
curve.V = append(curve.V, 0.0, 1.1, 2.2, 3.3, 4.4)
las.Logs = append(las.Logs, curve)
return las
}
@ -79,6 +81,7 @@ func LoadLasHeader(fileName string) (*Las, error) {
if err != nil {
return nil, err
}
las.ePoints = las.ReadRows()
las.LoadHeader()
return las, nil
}
@ -102,7 +105,6 @@ func LasCheck(filename string) *Logger {
if lasLog.errorOnOpen != nil {
lasLog.msgCheck = append(lasLog.msgCheck, lasLog.msgCheck.msgFileOpenWarning(filename, lasLog.errorOnOpen))
}
las = nil //TODO уверен это грубая ошибка, Logger хранит в себе las НАФИГА мы его тут убиваем...
return lasLog
}
@ -110,6 +112,11 @@ func LasCheck(filename string) *Logger {
// считывает файл и собирает все сообщения в один объект
func LasDeepCheck(filename, mnemonicFile, vocdicFile string) (*Logger, error) {
lasLog := LasCheck(filename)
if lasLog.errorOnOpen != nil {
//при выполнении LasCheck произошла ошибка чтения файла, дальнейшаа более глубокая проверка нежелательна
//ошибки чтения файла связаны с серьёздным нарушением его структуры, углубленная проверка не имеет смысла
return lasLog, lasLog.errorOnOpen
}
//TODO здесь засада, LasCheck сам создаёт и читает las, более того он вообще-то его в себе хранит,
// НО в данном случае нам СТОИТ??? или НЕ СТОИТ??? об этом забывать
// мы ведь вынуждены всё равно прочитать ещё раз las файл
@ -125,12 +132,12 @@ func LasDeepCheck(filename, mnemonicFile, vocdicFile string) (*Logger, error) {
las.LogDic = &Mnemonic
las.VocDic = &VocDic
las.Open(filename) //читаем второй раз, когда подключены словари, то чтение идёт иначе )))
for k, v := range las.Logs {
if len(v.Mnemonic) == 0 { //v.Mnemonic содержит автоопределённую стандартную мнемонику, если она пустая, значит пропущена, помечаем **
lasLog.msgCurve = append(lasLog.msgCurve, fmt.Sprintf("*input log: %s \t internal: %s \t mnemonic:%s*\n", v.IName, k, v.Mnemonic))
lasLog.missMnemonic[v.IName] = v.IName
for _, curve := range las.Logs {
if len(curve.Mnemonic) == 0 { //curve.Mnemonic содержит автоопределённую стандартную мнемонику, если она пустая, значит пропущена, помечаем **
lasLog.msgCurve = append(lasLog.msgCurve, fmt.Sprintf("*input log: %s \t mnemonic:%s*\n", curve.IName, curve.Mnemonic))
lasLog.missMnemonic[curve.IName] = curve.IName
} else {
lasLog.msgCurve = append(lasLog.msgCurve, fmt.Sprintf("input log: %s \t internal: %s \t mnemonic: %s\n", v.IName, k, v.Mnemonic))
lasLog.msgCurve = append(lasLog.msgCurve, fmt.Sprintf("input log: %s \t mnemonic: %s\n", curve.IName, curve.Mnemonic))
}
}
las = nil

Просмотреть файл

@ -24,13 +24,13 @@ type TWarning struct {
}
//String - return string with warning
func (o TWarning) String() string {
return fmt.Sprintf("line: %d,\t\"%s\"", o.line, o.desc)
func (w TWarning) String() string {
return fmt.Sprintf("line: %d,\t\"%s\"", w.line+1, w.desc)
}
// ToCsvString - return string with warning
// field TWarning.direct do not write to string
func (o *TWarning) ToCsvString(sep ...string) string {
func (w *TWarning) ToCsvString(sep ...string) string {
var fieldSep string
switch len(sep) {
case 0:
@ -38,7 +38,7 @@ func (o *TWarning) ToCsvString(sep ...string) string {
case 1:
fieldSep = sep[0]
}
return fmt.Sprintf("%d%s %d%s \"%s\"", o.section, fieldSep, o.line, fieldSep, o.desc)
return fmt.Sprintf("%3d%s \"%s\"", w.line+1, fieldSep, w.desc)
}
//TLasWarnings - class to store and manipulate warnings
@ -57,8 +57,8 @@ var (
)
//Count - return number of element
func (o TLasWarnings) Count() int {
return len(o)
func (w TLasWarnings) Count() int {
return len(w)
}
// ToString - make one string from all elements
@ -66,8 +66,8 @@ func (o TLasWarnings) Count() int {
// sep[1] - field separator разделитель полей
// default separator between field "," between record "\n"
// on empty container return ""
func (o *TLasWarnings) ToString(sep ...string) string {
if o.Count() == 0 {
func (w *TLasWarnings) ToString(sep ...string) string {
if w.Count() == 0 {
return ""
}
var (
@ -89,53 +89,52 @@ func (o *TLasWarnings) ToString(sep ...string) string {
fieldSep = sep[1]
}
var sb strings.Builder
for _, w := range *o {
sb.WriteString(w.ToCsvString(fieldSep))
sb.WriteString(recSep)
for i, wrn := range *w {
sb.WriteString(fmt.Sprintf("%2d%s %s%s", i, fieldSep, wrn.ToCsvString(fieldSep), recSep))
}
return sb.String()
}
//SaveWarning - save to file all warning
//file created and closed
func (o *TLasWarnings) SaveWarning(fileName string) error {
if o.Count() == 0 {
func (w *TLasWarnings) SaveWarning(fileName string) error {
if w.Count() == 0 {
return nil
}
oFile, err := os.Create(fileName)
if err != nil {
return err
}
_ = o.SaveWarningToFile(oFile)
_ = w.SaveWarningToFile(oFile)
oFile.Close()
return nil
}
//SaveWarningToWriter - store all warning to writer
//return count lines writed to
func (o *TLasWarnings) SaveWarningToWriter(writer *bufio.Writer) int {
if o.Count() == 0 {
func (w *TLasWarnings) SaveWarningToWriter(writer *bufio.Writer) int {
if w.Count() == 0 {
return 0
}
for _, w := range *o {
for _, w := range *w {
_, err := writer.WriteString(w.String())
if err != nil {
log.Fatal("internal __error__ in SaveWarningToWriter")
}
}
return o.Count()
return w.Count()
}
//SaveWarningToFile - store all warning to file, file not close. return count warning writed
func (o *TLasWarnings) SaveWarningToFile(oFile *os.File) int {
func (w *TLasWarnings) SaveWarningToFile(oFile *os.File) int {
if oFile == nil {
return 0
}
if o.Count() == 0 {
if w.Count() == 0 {
return 0
}
for i, w := range *o {
fmt.Fprintf(oFile, "%d, %s\n", i, w)
for i, wrn := range *w {
fmt.Fprintf(oFile, "%d, %s\n", i, wrn)
}
return o.Count()
return w.Count()
}

Просмотреть файл

@ -8,13 +8,13 @@ import (
func TestToCsvString(t *testing.T) {
w := TWarning{1, 1, 1, "first"}
assert.Equal(t, "1; 1; \"first\"", w.ToCsvString())
assert.Equal(t, " 2; \"first\"", w.ToCsvString())
w = TWarning{2, 2, 2, " второе сообщение "}
assert.Equal(t, "2,\t 2,\t \" второе сообщение \"", w.ToCsvString(",\t"))
assert.Equal(t, " 3,\t \" второе сообщение \"", w.ToCsvString(",\t"))
w = TWarning{1, 1, 1, "first"}
assert.Equal(t, "1, 1, \"first\"", w.ToCsvString(","))
assert.Equal(t, " 2, \"first\"", w.ToCsvString(","))
}
func TestLasWarningsToString(t *testing.T) {
@ -25,6 +25,6 @@ func TestLasWarningsToString(t *testing.T) {
TWarning{1, 1, 1, "first"},
TWarning{2, 2, 2, "second"},
}
assert.Equal(t, "1, 1, \"first\"#2, 2, \"second\"#", warnings.ToString("#"))
assert.Equal(t, "1, 1, \"first\"\n2, 2, \"second\"\n", warnings.ToString("\n"))
assert.Equal(t, " 0, 2, \"first\"# 1, 3, \"second\"#", warnings.ToString("#"))
assert.Equal(t, " 0, 2, \"first\"\n 1, 3, \"second\"\n", warnings.ToString("\n"))
}

147
linter.md
Просмотреть файл

@ -1,147 +0,0 @@
las_logger.go:49:21: func `(*tCheckMsg).msgFileOpenWarning` is unused (unused)
las_logger.go:65:23: func `(*tMMnemonic).save` is unused (unused)
las_logger.go:45:21: func `(*tCheckMsg).msgFileNoData` is unused (unused)
las_logger.go:41:21: func `(*tCheckMsg).msgFileIsWraped` is unused (unused)
las_logger.go:55:22: func `(*tCurvRprt).save` is unused (unused)
las_logger.go:35:21: func `(*tCheckMsg).save` is unused (unused)
las_logger.go:13:2: field `readedNumPoints` is unused (unused)
las_logger.go:14:2: field `errorOnOpen` is unused (unused)
las_util.go:86:6: func `lasOpenCheck` is unused (unused)
las.go:430:2: ineffectual assignment to `err` (ineffassign)
err = nil
^
las.go:25:2: `_LasCodePage` is unused (deadcode)
_LasCodePage = "CPAGE. 1251: code page \n"
^
las.go:28:2: `_LasMnemonicFormat` is unused (deadcode)
_LasMnemonicFormat = "#MNEM.UNIT DATA :DESCRIPTION\n"
^
las.go:33:2: `_LasRkb` is unused (deadcode)
_LasRkb = " RKB.M %8.3f :KB or GL\n"
^
las.go:34:2: `_LasXcoord` is unused (deadcode)
_LasXcoord = " XWELL.M %8.3f :Well head X coordinate\n"
^
las.go:35:2: `_LasYcoord` is unused (deadcode)
_LasYcoord = " YWELL.M %8.3f :Well head Y coordinate\n"
^
las.go:36:2: `_LasOilComp` is unused (deadcode)
_LasOilComp = " COMP. %-43.43s:OIL COMPANY\n"
^
las.go:38:2: `_LasField` is unused (deadcode)
_LasField = " FLD . %-43.43s:FIELD\n"
^
las.go:39:2: `_LasLoc` is unused (deadcode)
_LasLoc = " LOC . %-43.43s:LOCATION\n"
^
las.go:40:2: `_LasCountry` is unused (deadcode)
_LasCountry = " CTRY. %-43.43s:COUNTRY\n"
^
las.go:41:2: `_LasServiceComp` is unused (deadcode)
_LasServiceComp = " SRVC. %-43.43s:SERVICE COMPANY\n"
^
las.go:42:2: `_LasDate` is unused (deadcode)
_LasDate = " DATE. %-43.43s:DATE\n"
^
las.go:43:2: `_LasAPI` is unused (deadcode)
_LasAPI = " API . %-43.43s:API NUMBER\n"
^
las.go:44:2: `_LasUwi` is unused (deadcode)
_LasUwi = " UWI . %-43.43s:UNIVERSAL WELL INDEX\n"
^
las.go:46:2: `_LasCurvFormat` is unused (deadcode)
_LasCurvFormat = "#MNEM.UNIT :DESCRIPTION\n"
^
las.go:49:2: `_LasCurvLine2` is unused (deadcode)
_LasCurvLine2 = " %s :\n"
^
las.go:51:2: `_LasDataLine` is unused (deadcode)
_LasDataLine = ""
^
las.go:260:2: `checkHeaderWrap` is unused (deadcode)
checkHeaderWrap = iota
^
las.go:261:2: `checkHeaderCurve` is unused (deadcode)
checkHeaderCurve = iota
^
las.go:262:2: `checkHeaderStrtStop` is unused (deadcode)
checkHeaderStrtStop = iota
^
example\main.go:48:17: Error return value of `las.SaveWarning` is not checked (errcheck)
las.SaveWarning("1.warning.md")
^
example2\main.go:44:10: Error return value of `las.Save` is not checked (errcheck)
las.Save(las.FileName + "-") //сохраняем с символом минус в расширении
^
example2\main.go:50:15: Error return value of `filepath.Walk` is not checked (errcheck)
filepath.Walk(path, func(path string, info os.FileInfo, err error) error {
^
las.go:355:21: Error return value of `writer.WriteString` is not checked (errcheck)
writer.WriteString(w.String())
^
las.go:356:21: Error return value of `writer.WriteString` is not checked (errcheck)
writer.WriteString("\n")
^
las.go:369:19: Error return value of `oFile.WriteString` is not checked (errcheck)
oFile.WriteString("**file: " + o.FileName + "**\n")
^
las.go:371:19: Error return value of `oFile.WriteString` is not checked (errcheck)
oFile.WriteString("\n")
^
las.go:424:14: Error return value of `o.LoadHeader` is not checked (errcheck)
o.LoadHeader()
^
las.go:433:12: Error return value of `o.SetNull` is not checked (errcheck)
o.SetNull(o.stdNull)
^
las_logger.go:37:16: Error return value of `f.WriteString` is not checked (errcheck)
f.WriteString(msg)
^
las_logger.go:58:16: Error return value of `f.WriteString` is not checked (errcheck)
f.WriteString(s)
^
las_logger.go:60:15: Error return value of `f.WriteString` is not checked (errcheck)
f.WriteString("\n")
^
las_param_test.go:40:20: Error return value of `las.ReadWellParam` is not checked (errcheck)
las.ReadWellParam(tmp.s)
^
las_test.go:42:10: Error return value of `las.Open` is not checked (errcheck)
las.Open(fp.Join("data/more_20_warnings.las"))
^
las_test.go:48:10: Error return value of `las.Open` is not checked (errcheck)
las.Open(fp.Join("data/more_20_warnings.las"))
^
las_test.go:50:18: Error return value of `las.SaveWarning` is not checked (errcheck)
las.SaveWarning(fp.Join("data/more_20_warnings.wrn"))
^
las_test.go:102:17: Error return value of `las.LoadHeader` is not checked (errcheck)
las.LoadHeader()
^
las_test.go:163:10: Error return value of `las.Open` is not checked (errcheck)
las.Open(fp.Join("data/more_20_warnings.las"))
^
las_test.go:221:13: Error return value of `las.SetNull` is not checked (errcheck)
las.SetNull(-999.25)
^
las_test.go:223:10: Error return value of `las.Save` is not checked (errcheck)
las.Save("-tmp.las")
^
las_test.go:258:14: Error return value of `las.SetNull` is not checked (errcheck)
las.SetNull(tmp.newNull)
^
las_test.go:276:13: Error return value of `las.SetNull` is not checked (errcheck)
las.SetNull(-1000)
^
las_test.go:284:11: Error return value of `las.Save` is not checked (errcheck)
las.Save(tmp.fn)
^
las_util.go:62:29: Error return value of `las.setActuallyNumberPoints` is not checked (errcheck)
las.setActuallyNumberPoints(5)
^
las_util.go:81:16: Error return value of `las.LoadHeader` is not checked (errcheck)
las.LoadHeader()
^
las_summary_test.go:25:2: `werr` is unused (structcheck)
werr bool
^

Просмотреть файл

@ -9,11 +9,11 @@ WRAP. NO : ONE LINE PER DEPTH STEP
WELL. Ïðèìåðíàÿ-101 / áèñ :WELL
~Curve Information Section
DEPT.M :
LL3.ohmm :
BK.ohmm :
~ASCII Log Data
# DEPT | LL3 |
0.000 0.000
0.000 0.000
0.000 0.000
0.000 0.000
0.000 0.000
# DEPT | BK |
1.0000 0.0000
1.1000 1.1000
1.2000 2.2000
1.3000 3.3000
1.4000 4.4000

Просмотреть файл

@ -9,11 +9,11 @@ WRAP. NO : ONE LINE PER DEPTH STEP
WELL. <20>ਬ¥à­ ï-101 /"¡¨á" :WELL
~Curve Information Section
DEPT.M :
LL3.ohmm :
BK.ohmm :
~ASCII Log Data
# DEPT | LL3 |
0.000 0.000
0.000 0.000
0.000 0.000
0.000 0.000
0.000 0.000
# DEPT | BK |
1.0000 0.0000
1.1000 1.1000
1.2000 2.2000
1.3000 3.3000
1.4000 4.4000

Просмотреть файл

@ -9,11 +9,11 @@ WRAP. NO : ONE LINE PER DEPTH STEP
WELL. ðÒÉÍÅÒÎÁÑ-1001 /"ÂÉÓ" :WELL
~Curve Information Section
DEPT.M :
LL3.ohmm :
BK.ohmm :
~ASCII Log Data
# DEPT | LL3 |
0.000 0.000
0.000 0.000
0.000 0.000
0.000 0.000
0.000 0.000
# DEPT | BK |
1.0000 0.0000
1.1000 1.1000
1.2000 2.2000
1.3000 3.3000
1.4000 4.4000

Двоичные данные
test_files/~utf-16le.las

Двоичный файл не отображается.

Просмотреть файл

@ -9,11 +9,11 @@ WRAP. NO : ONE LINE PER DEPTH STEP
WELL. Примерная-101А / бис :WELL
~Curve Information Section
DEPT.M :
LL3.ohmm :
BK.ohmm :
~ASCII Log Data
# DEPT | LL3 |
0.000 0.000
0.000 0.000
0.000 0.000
0.000 0.000
0.000 0.000
# DEPT | BK |
1.0000 0.0000
1.1000 1.1000
1.2000 2.2000
1.3000 3.3000
1.4000 4.4000

Просмотреть файл

@ -1 +1 @@
0.1.12
0.2.0