This commit is contained in:
softlandia 2020-02-27 20:21:49 +04:00
Коммит c8b35dde53
59 изменённых файлов: 37622 добавлений и 0 удалений

4
.gitignore поставляемый Normal file
Просмотреть файл

@ -0,0 +1,4 @@
*.zip
*.7z
.idea/*
*.exe

674
LICENSE Normal file
Просмотреть файл

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

46
data/1.2/sample.las Normal file
Просмотреть файл

@ -0,0 +1,46 @@
~VERSION INFORMATION
VERS. 1.2: CWLS LOG ASCII STANDARD -VERSION 1.2
WRAP. NO: ONE LINE PER DEPTH STEP
~WELL INFORMATION BLOCK
#MNEM.UNIT DATA TYPE INFORMATION
#--------- ------------- ------------------------------
STRT.M 1670.000000:
STOP.M 1660.000000:
STEP.M -0.1250:
NULL. -999.2500:
COMP. 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 COMPANY: ANY LOGGING COMPANY LTD.
DATE. LOG DATE: 25-DEC-1988
UWI . UNIQUE WELL ID: 100091604920W300
~CURVE INFORMATION
#MNEM.UNIT API CODE CURVE DESCRIPTION
#--------- ------------- ------------------------------
DEPT.M : 1 DEPTH
DT .US/M : 2 SONIC TRANSIT TIME
RHOB.K/M3 : 3 BULK DENSITY
NPHI.V/V : 4 NEUTRON POROSITY
SFLU.OHMM : 5 RXO RESISTIVITY
SFLA.OHMM : 6 SHALLOW RESISTIVITY
ILM .OHMM : 7 MEDIUM RESISTIVITY
ILD .OHMM : 8 DEEP RESISTIVITY
~PARAMETER INFORMATION
#MNEM.UNIT VALUE DESCRIPTION
#--------- ------------- ------------------------------
BHT .DEGC 35.5000: BOTTOM HOLE TEMPERATURE
BS .MM 200.0000: BIT SIZE
FD .K/M3 1000.0000: FLUID DENSITY
MATR. 0.0000: NEUTRON MATRIX(0=LIME,1=SAND,2=DOLO)
MDEN. 2710.0000: LOGGING MATRIX DENSITY
RMF .OHMM 0.2160: MUD FILTRATE RESISTIVITY
DFD .K/M3 1525.0000: 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.
~A DEPTH DT RHOB NPHI SFLU SFLA ILM ILD
1670.000 123.450 2550.000 0.450 123.450 123.450 110.200 105.600
1669.875 123.450 2550.000 0.450 123.450 123.450 110.200 105.600
1669.750 123.450 2550.000 0.450 123.450 123.450 110.200 105.600

29940
data/1.2/sample_big.las Normal file

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

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

@ -0,0 +1,46 @@
~VERSION INFORMATION
VERS. 1.2: CWLS LOG ASCII STANDARD -VERSION 1.2
WRAP. NO: ONE LINE PER DEPTH STEP
~WELL INFORMATION BLOCK
#MNEM.UNIT DATA TYPE INFORMATION
#--------- ------------- ------------------------------
STRT.M 1670.000000:
STOP.M 1660.000000:
STEP.M -0.1250:
NULL. -999.2500:
COMP. 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 COMPANY: ANY LOGGING COMPANY LTD.
DATE. LOG DATE: 25-DEC-1988
UWI . UNIQUE WELL ID: 100091604920W300
~Curve Information Section
#MNEM.UNIT API CODE Curve Description
#--------- ------------- -------------------------------
DEPTH.M : 1 DEPTH
RHOB .K/M3 7 350 02 00: 2 BULK DENSITY
NPHI .VOL/VOL 7 890 00 00: 3 NEUTRON POROSITY - SANDSTONE
MSFL .OHMM 7 220 01 00: 4 Rxo RESISTIVITY
SFLA .OHMM 7 222 01 00: 5 SHALLOW RESISTIVITY
ILM .OHMM 7 120 44 00: 6 MEDIUM RESISTIVITY
ILD .OHMM 7 120 46 00: 7 DEEP RESISTIVITY
SP .MV 7 010 01 00: 8 SPONTANEOUS POTENTIAL
~PARAMETER INFORMATION
#MNEM.UNIT VALUE DESCRIPTION
#--------- ------------- ------------------------------
BHT .DEGC 35.5000: BOTTOM HOLE TEMPERATURE
BS .MM 200.0000: BIT SIZE
FD .K/M3 1000.0000: FLUID DENSITY
MATR. 0.0000: NEUTRON MATRIX(0=LIME,1=SAND,2=DOLO)
MDEN. 2710.0000: LOGGING MATRIX DENSITY
RMF .OHMM 0.2160: MUD FILTRATE RESISTIVITY
DFD .K/M3 1525.0000: 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.
~A DEPTH DT RHOB NPHI SFLU SFLA ILM ILD
1670.000 123.450 2550.000 0.450 123.450 123.450 110.200 105.600
1669.875 123.450 2550.000 0.450 123.450 123.450 110.200 105.600
1669.750 123.450 2550.000 0.450 123.450 123.450 110.200 105.600

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

@ -0,0 +1,28 @@
~V
VERS. 1.2: CWLS log ASCII Standard -VERSION 1.2
WRAP. NO: One line per depth step
~W
STRT.M 635.0000:
STOP.M 400.0000:
STEP.M -0.1250:
NULL. -999.25:
COMP. COMPANY: ANY OIL COMPANY INC.
WELL. WELL: ANY ET AL A9-16-49-20
FLD . FIELD: EDAM
LOC . LOCATION: A9-16-49-20W3M
PROV. PROVINCE: SASKATCHEWAN
SRVC. SERVICE COMPANY: ANY LOGGING COMPANY INC.
DATE. LOG DATE: 13-DEC-86
UWI . UNIQUE WELL ID: 100091604920W300
~C
DEPT.M : DEPTH
RHOB.K/M3 : BULK DENSITY
NPHI.VOL/VOL : NEUTRON POROSITY - SANDSTONE
MSFL.OHMM : Rxo RESISTIVITY
SFLA.OHMM : SHALLOW RESISTIVITY
ILM .OHMM : MEDIUM RESISTIVITY
ILD .OHMM : DEEP RESISTIVITY
SP .MV : SPONTANEOUS POTENTIAL
~A
635.0000 2256.0000 0.4033 22.0781 22.0781 20.3438 3.6660 123.4
634.8750 2256.0000 0.4033 22.0781 22.0781 20.3438 3.6660 123.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,35 @@
~v
VERS. 2.0 : CWLS LOG ASCII STANDARD -VERSION 2.0
WRAP. NO : ONE LINE PER TIME STEP
#
~w
STRT .S 0.0000 :START TIME
STOP .S 39.9000 :STOP TIME
STEP .S 0.3000 :STEP
NULL . -999.25 :NULL VALUE
COMP . ANY OIL COMPANY INC. :COMPANY
WELL . Ïðèìåðíàÿ-1/áèñ(¸) :WELL
FLD . WILDCAT :FIELD
LOC . 12-34-12-34W5 :LOCATION
PROV . ALBERTA :PROVINCE
SRVC . ANY LOGGING COMPANY INC. :SERVICE COMPANY
DATE . 13-DEC-86 :LOG DATE
UWI . 100123401234W500 :UNIQUE WELL ID
#
~c
ETIM .S : 1 ELAPSED TIME
BFR1 .OHMM : 2 SINGLE PROBE 1 RESISTIVITY
BSG1 .PSIG : 3 SINGLE PROBE 1 STRAIN GAUGE PRESSURE
#
~p
MRT .DEGC 67.0 : BOTTOM HOLE TEMPERATURE
GDEPT .M 3456.5 : GAUGE DEPTH
DFD .KG/M3 1000.0 : MUD WEIGHT
#
~a
0.0000 0.2125 16564.1445
0.3000 0.2125 16564.1445
0.6000 0.2125 16564.2421
0.9000 0.2125 16564.0434
1.2000 0.2125 16564.0430
1.5000 0.2125 16564.0435

47
data/2.0/sample_2.0.las Normal file
Просмотреть файл

@ -0,0 +1,47 @@
~VERSION INFORMATION
VERS. 2.0 : CWLS LOG ASCII STANDARD -VERSION 2.0
WRAP. NO : ONE LINE PER DEPTH STEP
~WELL INFORMATION
#MNEM.UNIT DATA DESCRIPTION
#----- ----- ---------- -------------------------
STRT .M 1670.0000 :START DEPTH
STOP .M 1660.0000 :STOP DEPTH
STEP .M -0.1250 :STEP
NULL . -999.25 :NULL VALUE
COMP . ANY OIL COMPANY INC. :COMPANY
WELL . AAAAA_2 :WELL
FLD . WILDCAT :FIELD
LOC . 12-34-12-34W5M :LOCATION
PROV . ALBERTA :PROVINCE
SRVC . ANY LOGGING COMPANY INC. :SERVICE COMPANY
DATE . 13-DEC-86 :LOG DATE
UWI . 100123401234W500 :UNIQUE WELL ID
~CURVE INFORMATION
#MNEM.UNIT API CODES CURVE DESCRIPTION
#------------------ ------------ -------------------------
DEPT .M : 1 DEPTH
DT .US/M 60 520 32 00 : 2 SONIC TRANSIT TIME
RHOB .K/M3 45 350 01 00 : 3 BULK DENSITY
NPHI .V/V 42 890 00 00 : 4 NEUTRON POROSITY
SFLU .OHMM 07 220 04 00 : 5 SHALLOW RESISTIVITY
SFLA .OHMM 07 222 01 00 : 6 SHALLOW RESISTIVITY
ILM .OHMM 07 120 44 00 : 7 MEDIUM RESISTIVITY
ILD .OHMM 07 120 46 00 : 8 DEEP RESISTIVITY
~PARAMETER INFORMATION
#MNEM.UNIT VALUE DESCRIPTION
#-------------- ---------------- -----------------------------------------------
MUD . GEL CHEM : MUD TYPE
BHT .DEGC 35.5000 : BOTTOM HOLE TEMPERATURE
BS .MM 200.0000 : BIT SIZE
FD .K/M3 1000.0000 : FLUID DENSITY
MATR . SAND : NEUTRON MATRIX
MDEN . 2710.0000 : LOGGING MATRIX DENSITY
RMF .OHMM 0.2160 : MUD FILTRATE RESISTIVITY
DFD .K/M3 1525.0000 : DRILL FLUID DENSITY
~OTHER
Note: The logging tools became stuck at 625 metres causing the data
between 625 metres and 615 metres to be invalid.
~A DEPTH DT RHOB NPHI SFLU SFLA ILM ILD
1670.000 123.450 2550.000 0.450 123.450 123.450 110.200 105.600
1669.875 123.450 2550.000 0.450 123.450 123.450 110.200 105.600
1669.750 123.450 2550.000 0.450 123.450 123.450 110.200 105.600

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

@ -0,0 +1,35 @@
~VERSION INFORMATION
VERS. 2.0 : CWLS LOG ASCII STANDARD -VERSION 2.0
WRAP. NO : ONE LINE PER TIME STEP
#
~WELL INFORMATION
STRT .S 0.0000 :START TIME
STOP .S 39.9000 :STOP TIME
STEP .S 0.3000 :STEP
NULL . -999.25 :NULL VALUE
COMP . ANY OIL COMPANY INC. :COMPANY
WELL . ANY ET 12-34-12-34 :WELL
FLD . WILDCAT :FIELD
LOC . 12-34-12-34W5 :LOCATION
PROV . ALBERTA :PROVINCE
SRVC . ANY LOGGING COMPANY INC. :SERVICE COMPANY
DATE . 13-DEC-86 :LOG DATE
UWI . 100123401234W500 :UNIQUE WELL ID
#
~CURVE INFORMATION
ETIM .S : 1 ELAPSED TIME
BFR1 .OHMM : 2 SINGLE PROBE 1 RESISTIVITY
BSG1 .PSIG : 3 SINGLE PROBE 1 STRAIN GAUGE PRESSURE
#
~PARAMETER INFORMATION
MRT .DEGC 67.0 : BOTTOM HOLE TEMPERATURE
GDEPT .M 3456.5 : GAUGE DEPTH
DFD .KG/M3 1000.0 : MUD WEIGHT
#
~A
0.0000 0.2125 16564.1445
0.3000 0.2125 16564.1445
0.6000 0.2125 16564.2421
0.9000 0.2125 16564.0434
1.2000 0.2125 16564.0430
1.5000 0.2125 16564.0435

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

@ -0,0 +1,47 @@
~VERSION INFORMATION
VERS. 2.0 : CWLS LOG ASCII STANDARD -VERSION 2.0
WRAP. NO : ONE LINE PER DEPTH STEP
~WELL INFORMATION
#MNEM.UNIT DATA DESCRIPTION
#----- ----- ---------- -------------------------
STRT .M 1670.0000 :START DEPTH
STOP .M 1660.0000 :STOP DEPTH
STEP .M -0.1250 :STEP
NULL . -999.25 :NULL VALUE
COMP . ANY OIL COMPANY INC. :COMPANY
WELL . AAAAA_2 :WELL
FLD . WILDCAT :FIELD
LOC . 12-34-12-34W5M :LOCATION
PROV . ALBERTA :PROVINCE
SRVC . ANY LOGGING COMPANY INC. :SERVICE COMPANY
DATE . 13-DEC-86 :LOG DATE
UWI . 300E074350061450 :UNIQUE WELL ID
~CURVE INFORMATION
#MNEM.UNIT API CODES CURVE DESCRIPTION
#------------------ ------------ -------------------------
DEPT .M : 1 DEPTH
DT .US/M 60 520 32 00 : 2 SONIC TRANSIT TIME
RHOB .K/M3 45 350 01 00 : 3 BULK DENSITY
NPHI .V/V 42 890 00 00 : 4 NEUTRON POROSITY
SFLU .OHMM 07 220 04 00 : 5 SHALLOW RESISTIVITY
SFLA .OHMM 07 222 01 00 : 6 SHALLOW RESISTIVITY
ILM .OHMM 07 120 44 00 : 7 MEDIUM RESISTIVITY
ILD .OHMM 07 120 46 00 : 8 DEEP RESISTIVITY
~PARAMETER INFORMATION
#MNEM.UNIT VALUE DESCRIPTION
#-------------- ---------------- -----------------------------------------------
MUD . GEL CHEM : MUD TYPE
BHT .DEGC 35.5000 : BOTTOM HOLE TEMPERATURE
BS .MM 200.0000 : BIT SIZE
FD .K/M3 1000.0000 : FLUID DENSITY
MATR . SAND : NEUTRON MATRIX
MDEN . 2710.0000 : LOGGING MATRIX DENSITY
RMF .OHMM 0.2160 : MUD FILTRATE RESISTIVITY
DFD .K/M3 1525.0000 : DRILL FLUID DENSITY
~OTHER
Note: The logging tools became stuck at 625 metres causing the data
between 625 metres and 615 metres to be invalid.
~A DEPTH DT RHOB NPHI SFLU SFLA ILM ILD
1670.000 123.450 2550.000 0.450 123.450 123.450 110.200 105.600
1669.875 123.450 2550.000 0.450 123.450 123.450 110.200 105.600
1669.750 123.450 2550.000 0.450 123.450 123.450 110.200 105.600

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

@ -0,0 +1,28 @@
~V
VERS. 2.0 : CWLS log ASCII Standard -VERSION 2.0
WRAP. NO : One line per depth step
~W
STRT.M 635.0000 :START DEPTH
STOP.M 400.0000 :STOP DEPTH
STEP.M -0.1250 :STEP
NULL. -999.25 :NULL VALUE
COMP. ANY OIL COMPANY INC. :COMPANY
WELL. ANY ET AL 12-34-12-34 :WELL
FLD . WILDCAT :FIELD
LOC . 12-34-12-34W5M :LOCATION
PROV. ALBERTA :PROVINCE
SRVC. ANY LOGGING COMPANY INC. :SERVICE COMPANY
DATE. 13-DEC-86 :LOG DATE
UWI . 100123401234W500 :UNIQUE WELL ID
~C
DEPT .M : DEPTH
RHOB .K/M3 : BULK DENSITY
NPHI .VOL/VOL : NEUTRON POROSITY - SANDSTONE
MSFL .OHMM : Rxo RESISTIVITY
SFLA .OHMM : SHALLOW RESISTIVITY
ILM .OHMM : MEDIUM RESISTIVITY
ILD .OHMM : DEEP RESISTIVITY
SP .MV : SPONTANEOUS POTENTIAL
~A
635.0000 2256.0000 0.4033 22.0781 22.0781 20.3438 3.6660 123.4
634.8750 2256.0000 0.4033 22.0781 22.0781 20.3438 3.6660 123.4

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

@ -0,0 +1,71 @@
~VERSION INFORMATION
VERS. 2.0 : CWLS log ASCII Standard -VERSION 2.0
WRAP. YES : Multiple lines per depth step
~WELL INFORMATION
#MNEM.UNIT DATA DESCRIPTION
#----- ----- ---------- -----------------------------
STRT .M 910.0000 :START DEPTH
STOP .M 909.5000 :STOP DEPTH
STEP .M -0.1250 :STEP
NULL . -999.25 :NULL VALUE
COMP . ANY OIL COMPANY INC. :COMPANY
WELL . ANY ET AL 12-34-12-34 :WELL
FLD . WILDCAT :FIELD
LOC . 12-34-12-34W5M :LOCATION
PROV . ALBERTA :PROVINCE
SRVC . ANY LOGGING COMPANY INC. :SERVICE COMPANY
SON . 142085 :SERVICE ORDER NUMBER
DATE . 13-DEC-86 :LOG DATE
UWI . 100123401234W500 :UNIQUE WELL ID
~CURVE INFORMATION
#MNEM.UNIT 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

575
data/dic.ini Normal file
Просмотреть файл

@ -0,0 +1,575 @@
[LOG]
пс = SP
PS = SP
PS SP = SP
PS5- = SP
ПС = SP
ÏÑ = SP
PSP = SP
PS_ = SP
PS_3 = SP
PS_P = SP
PS_p = SP
PS_vert = SP
PS_Р = SP
PS_испр0 = SP
PSbkz = SP
PSp = SP
PSst = SP
SP_ = SP
SP_P = SP
SP_R = SP
SP__ = SP
SP_p = SP
SPp = SP
ПС 1 = SP
ПС 2 = SP
ПС верх = SP
ПС 1 сш = SP
ПС 2сш = SP
ПС* = SP
ПС** = SP
ПС*_O = SP
ПС+ = SP
ПС++ = SP
ПС- = SP
ПС-- = SP
ПС-111ст = SP
ПС/ = SP
ПС061101 = SP
ПС10 = SP
ПС2 = SP
ПС21 = SP
ПС24 = SP
ПС28 = SP
ПС29 = SP
ПС3 = SP
ПС30 = SP
ПС31 = SP
ПС_i = SP
ПС_vert = SP
ПСc = SP
ПСcn = SP
ПСcв = SP
ПСбкз = SP
ПСбкз25v = SP
ПСбкзм = SP
ПСсв = SP
ПСсв_C1 = SP
ПСск = SP
ПСск/ = SP
ПСст = SP
ПСст-1 = SP
ПСст-2 = SP
ПСстк = SP
ПСстк25v = SP
Dsr = CALI
DS = CALI
KAV = CALI
KV = CALI
DS1 = CALI
DS2 = CALI
DSP1 = CALI
DSR = CALI
DS_ = CALI
DS_1 = CALI
Kavernomer= CALI
ДC-3 = CALI
ДС = CALI
ДС-1 = CALI
ДС-2 = CALI
ДС16 = CALI
ДС29 = CALI
ДС3 = CALI
КВ = CALI
КАВ-9_10 = CALI
КАВ26 = CALI
КАВ268 = CALI
DN = BIN
DN_ = BIN
Dn = BIN
Dnom = BIN
ДСн = BIN
ДСном = BIN
Дн = BIN
ДТП = DTP
= DTP
dT = DTP
AK = DTP
= DTP
DT = DTP
DTP_p = DTP
DT_ = DTP
DT_1_u = DTP
DT_P = DTP
DT_p = DTP
DTск = DTP
ГК4 = GR
ÃÊ = GR
ГК = GR
GK = GR
GK19 = GR
GK_ = GR
GK_3 = GR
GK_O = GR
GK_P = GR
GK_R = GR
GK__ = GR
GK_f = GR
GK_fl = GR
GK_nat = GR
GK_p = GR
GK_vert = GR
GK_Р = GR
GK_испр0= GR
GK_р = GR
GKngk = GR
GKngk_P = GR
GKnnk = GR
GKnnk_P = GR
GKnnk_fl = GR
GKnnk_p = GR
GKp = GR
GKнгк = GR
GKпр060512 = GR
GК_Р = GR
ГК верх сш = GR
ГК 061101 = GR
ГК сшит = GR
ГК(МИД)F = GR
ГК* = GR
ГК** = GR
ГК+ = GR
ГК- = GR
ГК-- = GR
ГК-111ст = GR
ГК/ = GR
ГК1 = GR
ГК10 = GR
ГК15 = GR
ГК16 = GR
ГК2 = GR
ГК21 = GR
ГК29 = GR
ГК3 = GR
ГК_ = GR
ГК_vert = GR
ГК_испр0 = GR
ГКc = GR
ГКcв = GR
ГКcв2pes = GR
ГКcв4реs = GR
ГКкол = GR
ГКнгк = GR
ГКнгк18 = GR
ГКнгкк = GR
ГКниз сш = GR
ГКннк = GR
ГКннк18 = GR
ГКннкк = GR
ГКпр = GR
ГКприв = GR
ГКс = GR
ГКсв = GR
ГКск = GR
ГКск/ = GR
гк = GR
GK_а = GR
GK_<EFBFBD> = GR
A0 = GZ1
A1 = GZ1
A025M = GZ1
A025M01N = GZ1
A025M025N = GZ1
M010A002B = GZ1
M01A01B = GZ1
M03A01B = GZ1
Ì03À01Â = GZ1
A04M0 = GZ2
A04M01N = GZ2
A05M0 = GZ2
A05M01N = GZ2
A075M01N = GZ2
A1M01 = GZ2
A1M01N = GZ2
M025A002B = GZ2
M05A01B = GZ2
M125A01B = GZ2
M125A025B = GZ2
M1A01 = GZ2
M1A01B = GZ2
M1A02 = GZ2
M1A025B = GZ2
M1A05B = GZ2
A1M0 = GZ2
A125M01N= GZ2
À2Ì05N = GZ2
A2* = GZ3
A2*_O = GZ3
A2*_O_O = GZ3
A2*_O_O_испр0 = GZ3
A225v = GZ3
A2M0 = GZ3
A2M02N = GZ3
A2M02N2 = GZ3
A2M05N-1= GZ3
A2M05N-2= GZ3
A2M05N2 = GZ3
A2M05N3 = GZ3
A2M05Nbkz= GZ3
A2M05Nбкз= GZ3
A2M2 = GZ3
A2M28 = GZ3
A2M3 = GZ3
A2M30 = GZ3
A2M4 = GZ3
A2_vert = GZ3
A2cв = GZ3
A2св = GZ3
ÊÑ3 = GZ3
M25A025B = GZ3
A2 = GZ3
A20M025N = GZ3
A20M05N = GZ3
A25M025N = GZ3
A25M05N = GZ3
A2M025N = GZ3
A2M05 = GZ3
A2M05N = GZ3
A2M1N = GZ3
M25A025N = GZ3
M2M025N = GZ3
A24M05N = GZ3
GZ3_p = GZ3
GZ3_ = GZ3
GZ3__ = GZ3
GZB = OGZ
A4 = GZ4
A425v = GZ4
A4M0 = GZ4
A40M025N = GZ4
A40M05N = GZ4
A4M02 = GZ4
A4M025N = GZ4
A4M05 = GZ4
A4M05N = GZ4
A4M085N = GZ4
M40A025B = GZ4
M40A25B = GZ4
M4A02 = GZ4
M4A025 = GZ4
M4A025A = GZ4
M4A025B = GZ4
M4A02B = GZ4
M4A05B = GZ4
M4A25B = GZ4
M5A1B = GZ4
A05M6N = GZ5
A05M8 = GZ5
A05M80N = GZ5
A05M8N = GZ5
A10M01N = GZ5
A6M1N = GZ5
A80M05N = GZ5
A80M10N = GZ5
A8M05 = GZ5
A8M05N = GZ5
A8M1N = GZ5
M06A01B = GZ5
M10A01B = GZ5
M10A025B = GZ5
M10A1B = GZ5
M10A25B = GZ5
M12A005B = GZ5
M12A01B = GZ5
M60A25B = GZ5
M6A02 = GZ5
M6A025B = GZ5
M6A25B = GZ5
À8Ì05N = GZ5
A8 = GZ5
A8М1N = GZ5
A50M10N = GZ6
B1A100M = GZ6
B35A5B = GZ6
M120A10B = GZ6
M25A25B = GZ6
M35A5B = GZ6
M50A10B = GZ6
M55A5B = GZ6
M80A05B = GZ6
M80A1B = GZ6
M80A25B = GZ6
M80M05N = GZ6
M8A005B = GZ6
M8A01 = GZ6
M8A02 = GZ6
M8A025B = GZ6
M8A05 = GZ6
M8A05B = GZ6
M8A1B = GZ6
M8A25B = GZ6
M90A10B = GZ6
N005M2A = GZK1
КС3 = GZ3
B025A25M = GZK3
N05M20A = GZK3
N05M2A = GZK3
B025A4M = GZK4
N025M40A = GZK4
N025M4A = GZK4
N025M4N = GZK4
B05A8 = GZK5
B05A80M = GZK5
B05A8M = GZK5
B1A5M = GZK5
B25A8M = GZK5
ГЗ1 = GZ1
ГЗ2 = GZ2
ГЗ3 = GZ3
ГЗ4 = GZ4
ГЗ5 = GZ5
ИК = IK
IK Ms = IK
IK mSm = IK
IKmSm = IK
IKms = IK
ИКа = IK
ИКр = IK
ИКБ = IK
ИКВЧ1 = IK
ИКВЧ2 = IK
ИКВЧ3 = IK
ИКВЧ4 = IK
ИКВЧ5 = IK
ИКЛП = IK
ИКМ = IK
IK Omm = 6F1I
IKOmm = 6F1I
ИКомм = 6F1I
ИКомм24 = 6F1I
BK = LL3
BK14 = LL3
БК = LL3
BK_ = LL3
BK_P = LL3
BK_p = LL3
BK_Р = LL3
БК-1 = LL3
БК-2 = LL3
БК1** = LL3
БК2 = LL3
БК25v = LL3
БК28 = LL3
БК29 = LL3
БК3 = LL3
БК30 = LL3
БК_vert = LL3
БКск = LL3
ВК_Р = LL3
бк = LL3
LLD = LL3
MBK = MLL
BMK = MLL
МБК = MLL
MG = MINV
MGZ = MINV
-MGZ_P = MINV
-MGZ_p = MINV
МГЗ = MINV
MG314 = MINV
GMZ = MINV
MDS = MCAL
Mkav = MCAL
MKV = MCAL
MKVb = MCAL
МКВ = MCAL
MP = MNOR
MPZ = MNOR
-MPZ_P = MNOR
-MPZ_p = MNOR
МПЗ = MNOR
MP314 = MNOR
PMZ = MNOR
BZ = NKTB
BZnnk = NKTB
ННК-б = NKTB
ННКБЗ = NKTB
ННКБЗ10 = NKTB
ННКБЗ18 = NKTB
ННКбз = NKTB
ННКбзк = NKTB
MZ = NKTM
MZnnk = NKTM
ННКМЗ = NKTM
ННКМЗ10 = NKTM
ННКМЗ18 = NKTM
ННКмз = NKTM
ННКмзк = NKTM
RESIST = REZ
rezistivimetr = REZ
REZ = REZ
NNK = NPHI
Kp = NPHI
W = NPHI
WOD = NPHI
Wodor = NPHI
Wodorod = NPHI
w = NPHI
wod = NPHI
Водород = NPHI
Водородо_ = NPHI
Вород = NPHI
В_НКТ = NPHI
KP_DT = PORDT
КпАК = PORDT
КпГГК = PORGGK
A04M01N2= PZ
N11 = PZ
A025M60N = PZ
A025M6N = PZ
A025M8N = PZ
B100A10M = PZ
B25A025M = PZ
B25A25M = PZ
B35A5M = PZ
B4A25M = PZ
B50A10M = PZ
B55A5M = PZ
B5A1M = PZ
B6A25M = PZ
B70A10M = PZ
B75A10M = PZ
B80A10M = PZ
M025A25B = PZ
M025M6N = PZ
M5N1A = PZ
N110M05A = PZ
N11M0 = PZ
N11M05A = PZ
N225M = PZ
N225M025A = PZ
N475M025A = PZ
N476M025A = PZ
N4M025A = PZ
N6M025A = PZ
N6M05A = PZ
N85M0 = PZ
N85M05A = PZ
N0 = PZ
N11* = PZ
N11*_O = PZ
N11-111ст = PZ
N112 = PZ
N1125v = PZ
N11M-3 = PZ
N11M05A 1 = PZ
N11M05A 2 = PZ
N11M05A-1 = PZ
N11M05A-2 = PZ
N11M05A1 = PZ
N11M05A2 = PZ
N11M05A3 = PZ
N11M05Aик = PZ
N11M05N = PZ
N11M05А = PZ
N11M1А = PZ
N11M2 = PZ
N11M28 = PZ
N11M3 = PZ
N11M30 = PZ
N11M4 = PZ
N11_vert = PZ
N11cв = PZ
N11М0 = PZ
N11М2 = PZ
N11М31 = PZ
N11ик = PZ
N11св = PZ
N11ск = PZ
N11сш = PZ
PZ2 = PZ
PZIK = PZ
PZIKP = PZ
PZIK_p = PZ
PZP = PZ
PZ_ = PZ
PZ_3 = PZ
-PZ_P = PZ
PZ_R = PZ
PZ__ = PZ
PZ_p = PZ
PZ_Р = PZ
PZ_в_u = PZ
PZik = PZ
PZp = PZ
ПЗ = PZ
ПЗик = PZ
OGZ_P = OGZ
GGK = RHOB
GGK-plot= RHOB
GGKP = RHOB
GGP = RHOB
GGP_P = RHOB
GGP_p = RHOB
GGP_Р = RHOB
ГГК = RHOB
ГГКП = RHOB
ГГКПсем = RHOB
ГГКР = RHOB
ПЛ_ГГ = RHOB
GGK-bz = GGKbz
ГГКбз = GGKbz
GGK-mz = GGKmz
ГГКмз = GGKmz
НГК = RNGL
НГК* = RNGL
НГК+ = RNGL
НГК10 = RNGL
НГК18 = RNGL
НГКк = RNGL
НГКкол = RNGL
NGK = RNGL
ÍÃÊ = RNGL
нгк = RNGL
NGK1 = RNGL
NGK_1 = RNGL
-NGK_P = RNGL
-NGK_p = RNGL
Rezist = RM
Rez = RM
Рез = RM
ннкбз = RFEN
ннкмз = RNEN
Кгл = VCL
КП = POR

0
data/dic0.ini Normal file
Просмотреть файл

47
data/duplicate_step.las Normal file
Просмотреть файл

@ -0,0 +1,47 @@
~VERSION INFORMATION
VERS. 1.2: CWLS LOG ASCII STANDARD -VERSION 1.2
WRAP. NO: ONE LINE PER DEPTH STEP
~WELL INFORMATION BLOCK
#MNEM.UNIT DATA TYPE INFORMATION
#--------- ------------- ------------------------------
STRT.M 1670.000000:
STOP.M 1660.000000:
STEP.M -0.1250:
STEP.M -0.1200:
NULL. -999.2500:
COMP. 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 COMPANY: ANY LOGGING COMPANY LTD.
DATE. LOG DATE: 25-DEC-1988
UWI . UNIQUE WELL ID: 100091604920W300
~CURVE INFORMATION
#MNEM.UNIT API CODE CURVE DESCRIPTION
#--------- ------------- ------------------------------
DEPT.M : 1 DEPTH
DT .US/M : 2 SONIC TRANSIT TIME
RHOB.K/M3 : 3 BULK DENSITY
NPHI.V/V : 4 NEUTRON POROSITY
SFLU.OHMM : 5 RXO RESISTIVITY
SFLA.OHMM : 6 SHALLOW RESISTIVITY
ILM .OHMM : 7 MEDIUM RESISTIVITY
ILD .OHMM : 8 DEEP RESISTIVITY
~PARAMETER INFORMATION
#MNEM.UNIT VALUE DESCRIPTION
#--------- ------------- ------------------------------
BHT .DEGC 35.5000: BOTTOM HOLE TEMPERATURE
BS .MM 200.0000: BIT SIZE
FD .K/M3 1000.0000: FLUID DENSITY
MATR. 0.0000: NEUTRON MATRIX(0=LIME,1=SAND,2=DOLO)
MDEN. 2710.0000: LOGGING MATRIX DENSITY
RMF .OHMM 0.2160: MUD FILTRATE RESISTIVITY
DFD .K/M3 1525.0000: 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.
~A DEPTH DT RHOB NPHI SFLU SFLA ILM ILD
1670.000 123.450 2550.000 0.450 123.450 123.450 110.200 105.600
1669.875 123.450 2550.000 0.450 123.450 123.450 110.200 105.600
1669.750 123.450 2550.000 0.450 123.450 123.450 110.200 105.600

Двоичные данные
data/encodings_utf16be.las Normal file

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

Двоичные данные
data/encodings_utf16bebom.las Normal file

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

Двоичные данные
data/encodings_utf16le.las Normal file

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

Двоичные данные
data/encodings_utf16lebom.las Normal file

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

46
data/encodings_utf8.las Normal file
Просмотреть файл

@ -0,0 +1,46 @@
~VERSION INFORMATION
VERS. 1.2: CWLS LOG ASCII STANDARD -VERSION 1.2
WRAP. NO: ONE LINE PER DEPTH STEP
~WELL ºᶟᵌᴬń BLOCK
#MNEM.ºᶟᵌᴬń DATA TYPE INFORMATION
#--------- ------------- ------------------------------
STRT.M 1670.000000:
STOP.M 1660.000000:
STEP.M -0.1250:
NULL. -999.2500:
COMP. COMPANY: # ANY OIL COMPANY LTD.
WELL. WELL: ANY ºᶟᵌᴬń OIL WELL #12
FLD . FIELD: EDAM
LOC . LOCATION: A9-16-49-20W3M
PROV. PROVINCE: SASKATCHEWAN
SRVC. SERVICE COMPANY: ANY LOGGING COMPANY LTD.
DATE. LOG DATE: 25-DEC-1988
UWI . UNIQUE WELL ID: 100091604920W300
~CURVE INFORMATION
#MNEM.UNIT API CODE CURVE DESCRIPTION
#--------- ------------- ------------------------------
DEPT.M : 1 ºᶟᵌᴬń
DT .US/M : 2 SONIC TRANSIT TIME
ºᶟᵌᴬń.K/M3 : 3 BULK DENSITY
NPHI.V/V : 4 NEUTRON POROSITY
SFLU.OHMM : 5 RXO RESISTIVITY
SFLA.OHMM : 6 SHALLOW RESISTIVITY
ILM .OHMM : 7 MEDIUM RESISTIVITY
ILD .OHMM : 8 DEEP RESISTIVITY
~PARAMETER INFORMATION
#MNEM.UNIT VALUE DESCRIPTION
#--------- ------------- ------------------------------
BHT .ºᶟᵌᴬń 35.5000: BOTTOM HOLE TEMPERATURE
BS .MM 200.0000: BIT SIZE
FD .K/M3 1000.0000: FLUID DENSITY
MATR. 0.0000: NEUTRON MATRIX(0=LIME,1=SAND,2=DOLO)
MDEN. 2710.0000: LOGGING MATRIX DENSITY
RMF .OHMM 0.2160: MUD FILTRATE RESISTIVITY
DFD .K/M3 1525.0000: DRILL FLUID DENSITY
~Other
Note: The ºᶟᵌᴬń tools became stuck at 625 meters causing the data
between 625 meters and 615 meters to be invalid.
~A DEPTH DT RHOB NPHI SFLU SFLA ILM ILD
1670.000 123.450 2550.000 0.450 123.450 123.450 110.200 105.600
1669.875 123.450 2550.000 0.450 123.450 123.450 110.200 105.600
1669.750 123.450 2550.000 0.450 123.450 123.450 110.200 105.600

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

@ -0,0 +1,46 @@
~VERSION INFORMATION
VERS. 1.2: CWLS LOG ASCII STANDARD -VERSION 1.2
WRAP. NO: ONE LINE PER DEPTH STEP
~WELL ºᶟᵌᴬń BLOCK
#MNEM.ºᶟᵌᴬń DATA TYPE INFORMATION
#--------- ------------- ------------------------------
STRT.M 1670.000000:
STOP.M 1660.000000:
STEP.M -0.1250:
NULL. -999.2500:
COMP. COMPANY: # ANY OIL COMPANY LTD.
WELL. WELL: Скважина ºᶟᵌᴬń #12
FLD . FIELD: EDAM
LOC . LOCATION: A9-16-49-20W3M
PROV. PROVINCE: SASKATCHEWAN
SRVC. SERVICE COMPANY: ANY LOGGING COMPANY LTD.
DATE. LOG DATE: 25-DEC-1988
UWI . UNIQUE WELL ID: 100091604920W300
~CURVE INFORMATION
#MNEM.UNIT API CODE CURVE DESCRIPTION
#--------- ------------- ------------------------------
DEPT.M : 1 ºᶟᵌᴬń
DT .US/M : 2 SONIC TRANSIT TIME
ºᶟᵌᴬń.K/M3 : 3 BULK DENSITY
NPHI.V/V : 4 NEUTRON POROSITY
SFLU.OHMM : 5 RXO RESISTIVITY
SFLA.OHMM : 6 SHALLOW RESISTIVITY
ILM .OHMM : 7 MEDIUM RESISTIVITY
ILD .OHMM : 8 DEEP RESISTIVITY
~PARAMETER INFORMATION
#MNEM.UNIT VALUE DESCRIPTION
#--------- ------------- ------------------------------
BHT .ºᶟᵌᴬń 35.5000: BOTTOM HOLE TEMPERATURE
BS .MM 200.0000: BIT SIZE
FD .K/M3 1000.0000: FLUID DENSITY
MATR. 0.0000: NEUTRON MATRIX(0=LIME,1=SAND,2=DOLO)
MDEN. 2710.0000: LOGGING MATRIX DENSITY
RMF .OHMM 0.2160: MUD FILTRATE RESISTIVITY
DFD .K/M3 1525.0000: DRILL FLUID DENSITY
~Other
Note: The ºᶟᵌᴬń tools became stuck at 625 meters causing the data
between 625 meters and 615 meters to be invalid.
~A DEPTH DT RHOB NPHI SFLU SFLA ILM ILD
1670.000 123.450 2550.000 0.450 123.450 123.450 110.200 105.600
1669.875 123.450 2550.000 0.450 123.450 123.450 110.200 105.600
1669.750 123.450 2550.000 0.450 123.450 123.450 110.200 105.600

29
data/expand_points_01.las Normal file
Просмотреть файл

@ -0,0 +1,29 @@
#
# las ¤«ï ¯à®¢¥àª¨  ¢â®¬ â¨ç¥áª®£® 㢥«¨ç¥­¨ï á« ©á®¢ ¯à¨ ç⥭¨¨
# à áè¨à¥­¨¥ ¤®«¦­® ¡ëâì ¢ë¯®«­¥­® ¤¢  à § , ¤¢¥ § ¯¨á¨ ¢ "las.warning.md"
#
~Version Information
VERS. 1.20: cp_866 CWLS log ASCII Standard - VERSION 1.20
WRAP. NO : One line per depth step
~Well Information
STRT .M 1.0 : Start depth
STOP .M 1.0 : Stop depth
STEP .M 0.10 : Step
NULL . -9999.00 : Null value
WELL . WELL : 12-‘¯«®è­ ï
~Curve Information
DEPT .M : 1 DEPTH
 <EFBFBD> .¤.¥¤. :
 <EFBFBD>.ãá«.¥¤. : et
 <EFBFBD> . :
~Parameter Information
EKB .M 72.7 : Elevation,Kelly Bushing
~ASCII Log Data
1.000 -9999.000 -9999.000 2.000
1.100 -9999.000 11.535 1.000
1.200 -9999.000 -9999.000 5.000
1.300 0.762 -9999.000 5.000
1.400 0.707 16.053 1.000
1.500 0.000 -9999.000 0.000
1.600 0.000 -9999.000 -9999.000

38
data/mnemonic.ini Normal file
Просмотреть файл

@ -0,0 +1,38 @@
[mnemonic]
DEPT = MD
SP = Потенциал самополяризации
CALI = Кавернометрия
GR = ГК
GZ1 = ГЗ1
GZ2 = ГЗ2
GZ3 = ГЗ3
GZ4 = ГЗ4
GZ5 = ГЗ5
GZ6 = ГЗ6
GZK1 = ГЗк1
GZK3 = ГЗк3
GZK4 = ГЗк4
GZK5 = ГЗк5
OGZ = обращенный ГЗ
IK = ИК
LL3 = БК
MLL = МБК
MINV = МГЗ
MCAL = МКВ
MNOR = МПЗ
RNGL = НГК
NKTB = ННКтб
NKTM = ННКтм
PZ = ПЗ
RM = рез
NPHI = W
DTP = АК
PORDT = Кп АК
6F1I = ИК сопр
BIN = Дном
RHOB = ГГКп
GGKbz = ГГКп мз
GGKmz = ГГКп бз
OGZ = ГЗ обр
RFEN = ННК бз
RNEN = ННК мз

75
data/more_20_warnings.las Normal file
Просмотреть файл

@ -0,0 +1,75 @@
~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
186 6 4 4 4 4
186 6 4 4 4 4

76
data/no-data-section.las Normal file
Просмотреть файл

@ -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
186 6 4 4 4 4
186 6 4 4 4 4

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

@ -0,0 +1,47 @@
~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 3 3 34 4 5 5 6 7 87 9
2 2 2 2 2 2 2 2 2 2 2

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

@ -0,0 +1,28 @@
~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.1 111
** **
#

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

@ -0,0 +1,25 @@
~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
  2
1.1 111

Двоичные данные
data/utf-32be-bom.las Normal file

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

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

@ -0,0 +1,24 @@
**file: data\more_20_warnings.las**
**file: data\w1_more_20_warnings.txt **
0, line: -1, desc: invalid STEP parameter, equal 0. replace to 1.000
1, line: -1, desc: invalid STRT: 0.000 or STOP: 0.000, will be replace to actually
2, line: 24, desc: can't convert string: '6.2.2' to number, set to NULL
3, line: 25, desc: not all column readed, set log value to NULL
4, line: 25, desc: not all column readed, set log value to NULL
5, line: 26, desc: actual number of data lines more than expected, check: STRT, STOP, STEP
6, line: 26, desc: expand number of points
7, line: 26, desc: line: 26 is empty, ignore
8, line: 27, desc: can't convert string: '6.2.2' to number, set to NULL
9, line: 28, desc: line: 28 is empty, ignore
10, line: 29, desc: can't convert string: '5.97.' to number, set to NULL
11, line: 30, desc: actual number of data lines more than expected, check: STRT, STOP, STEP
12, line: 30, desc: expand number of points
13, line: 30, desc: line: 30 is empty, ignore
14, line: 31, desc: can't convert string: '6.47.' to number, set to NULL
15, line: 32, desc: line: 32 is empty, ignore
16, line: 33, desc: step 64.00 ≠ previously step 1.00
17, line: 33, desc: can't convert string: '5.97.' to number, set to NULL
18, line: 34, desc: line: 34 is empty, ignore
19, line: 35, desc: step 47.00 ≠ previously step 64.00
20, line: 0, desc: *maximum count* of warning reached, change parameter 'maxWarningCount' in 'glas.ini'

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

@ -0,0 +1,24 @@
**file: data\more_20_warnings.las**
**file: data\w2_more_20_warnings.txt **
0, line: -1, desc: invalid STEP parameter, equal 0. replace to 1.000
1, line: -1, desc: invalid STRT: 0.000 or STOP: 0.000, will be replace to actually
2, line: 24, desc: can't convert string: '6.2.2' to number, set to NULL
3, line: 25, desc: not all column readed, set log value to NULL
4, line: 25, desc: not all column readed, set log value to NULL
5, line: 26, desc: actual number of data lines more than expected, check: STRT, STOP, STEP
6, line: 26, desc: expand number of points
7, line: 26, desc: line: 26 is empty, ignore
8, line: 27, desc: can't convert string: '6.2.2' to number, set to NULL
9, line: 28, desc: line: 28 is empty, ignore
10, line: 29, desc: can't convert string: '5.97.' to number, set to NULL
11, line: 30, desc: actual number of data lines more than expected, check: STRT, STOP, STEP
12, line: 30, desc: expand number of points
13, line: 30, desc: line: 30 is empty, ignore
14, line: 31, desc: can't convert string: '6.47.' to number, set to NULL
15, line: 32, desc: line: 32 is empty, ignore
16, line: 33, desc: step 64.00 ≠ previously step 1.00
17, line: 33, desc: can't convert string: '5.97.' to number, set to NULL
18, line: 34, desc: line: 34 is empty, ignore
19, line: 35, desc: step 47.00 ≠ previously step 64.00
20, line: 0, desc: *maximum count* of warning reached, change parameter 'maxWarningCount' in 'glas.ini'

24
example/-1.las Normal file
Просмотреть файл

@ -0,0 +1,24 @@
~VERSION INFORMATION
VERS. 1.2 :glas (c) softlandia@gmail.com
WRAP. NO : ONE LINE PER DEPTH STEP
CPAGE. 1251: code page
~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 :
àÏÑ.ä.åä. :
àÏÑ1.óñë.åä. :
àÏÑ2. :
~ASCII Log Data
# DEPT | àÏÑ | àÏÑ1 | àÏÑ2 |
1.000 -9999.000 -9999.000 2.000
1.100 -9999.000 11.535 1.000
1.200 -9999.000 -9999.000 5.000
1.300 0.762 -9999.000 5.000
1.400 0.707 16.053 1.000
1.500 0.000 -9999.000 0.000
1.600 0.000 -9999.000 -9999.000

28
example/1.las Normal file
Просмотреть файл

@ -0,0 +1,28 @@
~Version Information
VERS. 1.20: cp_866 CWLS log ASCII Standard - VERSION 1.20
WRAP. NO : One line per depth step
~Well Information
STRT .M 1.0 : Start depth
STOP .M 1.0 : Stop depth
STEP .M 0.10 : Step
NULL . -9999.00 : Null value
WELL . WELL : 12-‘¯«®è­ ï
~Curve Information
#----------------------------------------------------------------
#MNEM.UNIT API CODE CURVE DESCRIPTION
DEPT .M : 1 DEPTH
 <EFBFBD> .¤.¥¤. :
 <EFBFBD>.ãá«.¥¤. : et
 <EFBFBD> . :
~Parameter Information
EKB .M 72.7 : Elevation,Kelly Bushing
~ASCII Log Data
1.000 -9999.000 -9999.000 2.000
1.100 -9999.000 11.535 1.000
1.200 -9999.000 -9999.000 5.000
1.300 0.762 -9999.000 5.000
1.400 0.707 16.053 1.000
1.500 0.000 -9999.000 0.000
1.600 0.000 -9999.000 -9999.000

8
example/1.warning.md Normal file
Просмотреть файл

@ -0,0 +1,8 @@
**file: expand_points_01.las**
**file: 1.warning.md **
0, line: -1, desc: invalid STRT: 1.000 or STOP: 1.000, will be replace to actually
1, line: 25, desc: actual number of data lines more than expected, check: STRT, STOP, STEP
2, line: 25, desc: expand number of points
3, line: 27, desc: actual number of data lines more than expected, check: STRT, STOP, STEP
4, line: 27, desc: expand number of points

14
example/empty.las Normal file
Просмотреть файл

@ -0,0 +1,14 @@
~VERSION INFORMATION
VERS. 2.0 :glas (c) softlandia@gmail.com
WRAP. NO : ONE LINE PER DEPTH STEP
CPAGE. 1251: code page
~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 :
~ASCII Log Data
# DEPT |

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

@ -0,0 +1,29 @@
#
# las ¤«ï ¯à®¢¥àª¨  ¢â®¬ â¨ç¥áª®£® 㢥«¨ç¥­¨ï á« ©á®¢ ¯à¨ ç⥭¨¨
# à áè¨à¥­¨¥ ¤®«¦­® ¡ëâì ¢ë¯®«­¥­® ¤¢  à § , ¤¢¥ § ¯¨á¨ ¢ "las.warning.md"
#
~Version Information
VERS. 1.20: cp_866 CWLS log ASCII Standard - VERSION 1.20
WRAP. NO : One line per depth step
~Well Information
STRT .M 1.0 : Start depth
STOP .M 1.0 : Stop depth
STEP .M 0.10 : Step
NULL . -9999.00 : Null value
WELL . WELL : 12-‘¯«®è­ ï
~Curve Information
DEPT .M : 1 DEPTH
 <EFBFBD> .¤.¥¤. :
 <EFBFBD>.ãá«.¥¤. : et
 <EFBFBD> . :
~Parameter Information
EKB .M 72.7 : Elevation,Kelly Bushing
~ASCII Log Data
1.000 -9999.000 -9999.000 2.000
1.100 -9999.000 11.535 1.000
1.200 -9999.000 -9999.000 5.000
1.300 0.762 -9999.000 5.000
1.400 0.707 16.053 1.000
1.500 0.000 -9999.000 0.000
1.600 0.000 -9999.000 -9999.000

56
example/main.go Normal file
Просмотреть файл

@ -0,0 +1,56 @@
// glas
// Copyright 2018 softlandia@gmail.com
// Обработка las файлов. Построение словаря и замена мнемоник на справочные
package main
import (
"fmt"
"log"
"github.com/softlandia/cpd"
"github.com/softlandia/glasio"
)
//============================================================================
func main() {
test1()
test2()
}
// write empty las file
func test2() {
las := glasio.NewLas(cpd.CP866)
las.Null = -99.99
las.Rkb = 100.01
las.Strt = 0.201
las.Stop = 10.01
las.Step = 0.01
las.Well = "Примерная-101/бис"
curve := glasio.NewLasCurveFromString("SP.mV :spontaniously")
las.Logs["SP"] = curve
curve.Init(0, "SP", "SP", 5)
err := las.Save("empty.las")
log.Printf("err: %v", err)
}
// read and write las files
func test1() {
//test file "1.las"
las := glasio.NewLas()
n, err := las.Open("expand_points_01.las")
if n != 7 {
fmt.Printf("TEST read expand_points_01.las ERROR, n = %d, must 7\n", n)
fmt.Println(err)
}
las.SaveWarning("1.warning.md")
err = las.Save("-1.las")
if err != nil {
fmt.Println("TEST save -1.las ERROR: ", err)
}
las = nil
}

126
example2/1001178549.las Normal file
Просмотреть файл

@ -0,0 +1,126 @@
# 03/04/1999 13:21:59 Updated by the Kansas Geological Survey
# #KGS#ID: 30S39W/1001178549
# Additions: 1001178549.add
# New: UWI . 15-187-20743: Unique Well Id
# New: PM . 6: Principal Meridian
# Old: STAT . KANSAS: STATE
# New: STAT . Kansas: State
# New: SECT . 28: Section
# New: TOWN . 30S: Township
# New: RANG . 39W: Range
# Old: WELL . COLLINGWOOD 1-28: WELL NAME
# New: WELL . 1-28: Well Name
# New: LEAS . COLLINGWOOD: Lease Name
#
# 02/24/1999 15:12:43 Updated by the Kansas Geological Survey
# #KGS#INPUT_FILE: /home/crude2_3/WellLogs/Guy/100-Amoco/disc09/18720743.las.las
~Version : LASO vs 4.1 - DATA COPYRIGHT - RILEYS DATASHARE INTERNATIONAL
VERS . 2.0: CWLS Log ASCII Standard -VERSION 2.0
WRAP . YES: Multiple lines per depth step
~Well Information Block
#MNEM.UNIT Data Description of Mnemonic
#----.---- -------------------------- : -----------------------------
UWI . 15-187-20743: Unique Well Id
PM . 6: Principal Meridian
STAT . Kansas: State
SECT . 28: Section
TOWN . 30S: Township
RANG . 39W: Range
COUN . STANTON: County Name
COMP . AMOCO PROD: Company
WELL . 1-28: Well Name
LEAS . COLLINGWOOD: Lease Name
FLD . NICHOLAS: Field
STRT .FT 1783.5000: Start Depth
STOP .FT 1784.5000: End Depth
STEP .FT 0.2500: Depth Increment
NULL . -999.25: NULL Value
LOC . C,NW,NE, 28-30S-39W: WELL LOCATION
CTRY . UNITED STATES: COUNTRY
SRVC . HAL: LOGGING SERVICE COMPANY
DATE . 31-MAY-94: DATE LOGGED
API . 151872074300: API NUMBER
LIC . 2074300: ERCB LICENSE NUMBER
~Curve Information Block
#MNEM.UNIT API CODE Curve Description
#----.---- LG--CV-CL--M : -----------------
DEPT .FT 0 1 0 0: 1 DEPTH
GSGR .API 31 310 0 0: 2 GAMMA RAY
GSTK .API 31 797 0 0: 3 ????????
GST .API 99 999 99 0: 4 ????????
GSK .PERCNT 31 721 1 0: 5 ????????
GSTH .PPM 31 790 0 0: 6 THORIUM
GSUR .PPM 31 792 0 0: 7 URANIUM
NCNPL.PERCNT 42 890 1 0: 8 NEUTRON POROSITY (LIMESTONE)
DLDPL.PERCNT 43 890 10 0: 9 DENSITY POROSITY (LIMESTONE)
DLDC .GM/CC 43 356 0 0: 10 DENSITY CORRECTION
DLPE .B/E 43 358 0 0: 11 PHOTO-ELECTRIC EFFECT
DLDN .GM/CC 43 350 0 0: 12 BULK DENSITY
DLCL .INCHES 43 280 0 0: 13 CALIPER
DLTN .LBS 43 635 0 0: 14 ????????
IDGR .API 7 310 0 0: 15 GAMMA RAY
ACCL1.INCHES 60 280 1 0: 16 DENSITY CALIPER
ACCL2.INCHES 60 280 2 0: 17 NEUTRON CALIPER
ACTC .US/FT 60 520 0 0: 18 SONIC INTERVAL TRANSIT TIME (COMPENSATED)
ACAPL.PERCNT 60 890 20 0: 19 POROSITY
IDIM .OHMM 7 120 44 0: 20 MEDIUM INDUCTION
IDID .OHMM 7 120 46 0: 21 DEEP INDUCTION
IDIDC.MMHOS 7 110 46 0: 22 INDUCTION (CONDUCTIVITY UNITS)
IDL3 .OHMM 7 220 3 0: 23 FOCUSSED RESISTIVITY
IDTN .LBS 7 635 0 0: 24 ????????
IDSP .MVOLT 7 10 0 0: 25 SPONTANEOUS POTENTIAL
MEL1 .OHMM 15 250 2 0: 26 MICRO INVERSE 1"
ME .OHMM 15 252 2 0: 27 MICRO NORMAL 2"
~Parameter Information Block
#MNEM.UNIT Data Description of Mnemonic
#----.---- -------------------------- : -----------------------------
RUN . 99: Run Number
GL .FT 3190.0000: Ground Level Elevation
DREF . KB: Depth Reference
EREF .FT 3210.0000: Elevation of Depth Reference
CSGL .FT 1791.0000: Casing Bottom Logger
CSGD .FT 0.0000: Casing Bottom Driller
CSGS .IN 8.6250: Casing Size
CSGW .LBS 0.0000: Casing Weight
BHT .DEGF 125.0000: Bottom Hole Temperature
BS .IN 7.8750: Bit Size
RM .OHMM 2.1100: Mud Resistivity
RMT .DEGF 80.0000: Mud Resistivity Temperature
RMF .OHMM 1.5800: Mud Filtrate Resistivity
RMFT .DEGF 80.0000: RMF Temperature
RMC .OHMM 2.7400: Mud Cake Resistivity
RMCT .DEGF 80.0000: RMC Temperature
LAT . 37.41565: Latitude
LONG . -101.58701: Longitude
# DEPTH
# GSGR GSTK GST GSK GSTH GSUR NCNPL
# DLDPL DLDC DLPE DLDN DLCL DLTN IDGR
# ACCL1 ACCL2 ACTC ACAPL IDIM IDID IDIDC
# IDL3 IDTN IDSP MEL1 ME
~Asc DEPTH
1783.5000
-999.2500 -999.2500 -999.2500 -999.2500 -999.2500 -999.2500 -999.2500
-999.2500 -999.2500 -999.2500 -999.2500 -999.2500 -999.2500 50.6465
8.3871 8.4396 55.1000 0.0569 560.0000 175.0000 0.0500
0.4533 1893.0420 92.6050 -999.2500 -999.2500
1783.7500
-999.2500 -999.2500 -999.2500 -999.2500 -999.2500 -999.2500 -999.2500
-999.2500 -999.2500 -999.2500 -999.2500 -999.2500 -999.2500 49.6767
8.3951 8.4460 54.3555 0.0590 560.0000 175.0000 0.0500
0.4534 1852.3320 92.7780 -999.2500 -999.2500
1784.0000
-999.2500 -999.2500 -999.2500 -999.2500 -999.2500 -999.2500 -999.2500
-999.2500 -999.2500 -999.2500 -999.2500 -999.2500 -999.2500 48.6313
8.4052 8.4460 54.4444 0.0581 560.0000 175.0000 0.0500
0.4537 1831.9766 92.9482 -999.2500 -999.2500
1784.2500
-999.2500 -999.2500 -999.2500 -999.2500 -999.2500 -999.2500 -999.2500
-999.2500 -999.2500 -999.2500 -999.2500 -999.2500 -999.2500 47.7717
8.4173 8.4438 55.3111 0.0577 560.0000 175.0000 0.0500
0.4538 1831.9766 93.1103 -999.2500 -999.2500
1784.5000
-999.2500 -999.2500 -999.2500 -999.2500 -999.2500 -999.2500 -999.2500
-999.2500 -999.2500 -999.2500 -999.2500 -999.2500 -999.2500 48.1149
8.4253 8.4460 56.3222 0.0585 560.0000 175.0000 0.0500
0.4539 1811.6211 93.2671 -999.2500 -999.2500

2792
example2/6038187_v1.2.las Normal file

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

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

@ -0,0 +1,181 @@
#------------------------------------------------------------
~VERSION INFORMATION
VERS. 2.0 :CWLS LOG ASCII STANDARD - VERSION 2.0
WRAP. NO :ONE LINE PER DEPTH STEP
#------------------------------------------------------------
~WELL INFORMATION
STRT.M 0.0500000 :FIRST INDEX VALUE
STOP.M 136.600 :LAST INDEX VALUE
STEP.M 0.0500000 :STEP
NULL. -99999 :NULL VALUE
COMP. :COMP
WELL. Scorpio E1 :WELL
FLD. :
LOC. Mt Eba :LOC
SRVC. :
CTRY. :
STAT. SA :STAT
CNTY. :
DATE. 15/03/2015 :DATE
UWI. 6038-187 :WUNT
#------------------------------------------------------------
~CURVE INFORMATION
DEPT.M :DEPTH
CALI.MM :CALI
DFAR.G/CM3 :DFAR
DNEAR.G/CM3 :DNEAR
GAMN.GAPI :GAMN
NEUT.CPS :NEUT
PR.OHM/M :PR
SP.MV :SP
COND.MS/M :COND
#------------------------------------------------------------
~PARAMETER INFORMATION
BS. 216 mm :BS
JOBN. :JOBN
WPMT. :WPMT
AGL. :AGL
PURP. Cased hole stratigraphy :PURP
X. 0560160 :X
CSGL. 0 m - 135 m :CSGL
UNIT. :UNIT
Y. 6686430 :Y
TDL. 135.2 m :TDL
PROD. :PROD
MUD. Water :MUD
CSGS. 100 mm :CSGS
ENG. :ENG
STEP. 5 cm :STEP
FluidLevel. 54 m :FluidLevel
CSGT. PVC :CSGT
WIT. :WIT
EREF. :EREF
PROJ. :PROJ
ZONE. 53J :ZONE
DREF. GL :DREF
TDD. 136 m :TDD
#------------------------------------------------------------
~OTHER
#------------------------------------------------------------
~A DEPT[M] CALI DFAR DNEAR GAMN NEUT PR SP COND
12.0000 101.780 0.883000 0.814000 65.0846 1152.01 50499.9 100.592 822.680
12.0500 101.738 0.883000 0.843000 65.0800 1233.99 50499.9 100.510 810.824
12.1000 101.738 0.873000 0.808001 53.4612 1212.00 50499.9 100.580 801.439
12.1500 101.858 0.878000 0.813000 79.0231 1161.01 50499.9 100.555 796.745
12.2000 101.798 0.878000 0.787000 41.8448 1080.02 50499.9 100.552 785.137
12.2500 101.756 0.869000 0.765000 81.3450 1188.98 50499.9 100.537 772.293
12.3000 101.804 0.882000 0.811000 67.4063 1164.00 50499.9 100.580 757.966
12.3500 101.798 0.880000 0.823000 74.3767 1169.00 50499.9 100.543 757.965
12.4000 101.852 0.877000 0.823000 62.7573 1202.00 50499.9 100.543 735.738
12.4500 101.870 0.878000 0.826000 58.1080 1168.01 50499.9 100.586 716.967
12.5000 101.906 0.870000 0.850000 60.4316 1179.00 50499.9 100.540 715.481
12.5500 101.816 0.883000 0.862000 69.7281 1146.00 50499.9 100.510 713.999
12.6000 101.714 0.864001 0.815002 53.4621 1169.00 50499.9 100.549 730.545
12.6500 101.768 0.863000 0.802000 81.3478 1182.00 50499.9 100.519 738.698
12.7000 101.816 0.869000 0.808000 51.1413 1156.01 50499.9 100.537 757.467
12.7500 101.828 0.875000 0.797000 83.6700 1154.00 50499.9 100.540 775.746
12.8000 101.696 0.865000 0.907000 58.1094 1142.00 50499.9 100.543 790.321
12.8500 101.690 0.867000 0.808004 65.0787 1146.00 50499.9 100.516 790.322
12.9000 101.744 0.851000 0.826000 72.0522 1171.00 50499.9 100.494 806.869
12.9500 101.660 0.851000 0.796000 53.4629 1119.01 50499.9 100.528 816.749
13.0000 101.600 0.837000 0.815000 67.4029 1070.01 50499.9 100.531 826.383
13.0500 101.708 0.839000 0.813000 74.3773 1150.99 50499.9 100.519 835.522
13.1000 101.780 0.838000 0.827999 81.3497 1256.98 50499.9 100.531 848.858
13.1500 101.792 0.837000 0.809000 79.0263 1291.00 50499.9 100.513 861.210
13.2000 101.618 0.847000 0.761000 97.6171 1301.00 50499.9 100.531 861.211
13.2500 101.576 0.846000 0.797000 65.0850 1371.99 50499.9 100.543 881.462
13.3000 101.606 0.845000 0.767000 85.9970 1358.00 50499.9 100.528 885.417
13.3500 101.504 0.822001 0.838997 65.0840 1368.00 50499.9 100.482 885.911
13.4000 101.516 0.793000 0.876000 85.9966 1482.99 50499.9 100.540 889.616
13.4500 101.540 0.726000 0.896000 65.0844 1423.01 50499.9 100.519 895.296
13.5000 101.546 0.725000 0.897000 111.559 1350.01 50499.9 100.510 900.730
13.5500 101.450 0.725000 0.894000 74.3815 1156.02 50499.9 100.543 905.671
13.6000 101.612 0.762999 0.899000 90.6449 1013.03 50499.9 100.485 906.659
13.6500 101.744 0.755000 0.835000 81.3521 876.016 50499.9 100.473 894.804
13.7000 101.762 0.793000 0.809000 58.1119 798.016 50499.9 100.497 883.196
13.7500 101.762 0.836000 0.783000 62.7553 629.026 50499.9 100.476 915.546
13.8000 101.792 0.959000 0.683000 69.7283 618.001 50499.9 100.476 945.188
13.8500 101.816 1.04500 0.657001 76.7007 659.992 50499.9 100.470 945.932
13.9000 101.696 1.13300 0.800000 58.1091 689.997 50499.9 100.476 922.717
13.9500 101.696 1.23100 1.11100 79.0216 765.984 50499.9 100.491 757.012
14.0000 101.666 1.34000 1.43400 60.4348 753.002 50499.9 100.433 941.705
14.0500 101.690 1.38600 1.46300 67.4043 741.001 50499.9 100.424 1071.64
14.1000 101.858 1.35800 1.46200 74.3767 734.001 50499.9 100.400 1215.13
14.1500 101.810 1.35700 1.47100 53.4614 767.996 50499.9 100.381 863.968
14.2000 101.792 1.35400 1.55800 55.7825 730.008 50499.9 100.342 699.707
14.2500 101.828 1.37800 1.66600 67.4032 747.997 50499.9 100.360 333.181
14.3000 101.810 1.37200 1.74200 62.7564 762.999 50499.9 100.296 36.2593
14.3500 101.540 1.42300 1.77800 62.7560 793.994 50499.9 100.314 26.8468
14.4000 101.540 1.42500 1.66700 53.4601 776.002 50499.9 100.275 24.3753
14.4500 101.516 1.41700 1.60800 74.3736 854.983 50499.9 100.299 89.3224
14.5000 101.516 1.41600 1.54200 46.4903 827.004 50499.9 100.214 479.289
14.5500 101.498 1.41200 1.55700 60.4307 886.994 50499.9 100.214 282.756
14.6000 101.504 1.44800 1.67200 60.4320 869.003 50499.9 100.375 398.805
14.6500 101.540 1.43000 1.59000 69.7279 863.001 50499.9 100.555 411.670
14.7000 101.348 1.41300 1.57800 32.5478 869.999 50499.9 100.607 697.637
14.7500 101.366 1.43600 1.58100 88.3145 884.998 50499.9 100.610 1003.44
14.8000 101.420 1.38200 1.51400 85.9992 919.997 50499.9 100.598 1050.16
14.8500 101.408 1.39100 1.54300 92.9707 879.008 50499.9 100.601 944.470
14.9000 101.360 1.40900 1.50600 81.3523 909.996 50499.9 100.562 819.729
14.9500 101.318 1.38400 1.51600 60.4364 931.995 50499.9 100.562 805.886
15.0000 101.324 1.38200 1.43900 72.0512 954.996 50499.9 100.568 758.219
15.0500 101.348 1.39000 1.51000 76.7016 986.997 50499.9 100.562 733.761
15.1000 101.307 1.39800 1.50000 123.179 970.003 50499.9 100.574 685.356
15.1500 101.283 1.42300 1.52900 60.4392 953.002 50499.9 100.549 647.066
15.2000 101.378 1.42700 1.53800 67.4035 925.006 50499.9 100.592 631.504
15.2500 101.295 1.41800 1.54000 106.912 899.004 50499.9 100.574 613.226
15.3000 101.283 1.40900 1.46800 83.6772 952.995 50499.9 100.562 589.513
15.3500 101.396 1.39800 1.47900 85.9986 967.997 50499.9 100.662 570.743
15.4000 101.360 1.43800 1.47100 74.3793 926.005 50499.9 100.604 560.366
15.4500 101.372 1.43700 1.55000 58.1104 924.000 50499.9 100.616 544.560
15.5000 101.348 1.42900 1.54300 95.2903 936.998 50499.9 100.610 528.504
15.5500 101.408 1.42000 1.53700 69.7314 968.997 50499.9 100.632 525.291
15.6000 101.402 1.43700 1.55300 76.7007 922.009 50499.9 100.601 510.721
15.6500 101.498 1.44800 1.51100 97.6186 934.999 50499.9 100.586 505.038
15.7000 101.432 1.46600 1.55000 81.3544 931.001 50499.9 100.595 504.049
15.7500 101.516 1.43700 1.48500 72.0544 945.998 50499.9 100.598 495.405
15.8000 101.594 1.43700 1.48100 69.7292 913.003 50499.9 100.613 492.193
15.8500 101.528 1.43100 1.50900 76.7007 903.002 50499.9 100.571 481.327
15.9000 101.534 1.45200 1.52400 72.0535 964.993 50499.9 100.586 478.855
15.9500 101.528 1.44000 1.53900 67.4060 937.006 50499.9 100.607 471.940
16.0000 101.528 1.46300 1.56800 69.7286 925.002 50499.9 100.601 466.259
16.0500 101.528 1.47800 1.55900 65.0804 909.001 50499.9 100.616 465.023
16.1000 101.660 1.49200 1.55600 69.7281 920.998 50499.9 100.629 453.663
16.1500 101.732 1.48700 1.56800 85.9971 924.000 50499.9 100.629 449.709
16.2000 101.696 1.47100 1.60600 95.2939 906.004 50499.9 100.641 448.968
16.2500 101.714 1.49700 1.58000 113.888 980.989 50499.9 100.632 448.968
16.3000 101.696 1.48700 1.60000 74.3810 949.002 50499.9 100.632 444.275
16.3500 101.660 1.47800 1.58700 90.6449 908.008 50499.9 100.613 437.854
16.4000 101.666 1.50300 1.58500 88.3233 899.001 50499.9 100.616 433.901
16.4500 101.780 1.48700 1.55700 83.6761 934.992 50499.9 100.616 432.913
16.5000 101.720 1.48800 1.56800 60.4355 956.997 50499.9 100.604 423.528
16.5500 101.624 1.49100 1.57600 104.590 969.999 50499.9 100.629 413.648
16.6000 101.696 1.48600 1.57200 123.184 954.003 50499.9 100.653 399.571
16.6500 101.696 1.50100 1.59800 88.3270 933.002 50499.9 100.641 386.478
16.7000 101.684 1.49500 1.54700 51.1435 1023.98 50499.9 100.598 381.538
16.7500 101.708 1.49300 1.58200 79.0217 950.011 50499.9 100.632 374.128
16.8000 101.690 1.48300 1.53000 58.1086 1002.00 50499.9 100.626 362.766
16.8500 101.690 1.49000 1.53400 74.3749 1030.99 50499.9 100.601 349.430
16.9000 101.762 1.47400 1.52500 67.4058 1074.00 50499.9 100.595 345.475
16.9500 101.840 1.50500 1.54300 120.852 1161.98 50499.9 100.616 334.609
17.0000 101.636 1.48200 1.56200 69.7368 1113.01 50499.9 100.604 328.927
17.0500 101.612 1.48900 1.52700 69.7290 1051.00 50499.9 100.629 303.487
17.1000 101.576 1.47600 1.52400 99.9392 1067.00 50499.9 100.620 270.887
17.1500 101.618 1.45500 1.52200 55.7881 1167.99 50499.9 100.607 256.557
17.2000 101.492 1.48200 1.53200 83.6686 1312.97 50499.9 100.595 221.489
17.2500 102.715 1.48700 1.49900 109.238 1478.97 50499.9 100.531 227.902
17.3000 101.157 1.47700 1.45600 76.7045 1536.00 50499.9 100.555 199.253
17.3500 101.432 1.45500 1.54800 83.6737 1584.99 50499.9 100.531 168.876
17.4000 101.636 1.44400 1.53000 69.7306 1592.00 50499.9 100.519 128.614
17.4500 101.594 1.45500 1.48000 62.7576 1483.02 50499.9 100.562 125.646
17.5000 101.474 1.46000 1.46000 76.6999 1557.99 50499.9 100.519 108.852
17.5500 101.546 1.41800 1.48700 76.7020 1546.00 50499.9 100.543 101.934
17.6000 101.366 1.42900 1.48900 81.3501 1604.99 50499.9 100.549 98.2287
17.6500 101.318 1.37400 1.49000 85.9985 1546.01 50499.9 100.537 85.1385
17.7000 101.384 1.40100 1.47700 90.6469 1518.01 50499.9 100.549 76.2470
17.7500 101.384 1.39100 1.46600 81.3524 1469.01 50499.9 100.565 78.4677
17.8000 101.295 1.37400 1.49000 104.591 1438.00 50499.9 100.555 65.1310
17.8500 101.223 1.38200 1.46500 88.3261 1403.01 50499.9 100.555 66.1178
17.9000 101.241 1.41700 1.48200 90.6477 1413.00 50499.9 100.537 68.8347
17.9500 101.235 1.37800 1.45100 95.2949 1316.02 50499.9 100.558 69.3289
18.0000 101.259 1.38100 1.42600 88.3241 1347.00 50499.9 100.562 65.3776

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

@ -0,0 +1,46 @@
~VERSION INFORMATION
VERS. 1.2: CWLS LOG ASCII STANDARD -VERSION 1.2
WRAP. NO: ONE LINE PER DEPTH STEP
~WELL INFORMATION BLOCK
#MNEM.UNIT DATA TYPE INFORMATION
#--------- ------------- ------------------------------
STRT.M 1670.000000:
STOP.M 1660.000000:
STEP.M -0.1250:
NULL. -999.2500:
COMP. 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 COMPANY: ANY LOGGING COMPANY LTD.
DATE. LOG DATE: 25-DEC-1988
UWI . UNIQUE WELL ID: 05123370660000
~CURVE INFORMATION
#MNEM.UNIT API CODE CURVE DESCRIPTION
#--------- ------------- ------------------------------
DEPT.M : 1 DEPTH
DT .US/M : 2 SONIC TRANSIT TIME
RHOB.K/M3 : 3 BULK DENSITY
NPHI.V/V : 4 NEUTRON POROSITY
SFLU.OHMM : 5 RXO RESISTIVITY
SFLA.OHMM : 6 SHALLOW RESISTIVITY
ILM .OHMM : 7 MEDIUM RESISTIVITY
ILD .OHMM : 8 DEEP RESISTIVITY
~PARAMETER INFORMATION
#MNEM.UNIT VALUE DESCRIPTION
#--------- ------------- ------------------------------
BHT .DEGC 35.5000: BOTTOM HOLE TEMPERATURE
BS .MM 200.0000: BIT SIZE
FD .K/M3 1000.0000: FLUID DENSITY
MATR. 0.0000: NEUTRON MATRIX(0=LIME,1=SAND,2=DOLO)
MDEN. 2710.0000: LOGGING MATRIX DENSITY
RMF .OHMM 0.2160: MUD FILTRATE RESISTIVITY
DFD .K/M3 1525.0000: 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.
~A DEPTH DT RHOB NPHI SFLU SFLA ILM ILD
1670.000 123.450 2550.000 0.450 123.450 123.450 110.200 105.600
1669.875 123.450 2550.000 0.450 123.450 123.450 110.200 105.600
1669.750 123.450 2550.000 0.450 123.450 123.450 110.200 105.600

66
example2/main.go Normal file
Просмотреть файл

@ -0,0 +1,66 @@
package main
import (
"fmt"
"log"
"os"
"path/filepath"
"strings"
"github.com/softlandia/glasio"
)
//Пример чтения и сохранения нескольких LAS файлов
func main() {
fileList := make([]string, 0, 10)
n := findFilesExt(&fileList, ".\\", ".las")
fmt.Printf("files founded: %d\n", n)
if n == 0 {
os.Exit(0)
}
for _, f := range fileList {
repaireLas(f)
}
}
func repaireLas(fileName string) {
las := glasio.NewLas()
las.FileName = fileName
fmt.Printf("file: '%s'", fileName)
n, err := las.Open(fileName) // считываем файл
fmt.Printf(" readed\n")
// примеры проверки прочитанного las файла
if las.IsWraped() {
fmt.Printf("wraped\n")
return
}
if n == 0 {
fmt.Printf("data not exist\n")
return
}
if err != nil {
fmt.Printf("error: %v\n", err) // Open() неохотно возвращает err, скорее всего ну вообще не получается прочитать
}
las.Save(las.FileName + "-") //сохраняем с символом минус в расширении
}
func findFilesExt(fileList *[]string, path, fileNameExt string) int {
extFile := strings.ToUpper(fileNameExt)
index := 0 //index founded files
filepath.Walk(path, func(path string, info os.FileInfo, err error) error {
if err != nil {
log.Printf("prevent panic by handling failure accessing a path %q: %v\n", path, err)
return err
}
if info.IsDir() {
return nil //skip folders
}
if strings.ToUpper(filepath.Ext(path)) != extFile {
return nil //skip files with wrong extention
}
index++
*fileList = append(*fileList, path)
return nil
})
return index
}

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

@ -0,0 +1,46 @@
~VERSION INFORMATION
VERS . 1.2: CWLS LOG ASCII STANDARD -VERSION 1.2
WRAP . NO: ONE LINE PER DEPTH STEP
~WELL INFORMATION BLOCK
#MNEM.UNIT DATA TYPE INFORMATION
#--------- ------------- ------------------------------
STRT.M 1670.000000:
STOP.M 1660.000000:
STEP.M -0.1250:
NULLPL. -999.2500:
COMP. 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 COMPANY: ANY LOGGING COMPANY AT ALL!!!!
DATE. LOG DATE: 25-DEC-1988
UWI . UNIQUE WELL ID: 100091604920W300
~CURVE INFORMATION
#MNEM.UNIT API CODE CURVE DESCRIPTION
#--------- ------------- ------------------------------
DEPT.M : 1 DEPTH
DT .US/M : 2 SONIC TRANSIT TIME
RHOB.K/M3 : 3 BULK DENSITY
NPHI.V/V : 4 NEUTRON POROSITY
SFLU.OHMM : 5 RXO RESISTIVITY
SFLA.OHMM : 6 SHALLOW RESISTIVITY
ILM .OHMM : 7 MEDIUM RESISTIVITY
ILD .OHMM : 8 DEEP RESISTIVITY
~PARAMETER INFORMATION
#MNEM.UNIT VALUE DESCRIPTION
#--------- ------------- ------------------------------
BHT .DEGC 35.5000: BOTTOM HOLE TEMPERATURE
BS .MM 200.0000: BIT SIZE
FD .K/M3 1000.0000: FLUID DENSITY
MATR. 0.0000: NEUTRON MATRIX(0=LIME,1=SAND,2=DOLO)
MDEN. 2710.0000: LOGGING MATRIX DENSITY
RMF .OHMM 0.2160: MUD FILTRATE RESISTIVITY
DFD .K/M3 1525.0000: 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.
~A DEPTH DT RHOB NPHI SFLU SFLA ILM ILD
1670.000 123.450 2550.000 0.450 123.450 123.450 110.200 105.600
1669.875 123.450 2550.000 0.450 123.450 123.450 110.200 105.600
1669.750 123.450 2550.000 0.450 123.450 123.450 110.200 105.600

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

@ -0,0 +1,42 @@
~VERSION INFORMATION
VERS . 1.2: CWLS LOG ASCII STANDARD -VERSION 1.2
WRAP . NO: ONE LINE PER DEPTH STEP
~WELL INFORMATION BLOCK
#MNEM.UNIT DATA TYPE INFORMATION
#--------- ------------- ------------------------------
STRT.M 1670.000000:
STOP.M 1660.000000:
STEP.M -0.1250:
NULL. -999.2500:
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
#MNEM.UNIT API CODE CURVE DESCRIPTION
#--------- ------------- ------------------------------
D .M : 1 DEPTH
A .US/M : 2 SONIC TRANSIT TIME
B .K/M3 : 3 BULK DENSITY
C .V/V : 4 NEUTRON POROSITY
~PARAMETER INFORMATION
#MNEM.UNIT VALUE DESCRIPTION
#--------- ------------- ------------------------------
BHT .DEGC 35.5000: BOTTOM HOLE TEMPERATURE
BS .MM 200.0000: BIT SIZE
FD .K/M3 1000.0000: FLUID DENSITY
MATR. 0.0000: NEUTRON MATRIX(0=LIME,1=SAND,2=DOLO)
MDEN. 2710.0000: LOGGING MATRIX DENSITY
RMF .OHMM 0.2160: MUD FILTRATE RESISTIVITY
DFD .K/M3 1525.0000: 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.
~A DEPTH DT RHOB NPHI SFLU SFLA ILM ILD
1670.000 123.450 2550.000 0.450 123.450 123.450 110.200 105.600
1669.875 123.450 2550.000 0.450 123.450 123.450 110.200 105.600
1669.750 123.450 2550.000 0.450 123.450 123.450 110.200 105.600

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

@ -0,0 +1,47 @@
~VERSION INFORMATION
VERS. 2.0 : CWLS LOG ASCII STANDARD -VERSION 2.0
WRAP. NO : ONE LINE PER DEPTH STEP
~WELL INFORMATION
#MNEM.UNIT DATA DESCRIPTION
#----- ----- ---------- -------------------------
STRT .M 1670.0000 :START DEPTH
STOP .M 1660.0000 :STOP DEPTH
STEP .M -0.1250 :STEP
NULL . -999.25 :NULL VALUE
COMP . ANY :COMPANY
WELL . AAAAA_2 :WELL
FLD . WILDCAT :FIELD
LOC . 12 :LOCATION
PROV . ALBERTA :PROVINCE
SRVC . LOGGING:SERVICE COMPANY ARE YOU KIDDING THIS IS A REALLY REALLY LONG STRING
DATE . 13-DEC-86 :LOG DATE
UWI . 10012340 :UNIQUE WELL ID
~CURVE INFORMATION
#MNEM.UNIT API CODES CURVE DESCRIPTION
#------------------ ------------ -------------------------
DEPT .M : 1 DEPTH
DT .US/M 60 520 32 00 : 2 SONIC TRANSIT TIME
RHOB .K/M3 45 350 01 00 : 3 BULK DENSITY
NPHI .V/V 42 890 00 00 : 4 NEUTRON POROSITY
SFLU .OHMM 07 220 04 00 : 5 SHALLOW RESISTIVITY
SFLA .OHMM 07 222 01 00 : 6 SHALLOW RESISTIVITY
ILM .OHMM 07 120 44 00 : 7 MEDIUM RESISTIVITY
ILD .OHMM 07 120 46 00 : 8 DEEP RESISTIVITY
~PARAMETER INFORMATION
#MNEM.UNIT VALUE DESCRIPTION
#-------------- ---------------- -----------------------------------------------
MUD . GEL CHEM : MUD TYPE
BHT .DEGC 35.5000 : BOTTOM HOLE TEMPERATURE
BS .MM 200.0000 : BIT SIZE
FD .K/M3 1000.0000 : FLUID DENSITY
MATR . SAND : NEUTRON MATRIX
MDEN . 2710.0000 : LOGGING MATRIX DENSITY
RMF .OHMM 0.2160 : MUD FILTRATE RESISTIVITY
DFD .K/M3 1525.0000 : DRILL FLUID DENSITY
~OTHER
Note: The logging tools became stuck at 625 metres causing the data
between 625 metres and 615 metres to be invalid.
~A DEPTH DT RHOB NPHI SFLU SFLA ILM ILD
1670.000 123.450 2550.000 0.450 123.450 123.450 110.200 105.600
1669.875 123.450 2550.000 0.450 123.450 123.450 110.200 105.600
1669.750 123.450 2550.000 0.450 123.450 123.450 110.200 105.600

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

@ -0,0 +1,47 @@
~VERSION INFORMATION
VERS. 2.0 : CWLS LOG ASCII STANDARD -VERSION 2.0
WRAP. NO : ONE LINE PER DEPTH STEP
~WELL INFORMATION
#MNEM.UNIT DATA DESCRIPTION
#----- ----- ---------- -------------------------
STRT .M 1670.0000 :START DEPTH
STOP .M 1660.0000 :STOP DEPTH
STEP .M -0.1250 :STEP
NULL . -999.25 :NULL VALUE
COMP . ANY OIL COMPANY INC. :COMPANY
WELL . AAAAA_2 :WELL
FLD . WILDCAT :FIELD
LOC . 12-34-12-34W5M :LOCATION
PROV . ALBERTA :PROVINCE
SRVC . The company that did this logging has a very very long name....:SERVICE COMPANY
DATE . 13-DEC-86 :LOG DATE
UWI . 100123401234W500 :UNIQUE WELL ID
~CURVE INFORMATION
#MNEM.UNIT API CODES CURVE DESCRIPTION
#------------------ ------------ -------------------------
DEPT .M : 1 DEPTH
DT .US/M 60 520 32 00 : 2 SONIC TRANSIT TIME
RHOB .K/M3 45 350 01 00 : 3 BULK DENSITY
NPHI .V/V 42 890 00 00 : 4 NEUTRON POROSITY
SFLU .OHMM 07 220 04 00 : 5 SHALLOW RESISTIVITY
SFLA .OHMM 07 222 01 00 : 6 SHALLOW RESISTIVITY
ILM .OHMM 07 120 44 00 : 7 MEDIUM RESISTIVITY
ILD .OHMM 07 120 46 00 : 8 DEEP RESISTIVITY
~PARAMETER INFORMATION
#MNEM.UNIT VALUE DESCRIPTION
#-------------- ---------------- -----------------------------------------------
MUD . GEL CHEM : MUD TYPE
BHT .DEGC 35.5000 : BOTTOM HOLE TEMPERATURE
BS .MM 200.0000 : BIT SIZE
FD .K/M3 1000.0000 : FLUID DENSITY
MATR . SAND : NEUTRON MATRIX
MDEN . 2710.0000 : LOGGING MATRIX DENSITY
RMF .OHMM 0.2160 : MUD FILTRATE RESISTIVITY
DFD .K/M3 1525.0000 : DRILL FLUID DENSITY
~OTHER
Note: The logging tools became stuck at 625 metres causing the data
between 625 metres and 615 metres to be invalid.
~A DEPTH DT RHOB NPHI SFLU SFLA ILM ILD
1670.000 123.450 2550.000 0.450 123.450 123.450 110.200 105.600
1669.875 123.450 2550.000 0.450 123.450 123.450 110.200 105.600
1669.750 123.450 2550.000 0.450 123.450 123.450 110.200 105.600

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

@ -0,0 +1,46 @@
~VERSION INFORMATION
VERS. 1.2: CWLS LOG ASCII STANDARD -VERSION 1.2
WRAP. NO: ONE LINE PER DEPTH STEP
~WELL INFORMATION BLOCK
#MNEM.UNIT DATA TYPE INFORMATION
#--------- ------------- ------------------------------
STRT.M 1670.000000:
STOP.M 1660.000000:
STEP.M -0.1250:
NULL. -999.2500:
COMP. 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 COMPANY: ANY LOGGING COMPANY LTD.
DATE. LOG DATE: 25-DEC-1988
UWI . UNIQUE WELL ID: 100091604920W300
~CURVE INFORMATION
#MNEM.UNIT API CODE CURVE DESCRIPTION
#--------- ------------- ------------------------------
DEPT.M
DT .US/M
RHOB.K/M3
NPHI.V/V
SFLU.OHMM
SFLA.OHMM
ILM .OHMM
ILD .OHMM
~PARAMETER INFORMATION
#MNEM.UNIT VALUE DESCRIPTION
#--------- ------------- ------------------------------
BHT .DEGC 35.5000: BOTTOM HOLE TEMPERATURE
BS .MM 200.0000: BIT SIZE
FD .K/M3 1000.0000: FLUID DENSITY
MATR. 0.0000: NEUTRON MATRIX(0=LIME,1=SAND,2=DOLO)
MDEN. 2710.0000: LOGGING MATRIX DENSITY
RMF .OHMM 0.2160: MUD FILTRATE RESISTIVITY
DFD .K/M3 1525.0000: 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.
~A DEPTH DT RHOB NPHI SFLU SFLA ILM ILD
1670.000 123.450 2550.000 0.450 123.450 123.450 110.200 105.600
1669.875 123.450 2550.000 0.450 123.450 123.450 110.200 105.600
1669.750 123.450 2550.000 0.450 123.450 123.450 110.200 105.600

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

@ -0,0 +1,139 @@
//(c) softland 2019-2020
//softlandia@gmail.com
package glasio
import (
"bufio"
"fmt"
"os"
fp "path/filepath"
"testing"
"github.com/softlandia/cpd"
"github.com/stretchr/testify/assert"
)
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")
buf := bufio.NewWriter(f)
n := las.SaveWarningToWriter(buf)
f.Close()
assert.Equal(t, 21, n)
}
type tGetDataStep struct {
fn string
st float64
}
var dGetDataStep = []tGetDataStep{
{fp.Join("data/step-2-data-without-step-case1.las"), -32768.000},
{fp.Join("data/step-2-data-without-step-case2.las"), -32768.000},
{fp.Join("data/no-data-section.las"), -32768.000},
{fp.Join("data/step-1-normal-case.las"), 1.0},
}
func TestGetStepFromData(t *testing.T) {
for _, tmp := range dGetDataStep {
las := NewLas()
las.Open(tmp.fn)
assert.Equal(t, tmp.st, las.Step)
}
}
//Тестирование увеличения чоличества точек
type tExpandDept struct {
fn string
n int //количество считанных точек данных
nWrn int //количество предупреждений
}
var dExpandDept = []tExpandDept{
{fp.Join("data/expand_points_01.las"), 7, 5},
}
func TestExpandPoints(t *testing.T) {
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, n, tmp.n, fmt.Sprintf("<TestExpandPoints> on '%s' return n: %d expect: %d\n", tmp.fn, n, tmp.n))
assert.Equal(t, las.Warnings.Count(), tmp.nWrn, 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"))
assert.Equal(t, -9999.00, las.Null)
las.SetNull(-999.25)
assert.Equal(t, -999.25, las.Null)
las.Save("-tmp.las")
las.Open("-tmp.las")
assert.Equal(t, -999.25, las.Null)
log := las.Logs["аПС"]
assert.Equal(t, las.Null, log.log[2])
assert.Equal(t, las.Null, las.Logs["аПС2"].log[6])
err := os.Remove("-tmp.las")
assert.Nil(t, err, fmt.Sprintf("%v", err))
}
// проверяется запись
// первый раз в кодировке 1251
// второй раз в кодировке 866
// дополнительно проверяем функцию SetNull
func TestLasSave(t *testing.T) {
//стандартный las файл
las := NewLas()
las.Null = -99.99
las.Strt = 0.201
las.Stop = 10.01
las.Step = 0.01
las.Well = "Примерная-101/бис"
curve := NewLasCurveFromString("SP.mV :spontaniously")
las.Logs["SP"] = curve
curve.Init(0, "SP", "SP", 5)
os.Remove("empty.las")
err := las.Save("empty.las")
assert.Nil(t, err)
n, err := las.Open("empty.las")
assert.Equal(t, 0, n)
assert.Equal(t, -99.99, las.Null)
assert.Equal(t, 0.201, las.Strt)
assert.Equal(t, 10.01, las.Stop)
assert.Equal(t, 0.01, las.Step)
assert.Equal(t, "Примерная-101/бис", las.Well)
// las файл в формате 866
las = NewLas(cpd.CP866)
las.Null = -99.99
las.Strt = 0.201
las.Stop = 10.01
las.Step = 0.01
las.Well = "Примерная-101/бис"
curve = NewLasCurveFromString("SP.mV :spontaniously")
las.Logs["SP"] = curve
curve.Init(0, "SP", "SP", 5)
las.SetNull(100.001)
os.Remove("empty.las")
err = las.Save("empty.las")
assert.Nil(t, err)
n, err = las.Open("empty.las")
assert.Equal(t, 0, n)
assert.Equal(t, 100.001, las.Null)
assert.Equal(t, 0.201, las.Strt)
assert.Equal(t, 10.01, las.Stop)
assert.Equal(t, 0.01, las.Step)
assert.Equal(t, "Примерная-101/бис", las.Well)
os.Remove("empty.las")
}

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

@ -0,0 +1,751 @@
package glasio
import (
"bufio"
"errors"
"fmt"
"io"
"math"
"os"
"path/filepath"
"strconv"
"strings"
"github.com/softlandia/cpd"
"github.com/softlandia/xlib"
"golang.org/x/text/encoding/charmap"
"golang.org/x/text/transform"
)
///format strings represent structure of LAS file
const (
_LasFirstLine = "~VERSION INFORMATION\n"
_LasVersion = "VERS. %3.1f :glas (c) softlandia@gmail.com\n"
_LasCodePage = "CPAGE. 1251: code page \n"
_LasWrap = "WRAP. NO : ONE LINE PER DEPTH STEP\n"
_LasWellInfoSec = "~WELL INFORMATION\n"
_LasMnemonicFormat = "#MNEM.UNIT DATA :DESCRIPTION\n"
_LasStrt = " STRT.M %8.3f :START DEPTH\n"
_LasStop = " STOP.M %8.3f :STOP DEPTH\n"
_LasStep = " STEP.M %8.3f :STEP\n"
_LasNull = " NULL. %9.3f :NULL VALUE\n"
_LasRkb = " RKB.M %8.3f :KB or GL\n"
_LasXcoord = " XWELL.M %8.3f :Well head X coordinate\n"
_LasYcoord = " YWELL.M %8.3f :Well head Y coordinate\n"
_LasOilComp = " COMP. %-43.43s:OIL COMPANY\n"
_LasWell = " WELL. %-43.43s:WELL\n"
_LasField = " FLD . %-43.43s:FIELD\n"
_LasLoc = " LOC . %-43.43s:LOCATION\n"
_LasCountry = " CTRY. %-43.43s:COUNTRY\n"
_LasServiceComp = " SRVC. %-43.43s:SERVICE COMPANY\n"
_LasDate = " DATE. %-43.43s:DATE\n"
_LasAPI = " API . %-43.43s:API NUMBER\n"
_LasUwi = " UWI . %-43.43s:UNIVERSAL WELL INDEX\n"
_LasCurvSec = "~Curve Information Section\n"
_LasCurvFormat = "#MNEM.UNIT :DESCRIPTION\n"
_LasCurvDept = " DEPT.M :\n"
_LasCurvLine = " %s.%s :\n"
_LasCurvLine2 = " %s :\n"
_LasDataSec = "~ASCII Log Data\n"
_LasDataLine = ""
//secName: 0 - empty, 1 - Version, 2 - Well info, 3 - Curve info, 4 - dAta
lasSecIgnore = 0
lasSecVertion = 1
lasSecWellInfo = 2
lasSecCurInfo = 3
lasSecData = 4
)
// Las - class to store las file
// input code page autodetect
// at read file always code page converted to UTF
// at save file code page converted to specifyed in Las.toCodePage
//TODO add pointer to cfg
//TODO warnings - need method to flush slice on file, and clear
//TODO expPoints надо превратить в метод
//TODO имена скважин с пробелами читаются неверно
type Las struct {
FileName string //file name from load
File *os.File //the file from which we are reading
Reader io.Reader //reader created from File, provides decode from codepage to UTF-8
scanner *bufio.Scanner //scanner
Ver float64 //version 1.0, 1.2 or 2.0
Wrap string //YES || NO
Strt float64 //start depth
Stop float64 //stop depth
Step float64 //depth step
Null float64 //value interpreted as empty
Well string //well name
Rkb float64 //altitude KB
Logs map[string]LasCurve //store all logs
LogDic *map[string]string //external dictionary of standart log name - mnemonics
VocDic *map[string]string //external vocabulary dictionary of log mnemonic
Warnings TLasWarnings //slice of warnings occure on read or write
expPoints int //expected count (.)
nPoints int //actually count (.)
iCodepage cpd.IDCodePage //codepage input file. autodetect
oCodepage cpd.IDCodePage //codepage to save file, default xlib.CpWindows1251. to special value, specify at make: NewLas(cp...)
iDuplicate int //индекс повторящейся мнемоники, увеличивается на 1 при нахождении дубля, начально 0
currentLine int //index of current line in readed file
maxWarningCount int //default maximum warning count
stdNull float64 //default null value
CodePage string //TODO to delete //пока не читается
}
//GetStepFromData - return step from data section
//read 2 line from section ~A and determine step
//close file
//return o.Null if error occure
//TODO просто сделать функцией
func (o *Las) GetStepFromData(fileName string) float64 {
iFile, err := os.Open(fileName)
if err != nil {
return o.Null
}
defer iFile.Close()
_, iScanner, err := xlib.SeekFileStop(fileName, "~A")
if (err != nil) || (iScanner == nil) {
return o.Null
}
s := ""
j := 0
dept1 := 0.0
dept2 := 0.0
for i := 0; iScanner.Scan(); i++ {
s = strings.TrimSpace(iScanner.Text())
if (len(s) == 0) || (s[0] == '#') {
continue
}
k := strings.IndexRune(s, ' ')
if k < 0 { //data line must have minimum 2 column separated ' ' space
return o.Null
}
dept1, err = strconv.ParseFloat(s[:k], 64)
if err != nil {
return o.Null
}
j++
if j == 2 {
return math.Round((dept1-dept2)*10) / 10
}
dept2 = dept1
}
//если мы попали сюда, то всё грусно, в файле после ~A не нашлось двух строчек с данными... или пустые строчки или комменты
return o.Null
}
//SetNull - change parameter NULL in WELL INFO section and in all logs
func (o *Las) SetNull(aNull float64) error {
for _, l := range o.Logs { //loop by logs
for i := range l.log { //loop by dept step
if l.log[i] == o.Null {
l.log[i] = aNull
}
}
}
o.Null = aNull
return nil
}
/*
//вызывать после Scanner.Text()
func (o *Las) convertStrFromIn(s string) string {
switch o.iCodepage {
case cpd.CP866:
s, _, _ = transform.String(charmap.CodePage866.NewDecoder(), s)
case cpd.CP1251:
s, _, _ = transform.String(charmap.Windows1251.NewDecoder(), s)
}
return s
}*/
//TODO replace to function xStrUtil.ConvertStrCodePage
func (o *Las) convertStrToOut(s string) string {
switch o.oCodepage {
case cpd.CP866:
s, _, _ = transform.String(charmap.CodePage866.NewEncoder(), s)
case cpd.CP1251:
s, _, _ = transform.String(charmap.Windows1251.NewEncoder(), s)
}
return s
}
//logByIndex - return log from map by Index
func (o *Las) logByIndex(i int) (*LasCurve, error) {
for _, v := range o.Logs {
if v.Index == i {
return &v, nil
}
}
return nil, fmt.Errorf("log with index: %v not present", i)
}
//NewLas - make new object Las class
//autodetect code page at load file
//code page to save by default is xlib.CpWindows1251
func NewLas(outputCP ...cpd.IDCodePage) *Las {
las := new(Las)
las.Ver = 2.0
las.Wrap = "NO"
las.Logs = make(map[string]LasCurve)
las.maxWarningCount = 20 //TODO read from Cfg
las.stdNull = -999.25 //TODO read from Cfg
if len(outputCP) > 0 {
las.oCodepage = outputCP[0]
} else {
las.oCodepage = cpd.CP1251
}
//mnemonic dictionary
las.LogDic = nil
//external log dictionary
las.VocDic = nil
//счётчик повторяющихся мнемоник, увеличивается каждый раз на 1, используется при переименовании мнемоники
las.iDuplicate = 0
return las
}
//analize first char after ~
//~V - section vertion
//~W - well info section
//~C - curve info section
//~A - data section
func (o *Las) selectSection(r rune) int {
switch r {
case 86: //V
return lasSecVertion //version section
case 118: //v
return lasSecVertion //version section
case 87: //W
return lasSecWellInfo //well info section
case 119: //w
return lasSecWellInfo //well info section
case 67: //C
return lasSecCurInfo //curve section
case 99: //c
return lasSecCurInfo //curve section
case 65: //A
return lasSecData //data section
case 97: //a
return lasSecData //data section
default:
return lasSecIgnore
}
}
//make test of loaded well info section
//return error <> nil in one case, if getStepFromData return error
func (o *Las) testWellInfo() error {
if o.Step == 0.0 {
o.Step = o.GetStepFromData(o.FileName) // return o.Null if cannot calculate step from data
if o.Step == o.Null {
return errors.New("invalid STEP parameter, equal 0. and invalid step in data")
}
o.addWarning(TWarning{directOnRead, lasSecWellInfo, -1, fmt.Sprintf("invalid STEP parameter, equal 0. replace to %4.3f", o.Step)})
}
if o.Null == 0.0 {
o.Null = o.stdNull
o.addWarning(TWarning{directOnRead, lasSecWellInfo, -1, fmt.Sprintf("invalid NULL parameter, equal 0. replace to %4.3f", o.Null)})
}
if math.Abs(o.Stop-o.Strt) < 0.1 {
o.addWarning(TWarning{directOnRead, lasSecWellInfo, -1, fmt.Sprintf("invalid STRT: %4.3f or STOP: %4.3f, will be replace to actually", o.Strt, o.Stop)})
}
return nil
}
// IsWraped - return true if WRAP == YES
func (o *Las) IsWraped() bool {
return (strings.Index(strings.ToUpper(o.Wrap), "Y") >= 0)
}
// SaveWarning - save to file all warning
func (o *Las) SaveWarning(fileName string) error {
if o.Warnings.Count() == 0 {
return nil
}
oFile, err := os.Create(fileName)
if err != nil {
return err
}
o.SaveWarningToFile(oFile)
oFile.Close()
return nil
}
// SaveWarningToWriter - store all warning to writer, return count lines writed to
func (o *Las) SaveWarningToWriter(writer *bufio.Writer) int {
n := o.Warnings.Count()
if n == 0 {
return 0
}
for _, w := range o.Warnings {
writer.WriteString(w.String())
writer.WriteString("\n")
}
return n
}
// SaveWarningToFile - store all warning to file, file not close. return count warning writed
func (o *Las) SaveWarningToFile(oFile *os.File) int {
if oFile == nil {
return 0
}
if o.Warnings.Count() == 0 {
return 0
}
oFile.WriteString("**file: " + o.FileName + "**\n")
n := o.Warnings.SaveWarningToFile(oFile)
oFile.WriteString("\n")
return n
}
func (o *Las) addWarning(w TWarning) {
if o.Warnings.Count() < o.maxWarningCount {
o.Warnings = append(o.Warnings, w)
if o.Warnings.Count() == o.maxWarningCount {
o.Warnings = append(o.Warnings, TWarning{0, 0, 0, "*maximum count* of warning reached, change parameter 'maxWarningCount' in 'glas.ini'"})
}
}
}
// GetMnemonic - return Mnemonic from dictionary by Log Name, if Mnemonic not found return empty string ""
func (o *Las) GetMnemonic(logName string) string {
if (o.LogDic == nil) || (o.VocDic == nil) {
return "-"
}
_, ok := (*o.LogDic)[logName]
if ok { //GOOD - название каротажа равно мнемонике
return logName
}
v, ok := (*o.VocDic)[logName]
if ok { //POOR - название загружаемого каротажа найдено в словаре подстановок, мнемоника найдена
return v
}
return ""
}
// Open - load las file
func (o *Las) Open(fileName string) (int, error) {
//TODO при создании объекта las есть возможность указать кодировку записи, нужна возможность указать явно кодировку чтения
var err error
o.File, err = os.Open(fileName)
if err != nil {
return 0, err
}
defer o.File.Close()
o.FileName = fileName
//store Reader, this reader decode to UTF-8
o.Reader, err = cpd.NewReader(o.File)
if err != nil {
return 0, err
}
o.scanner = bufio.NewScanner(o.Reader)
/*o.iCodepage, err = cpd.FileCodepageDetect(fileName)*/
//load header from stored Reader
o.currentLine = 0
err = o.LoadHeader()
if err != nil {
return 0, err
}
if o.IsWraped() {
o.addWarning(TWarning{directOnRead, lasSecData, -1, "WRAP = YES, file ignored"})
return 0, nil
}
if len(o.Logs) <= 0 {
o.addWarning(TWarning{directOnRead, lasSecData, -1, "section ~Curve not exist, file ignored"})
return 0, nil
}
return o.ReadDataSec(fileName)
}
//LoadHeader - read las file and load all section before dAta ~A
/* secName: 0 - empty, 1 - Version, 2 - Well info, 3 - Curve info, 4 - A data
1. читаем строку
2. если коммент или пустая в игнор
3. если начало секции, определяем какой
4. если началась секция данных заканчиваем
5. читаем одну строку (это один параметер из известной нам секции) */
func (o *Las) LoadHeader() error {
s := ""
var err error
secNum := 0
for i := 0; o.scanner.Scan(); i++ {
s = strings.TrimSpace(o.scanner.Text())
o.currentLine++
if isIgnoredLine(s) {
continue
}
if s[0] == '~' { //start new section
secNum = o.selectSection(rune(s[1]))
if secNum == lasSecCurInfo { //enter to Curve section.
//проверка корректности данных секции WELL INFO перез загрузкой кривых и данных
//TODO проверку нужно перенести в функцию Open() здесь вообще не место
err = o.testWellInfo() //STEP != 0, NULL != 0, STRT & STOP
if err != nil {
return err // двойная ошибка, плох параметр STEP и не удалось вычислить STEP по данным, с данными проблема...
}
}
if secNum == lasSecData {
break // dAta section read after //exit from for
}
} else {
err = o.ReadParameter(s, secNum) //if not comment, not empty and not new section => parameter, read it
if err != nil {
o.addWarning(TWarning{directOnRead, secNum, -1, fmt.Sprintf("while process parameter: '%s' occure error: %v", s, err)})
}
}
}
return nil
}
//ReadParameter - read one parameter
func (o *Las) ReadParameter(s string, secNum int) error {
switch secNum {
case lasSecVertion:
return o.readVersionParam(s)
case lasSecWellInfo:
return o.ReadWellParam(s)
case lasSecCurInfo:
return o.readCurveParam(s)
}
return nil
}
func (o *Las) readVersionParam(s string) error {
var err error
p := NewLasParamFromString(s)
switch p.Name {
case "VERS":
o.Ver, err = strconv.ParseFloat(p.Val, 64)
case "WRAP":
o.Wrap = p.Val
}
return err
}
//ReadWellParam - read parameter from WELL section
func (o *Las) ReadWellParam(s string) error {
var err error
p := NewLasParamFromString(s)
switch p.Name {
case "STRT":
o.Strt, err = strconv.ParseFloat(p.Val, 64)
case "STOP":
o.Stop, err = strconv.ParseFloat(p.Val, 64)
case "STEP":
o.Step, err = strconv.ParseFloat(p.Val, 64)
case "NULL":
o.Null, err = strconv.ParseFloat(p.Val, 64)
case "WELL":
if o.Ver < 2.0 {
o.Well = p.Desc
} else {
o.Well = p.Val
}
}
if err != nil {
o.addWarning(TWarning{directOnRead, lasSecWellInfo, -1, fmt.Sprintf("detected param: %v, unit:%v, value: %v\n", p.Name, p.Unit, p.Val)})
}
return err
}
//ChangeDuplicateLogName - return non duplicated name of log
//if input name unique, return input name
//if input name not unique, return input name + index duplicate
//index duplicate - Las field, increase
func (o *Las) ChangeDuplicateLogName(name string) string {
s := ""
if _, ok := o.Logs[name]; ok {
o.iDuplicate++
s = fmt.Sprintf("%v", o.iDuplicate)
name += s
}
return name
}
//Разбор одной строки с мнемоникой каротажа
//Разбираем в переменную l а потом сохраняем в map
//Каждый каротаж характеризуется тремя именами
//IName - имя каротажа в исходном файле, может повторятся
//Name - ключ в map хранилище, повторятся не может. если в исходном есть повторение, то Name строится добавлением к IName индекса
//Mnemonic - мнемоника, берётся из словаря. если в словаре не найдено, то оставляем iName
func (o *Las) readCurveParam(s string) error {
l := NewLasCurveFromString(s)
l.Init(len(o.Logs), o.GetMnemonic(l.Name), o.ChangeDuplicateLogName(l.Name), o.GetExpectedPointsCount())
o.Logs[l.Name] = l //добавление в карту кривой каротажа с колонкой глубин
return nil
}
//GetExpectedPointsCount - оценка количества точек по параметрам STEP, STRT, STOP
func (o *Las) GetExpectedPointsCount() int {
var m int
if math.Abs(o.Stop) > math.Abs(o.Strt) {
m = int((o.Stop-o.Strt)/o.Step) + 2
} else {
m = int((o.Strt-o.Stop)/o.Step) + 2
}
if m < 0 {
m = -m
}
return m
}
//expandDept - if actually data points exceeds
func (o *Las) expandDept(d *LasCurve) {
//actual number of points more then expected
o.addWarning(TWarning{directOnRead, lasSecData, o.currentLine, "actual number of data lines more than expected, check: STRT, STOP, STEP"})
o.addWarning(TWarning{directOnRead, lasSecData, o.currentLine, "expand number of points"})
//ожидаем удвоения данных
o.expPoints *= 2
//need expand all logs
//fmt.Printf("old dept len: %d, cap: %d\n", len(d.dept), cap(d.dept))
newDept := make([]float64, o.expPoints, o.expPoints)
copy(newDept, d.dept)
d.dept = newDept
newLog := make([]float64, o.expPoints, o.expPoints)
copy(newLog, d.dept)
d.log = newLog
o.Logs[d.Name] = *d
//fmt.Printf("new dept len: %d, cap: %d\n", len(d.dept), cap(d.dept))
//loop over other logs
n := len(o.Logs)
var l *LasCurve
for j := 1; j < n; j++ {
l, _ = o.logByIndex(j)
newDept := make([]float64, o.expPoints, o.expPoints)
copy(newDept, l.dept)
l.dept = newDept
newLog := make([]float64, o.expPoints, o.expPoints)
copy(newLog, l.log)
l.log = newLog
o.Logs[l.Name] = *l
}
}
// ReadDataSec - read section of data
// TODO file open and not close
func (o *Las) ReadDataSec(fileName string) (int, error) {
var (
v float64
err error
d *LasCurve
l *LasCurve
dept float64
i int
)
/*
//обнаруживаем начало секции данных, позиционируемся на строку перед данными
pos, iScanner, err := xlib.SeekFileStop(fileName, "~A")
//now current position in file at line "~A..."
o.currentLine = pos
switch pos {
case 0:
return 0, err
case -1:
return 0, fmt.Errorf("<ReadDataSec> data section '~A' not found")
}
*/
//iScanner := o.scanner
//исходя из параметров STRT, STOP и STEP определяем ожидаемое количество строк данных
o.expPoints = o.GetExpectedPointsCount()
//o.currentLine++
n := len(o.Logs) //количество каротажей, столько колонок данных ожидаем
d, _ = o.logByIndex(0) //dept log
s := ""
for i = 0; o.scanner.Scan(); i++ {
o.currentLine++
if i == o.expPoints {
o.expandDept(d)
}
s = strings.TrimSpace(o.scanner.Text())
if isIgnoredLine(s) {
i--
continue
}
//first column is DEPT
k := strings.IndexRune(s, ' ')
if k < 0 { //line must have n+1 column and n separated spaces block (+1 becouse first column DEPT)
o.addWarning(TWarning{directOnRead, lasSecData, o.currentLine, fmt.Sprintf("line: %d is empty, ignore", o.currentLine)})
i--
continue
}
dept, err = strconv.ParseFloat(s[:k], 64)
if err != nil {
o.addWarning(TWarning{directOnRead, lasSecData, o.currentLine, fmt.Sprintf("first column '%s' not numeric, ignore", s[:k])})
i--
continue
}
d.dept[i] = dept
if i > 1 {
if math.Pow(((dept-d.dept[i-1])-o.Step), 2) > 0.1 {
o.addWarning(TWarning{directOnRead, lasSecData, o.currentLine, fmt.Sprintf("actual step %5.2f ≠ global STEP %5.2f", (dept - d.dept[i-1]), o.Step)})
}
}
if i > 2 {
if math.Pow(((dept-d.dept[i-1])-(d.dept[i-1]-d.dept[i-2])), 2) > 0.1 {
o.addWarning(TWarning{directOnRead, lasSecData, o.currentLine, fmt.Sprintf("step %5.2f ≠ previously step %5.2f", (dept - d.dept[i-1]), (d.dept[i-1] - d.dept[i-2]))})
dept = d.dept[i-1] + o.Step
}
}
s = strings.TrimSpace(s[k+1:]) //cut first column
//цикл по каротажам
for j := 1; j < (n - 1); j++ {
iSpace := strings.IndexRune(s, ' ')
switch iSpace {
case -1: //не все колонки прочитаны, а пробелов уже нет... пробуем игнорировать сроку заполняя оставшиеся каротажи NULLами
o.addWarning(TWarning{directOnRead, lasSecData, o.currentLine, "not all column readed, set log value to NULL"})
case 0:
v = o.Null
case 1:
v, err = strconv.ParseFloat(s[:1], 64)
default:
v, err = strconv.ParseFloat(s[:iSpace], 64) //strconv.ParseFloat(s[:iSpace-1], 64)
}
if err != nil {
o.addWarning(TWarning{directOnRead, lasSecData, o.currentLine, fmt.Sprintf("can't convert string: '%s' to number, set to NULL", s[:iSpace-1])})
v = o.Null
}
l, err = o.logByIndex(j)
if err != nil {
o.nPoints = i
return i, errors.New("internal ERROR, func (o *Las) readDataSec()::o.logByIndex(j) return error")
}
l.dept[i] = dept
l.log[i] = v
s = strings.TrimSpace(s[iSpace+1:])
}
//остаток - последняя колонка
v, err = strconv.ParseFloat(s, 64)
if err != nil {
o.addWarning(TWarning{directOnRead, lasSecData, o.currentLine, "not all column readed, set log value to NULL"})
v = o.Null
}
l, err = o.logByIndex(n - 1)
if err != nil {
o.nPoints = i
return i, errors.New("internal ERROR, func (o *Las) readDataSec()::o.logByIndex(j) return error on last column")
}
l.dept[i] = dept
l.log[i] = v
}
//i - actually readed lines and add (.) to data array
//crop logs to actually len
o.setActuallyNumberPoints(i)
return i, nil
}
// NumPoints - return actually number of points in data
func (o *Las) NumPoints() int {
return o.nPoints
}
//Dept - return slice of DEPT curve (first column)
func (o *Las) Dept() []float64 {
d, err := o.logByIndex(0)
if err != nil {
return nil
}
return d.dept
}
func (o *Las) setActuallyNumberPoints(numPoints int) error {
if numPoints <= 0 {
o.nPoints = 0
return errors.New("internal ERROR, func (o *Las) setActuallyNumberPoints(), actually number of points <= 0")
}
if numPoints > len(o.Dept()) {
o.nPoints = 0
return errors.New("internal ERROR, func (o *Las) setActuallyNumberPoints(), actually number of points > then exist data")
}
for _, l := range o.Logs {
l.SetLen(numPoints)
}
o.nPoints = numPoints
return nil
}
//Save - save to file
//rewrite if file exist
//if useMnemonic == true then on save using std mnemonic on ~Curve section
//TODO las have field filename of readed las file, after save filename must update or not? warning occure on write for what file?
func (o *Las) Save(fileName string, useMnemonic ...bool) error {
n := len(o.Logs) //log count
if n <= 0 {
return errors.New("logs not exist")
}
var f *os.File
var err error
if !xlib.FileExists(fileName) {
err = os.MkdirAll(filepath.Dir(fileName), os.ModePerm)
if err != nil {
return errors.New("path: '" + filepath.Dir(fileName) + "' can't create >>" + err.Error())
}
}
f, err = os.Create(fileName) //Open file to WRITE
if err != nil {
return errors.New("file: '" + fileName + "' can't open to write >>" + err.Error())
}
defer f.Close()
fmt.Fprint(f, _LasFirstLine)
fmt.Fprintf(f, _LasVersion, o.Ver)
fmt.Fprint(f, _LasWrap)
fmt.Fprint(f, _LasCodePage)
fmt.Fprint(f, _LasWellInfoSec)
fmt.Fprintf(f, _LasStrt, o.Strt)
fmt.Fprintf(f, _LasStop, o.Stop)
fmt.Fprintf(f, _LasStep, o.Step)
fmt.Fprintf(f, _LasNull, o.Null)
fmt.Fprintf(f, _LasWell, o.convertStrToOut(o.Well))
fmt.Fprint(f, _LasCurvSec)
fmt.Fprint(f, _LasCurvDept)
s := "# DEPT |" //готовим строчку с названиями каротажей глубина всегда присутствует
var l *LasCurve
for i := 1; i < n; i++ { //Пишем названия каротажей
l, _ := o.logByIndex(i)
if len(useMnemonic) > 0 {
if len(l.Mnemonic) > 0 {
l.Name = l.Mnemonic
}
}
fmt.Fprintf(f, _LasCurvLine, o.convertStrToOut(l.Name), o.convertStrToOut(l.Unit)) //запись мнемоник в секции ~Curve
s += " " + fmt.Sprintf("%-8s|", l.Name) //Собираем строчку с названиями каротажей
}
fmt.Fprintf(f, _LasDataSec)
//write data
s += "\n"
fmt.Fprintf(f, o.convertStrToOut(s))
dept, _ := o.logByIndex(0)
for i := 0; i < o.nPoints; i++ { //loop by dept (.)
fmt.Fprintf(f, "%-9.3f ", dept.dept[i])
for j := 1; j < n; j++ { //loop by logs
l, err = o.logByIndex(j)
if err != nil {
o.addWarning(TWarning{directOnWrite, lasSecData, i, "logByIndex() return error, log not found, panic"})
return errors.New("logByIndex() return error, log not found, panic")
}
fmt.Fprintf(f, "%-9.3f ", l.log[i])
}
fmt.Fprintln(f)
}
return nil
}

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

@ -0,0 +1,71 @@
package glasio
import (
"fmt"
"gopkg.in/ini.v1"
)
const lasStdMnemonicIniFileName = "mnemonic.ini"
const lasStdMnemonicIniSection = "mnemonic"
// TMnemonic - dictionary of std log name == mnemonics
type TMnemonic = map[string]string
//LoadStdMnemonicDic - return std mnemonic map
//read ini file, fill dictionary
//return empty map if occure error on reading ini file with dictionary, may be add after
func LoadStdMnemonicDic(fileName ...string) (TMnemonic, error) {
if len(fileName) == 0 {
fileName = make([]string, 1)
fileName[0] = lasStdMnemonicIniFileName
}
mnemonic := make(TMnemonic)
iniMnemonic, err := ini.Load(fileName[0])
if err != nil {
return mnemonic, fmt.Errorf("<GetStdMnemonic> can't read ini file '%s'. error: %v", fileName[0], err)
}
sec, err := iniMnemonic.GetSection(lasStdMnemonicIniSection)
if err != nil {
return mnemonic, fmt.Errorf("<GetStdMnemonic> can't read section 'mnemonic' from ini file '%s'. error: %v", fileName[0], err)
}
for _, s := range sec.KeyStrings() {
mnemonic[s] = sec.Key(s).Value() //добавление в словарь значения 'sec.Key(s).Value()' с ключём 's'
}
return mnemonic, nil
}
//TVocDic - dictionary of std log name == mnemonics
type TVocDic = map[string]string
const lasStdVocDicFileName = "dic.ini"
const lasStdVocDicSection = "LOG"
//LoadStdVocabularyDictionary - return lookup map
//read ini file, fill dictionary
//return empty map if occure error on reading ini file with dictionary, may be add after
func LoadStdVocabularyDictionary(fileName ...string) (TVocDic, error) {
if len(fileName) == 0 {
fileName = make([]string, 1)
fileName[0] = lasStdVocDicFileName
}
//create empty map
vocDic := make(TVocDic)
iniVocDic, err := ini.Load(fileName[0])
if err != nil {
return vocDic, fmt.Errorf("<GetStdVocabularyDictionary> can't read ini file '%s'. error: %v", fileName[0], err)
}
sec, err := iniVocDic.GetSection(lasStdVocDicSection)
if err != nil {
return vocDic, fmt.Errorf("<GetStdVocabularyDictionary> can't read section 'LOG' from ini file '%s'. error: %v", fileName[0], err)
}
//fill dictionary
for _, s := range sec.KeyStrings() {
vocDic[s] = sec.Key(s).Value()
}
return vocDic, nil
}

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

@ -0,0 +1,54 @@
//(c) softland 2019
//softlandia@gmail.com
package glasio
import (
"testing"
)
func TestLoadStdMnemonicDic(t *testing.T) {
_, err := LoadStdMnemonicDic() //file ini not exist, return error != nil
if err == nil {
t.Errorf("<LoadStdMnemonicDic> on test 1 return error == nil\n")
}
_, err = LoadStdMnemonicDic("data\\mnemonic.ini") //file ini exist, return error == nil
if err != nil {
t.Errorf("<LoadStdMnemonicDic> on test 2 expect error = nil, return error: %s\n", err)
}
_, err = LoadStdMnemonicDic("data\\mn.ini") //file ini not exist, return error
if err == nil {
t.Errorf("<LoadStdMnemonicDic> on test 3 expect error != nil, return nil\n")
}
_, err = LoadStdMnemonicDic("data\\dic.ini") //file ini exist, section not exist, return error != nil
if err == nil {
t.Errorf("<LoadStdMnemonicDic> on test 4 expect error = nil, return error: %s\n", err)
}
_, err = LoadStdMnemonicDic("data\\dic0.ini") //file ini exist, file empty, return error != nil
if err == nil {
t.Errorf("<LoadStdMnemonicDic> on test 5 expect error = nil, return error: %s\n", err)
}
}
func TestLoadStdVocabularyDictionary(t *testing.T) {
_, err := LoadStdVocabularyDictionary() //file ini not exist, return error != nil
if err == nil {
t.Errorf("<LoadStdVocabularyDictionary> on test 1 return error == nil\n")
}
_, err = LoadStdVocabularyDictionary("data\\dic.ini") //file ini exist, return error == nil
if err != nil {
t.Errorf("<LoadStdVocabularyDictionary> on test 2 expect error = nil, return error: %s\n", err)
}
_, err = LoadStdVocabularyDictionary("data\\mn.ini") //file ini not exist, return error
if err == nil {
t.Errorf("<LoadStdVocabularyDictionary> on test 3 expect error != nil, return nil\n")
}
_, err = LoadStdVocabularyDictionary("data\\mnemonic.ini") //file ini exist, section not exist, return error != nil
if err == nil {
t.Errorf("<LoadStdVocabularyDictionary> on test 4 expect error = nil, return error: %s\n", err)
}
_, err = LoadStdVocabularyDictionary("data\\mnemonic0.ini") //file ini exist, file empty, return error != nil
if err == nil {
t.Errorf("<LoadStdVocabularyDictionary> on test 5 expect error = nil, return error: %s\n", err)
}
}

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

@ -0,0 +1,150 @@
package glasio
import (
"strings"
"github.com/softlandia/xlib"
)
//LasParam - class to store parameter from any section
type LasParam struct {
IName string
Name string
Mnemonic string
Unit string
Val string
Desc string
}
//PrepareParamStr - prepare string to parse, replace many space to one, replace tab to space, replace combination of separator to one
func PrepareParamStr(s string) string {
s = strings.ReplaceAll(s, "\t", " ")
s = xlib.ReplaceAllSpace(s)
s = xlib.ReplaceSeparators(s)
return strings.TrimSpace(s)
}
//ParseParamStr - parse string from las file
//return slice with 4 string and error if occure
//before process input string 2 or more space replace on 1 space
func ParseParamStr(s string) (f [4]string) {
f[0] = ""
f[1] = ""
f[2] = ""
f[3] = ""
s = PrepareParamStr(s)
iComma := strings.LastIndex(s, ":") //comment parse first, cut string after
commentFlag := (iComma >= 0)
if commentFlag {
f[3] = s[iComma+1:]
s = strings.TrimSpace(s[:iComma])
}
var iDot int
f[0], iDot = xlib.StrCopyStop(s, ' ', '.', ':')
f[0] = strings.TrimSpace(f[0])
if iDot >= len(s) {
return
}
s = strings.TrimSpace(s[iDot+1:])
f[1], iDot = xlib.StrCopyStop(s, ' ', ':')
f[1] = strings.TrimSpace(f[1])
if iDot >= len(s) {
return
}
s = strings.TrimSpace(s[iDot+1:])
f[2], _ = xlib.StrCopyStop(s, ':')
f[2] = strings.TrimSpace(f[2])
return
}
//ParseCurveStr - parse input string to 3 separated string
//" пс повт . мВ : 7 кр сам"
func ParseCurveStr(s string) (f [3]string) {
f[0] = ""
f[1] = ""
f[2] = ""
s = PrepareParamStr(s)
iComma := strings.LastIndex(s, ":") //comment parse first, cut string after
commentFlag := (iComma >= 0)
if commentFlag {
f[2] = s[iComma+1:]
s = strings.TrimSpace(s[:iComma])
}
//if comma not found, string not change
//now s contains only name and unit
iDot := strings.Index(s, ".")
//TODO если в строке нет точки, то отделить имя от единицы измерения невозможно. имя может содержать произвольные символя включая пробел
if iDot < 0 { //if dot not found, all string is Curve name
f[0] = strings.TrimSpace(s)
return
}
f[0] = strings.TrimSpace(s[:iDot])
s = strings.TrimSpace(s[iDot+1:])
f[1], _ = xlib.StrCopyStop(s, ' ', ':')
f[1] = strings.TrimSpace(f[1])
return
}
//NewLasParamFromString - create new object LasParam
//fill fields from s
func NewLasParamFromString(s string) *LasParam {
par := new(LasParam)
paramFields := ParseParamStr(s)
par.Name = paramFields[0]
par.Unit = paramFields[1]
par.Val = paramFields[2]
if (len(par.Val) == 0) && (len(par.Unit) > 0) {
par.Val = par.Unit
par.Unit = ""
}
par.Desc = paramFields[3]
return par
}
//LasCurve - class to store one log in Las
type LasCurve struct {
LasParam
Index int
dept []float64
log []float64
}
//SetLen - crop logs to actually len
//new len must be > 0 and < exist length
func (o *LasCurve) SetLen(n int) {
if (n <= 0) || n >= len(o.dept) {
return
}
t := make([]float64, n, n)
copy(t, o.dept)
o.dept = t
t = make([]float64, n, n)
copy(t, o.log)
o.log = t
}
//Init - initialize LasCurve, set index, name, mnemonic, make slice for store data
func (o *LasCurve) Init(index int, mnemonic, name string, size int) {
o.Index = index
o.Mnemonic = mnemonic
o.Name = name
o.dept = make([]float64, size)
o.log = make([]float64, size)
}
//NewLasCurveFromString - create new object LasCurve
func NewLasCurveFromString(s string) LasCurve {
lc := LasCurve{}
curveFields := ParseCurveStr(s)
lc.Name = curveFields[0]
lc.IName = curveFields[0]
lc.Unit = curveFields[1]
lc.Desc = curveFields[2]
lc.Index = 0
return lc
}

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

@ -0,0 +1,176 @@
//(c) softland 2019
//softlandia@gmail.com
package glasio
import (
"testing"
"github.com/stretchr/testify/assert"
)
type tParseParamStr struct {
s string
f0 string //str after PrepareParamStr
f1 string
f2 string
f3 string
f4 string
}
var dParseParamStr = []tParseParamStr{
{"STEP.M 10 : dept step", "STEP.M 10:dept step", "STEP", "M", "10", "dept step"}, //0 'STEP.M 10 : dept step'
{"STEP.M 10 ", "STEP.M 10", "STEP", "M", "10", ""}, //1 "STEP.M 10 "
{"STEP .M 10 : dept step", "STEP.M 10:dept step", "STEP", "M", "10", "dept step"}, //2 "STEP .M 10 : dept step"
{"STEP . M 10 : dept step", "STEP.M 10:dept step", "STEP", "M", "10", "dept step"}, //3
{"STEP M 10.0 : dept step", "STEP M 10.0:dept step", "STEP", "M", "10.0", "dept step"}, //4
{"ST/M 10 : dept step", "ST/M 10:dept step", "ST/M", "10", "", "dept step"}, //5
{"STEP 10 : dept step", "STEP 10:dept step", "STEP", "10", "", "dept step"}, //6
{" STEP . M 10.0 : dept step", "STEP.M 10.0:dept step", "STEP", "M", "10.0", "dept step"}, //7
{"\t STEP M 10 :dept step ", "STEP M 10:dept step", "STEP", "M", "10", "dept step"}, //8
{"ШАГ.M 0.0 :шаг глубины ", "ШАГ.M 0.0:шаг глубины", "ШАГ", "M", "0.0", "шаг глубины"}, //9
{"ШАГ. M :шаг по глубине ", "ШАГ.M:шаг по глубине", "ШАГ", "M", "", "шаг по глубине"}, //10
{"ШАГ M ", "ШАГ M", "ШАГ", "M", "", ""}, //11
{"ШАГ M 11 ", "ШАГ M 11", "ШАГ", "M", "11", ""}, //12
{"ШАГ :шаг по глубине ", "ШАГ:шаг по глубине", "ШАГ", "", "", "шаг по глубине"}, //13
{"ШАГ :m 0.2 :шаг по глубине ", "ШАГ:m 0.2:шаг по глубине", "ШАГ", "m", "0.2", "шаг по глубине"}, //14
{"шаг. : 2 сам ", "шаг.:2 сам", "шаг", "", "", "2 сам"}, //15
{"шаг.m\t10.0 : 2 сам ", "шаг.m 10.0:2 сам", "шаг", "m", "10.0", "2 сам"}, //16
{"STEP .m\t\t 10.0 \t: 2 сам ", "STEP.m 10.0:2 сам", "STEP", "m", "10.0", "2 сам"}, //17
{"VERS. 1.20: cp_866 ", "VERS.1.20:cp_866", "VERS", "1.20", "", "cp_866"}, //18
{"NULL. -999.250 :NULL VALUE", "NULL.-999.250:NULL VALUE", "NULL", "-999.250", "", "NULL VALUE"}, //19
{"VERS. 2.0 :[Softland]", "VERS.2.0:[Softland]", "VERS", "2.0", "", "[Softland]"}, //20
}
func TestPrepareParamStr(t *testing.T) {
for _, tmp := range dParseParamStr {
s := PrepareParamStr(tmp.s)
assert.Equal(t, tmp.f0, s)
}
}
func TestParseParamStr(t *testing.T) {
for _, tmp := range dParseParamStr {
f := ParseParamStr(tmp.s)
assert.Equal(t, tmp.f1, f[0])
assert.Equal(t, tmp.f2, f[1])
assert.Equal(t, tmp.f3, f[2])
assert.Equal(t, tmp.f4, f[3])
}
}
type tWellInfoStr struct {
s string
f1 string
f2 string
f3 string
f4 string
}
var dWellInfoStr = []tWellInfoStr{
{"STEP.M 10 : dept step", "STEP", "M", "10", "dept step"}, //0
{"STEP.M 10 ", "STEP", "M", "10", ""}, //1
{"STEP .M 10 : dept step", "STEP", "M", "10", "dept step"}, //2
{"STEP . M 10 : dept step", "STEP", "M", "10", "dept step"}, //3
{"STEP M 10.0 : dept step", "STEP", "M", "10.0", "dept step"}, //4
{"ST/M 10 : dept step", "ST/M", "", "10", "dept step"}, //5
{"STEP 10 : dept step", "STEP", "", "10", "dept step"}, //6
{" STEP . M 10.0 : dept step", "STEP", "M", "10.0", "dept step"}, //7
{"\t STEP M 10 :dept step ", "STEP", "M", "10", "dept step"}, //8
{"ШАГ.M 0.0 :шаг глубины ", "ШАГ", "M", "0.0", "шаг глубины"}, //9
{"ШАГ. M :шаг по глубине ", "ШАГ", "", "M", "шаг по глубине"}, //10
{"ШАГ M ", "ШАГ", "", "M", ""}, //11
{"ШАГ M 11 ", "ШАГ", "M", "11", ""}, //12
{"ШАГ :шаг по глубине ", "ШАГ", "", "", "шаг по глубине"}, //13
{"ШАГ :m 0.2 :шаг по глубине ", "ШАГ", "m", "0.2", "шаг по глубине"}, //14
{"шаг. : 2 сам ", "шаг", "", "", "2 сам"}, //15
{"шаг.m\t10.0 : 2 сам ", "шаг", "m", "10.0", "2 сам"}, //16
{"STEP .m\t\t 10.0 \t: 2 сам ", "STEP", "m", "10.0", "2 сам"}, //17
{"VERS. 1.20: cp_866 ", "VERS", "", "1.20", "cp_866"}, //18
{"NULL. -999.250 :NULL VALUE", "NULL", "", "-999.250", "NULL VALUE"}, //19
{"VERS. 2.0 :[Softland] ", "VERS", "", "2.0", "[Softland]"}, //20
}
func TestNewLasParamFromString(t *testing.T) {
var lp *LasParam
for _, tmp := range dWellInfoStr {
lp = NewLasParamFromString(tmp.s)
assert.Equal(t, tmp.f1, lp.Name)
assert.Equal(t, tmp.f2, lp.Unit)
assert.Equal(t, tmp.f3, lp.Val)
assert.Equal(t, tmp.f4, lp.Desc)
lp = nil
}
}
type tParseCurveStr struct {
s string
f0 string
f1 string
f2 string
}
var dParseCurveStr = []tParseCurveStr{
{" ПС мВ.", "ПС мВ", "", ""}, //12
{"ПС.мВ : 1 кр сам", "ПС", "мВ", "1 кр сам"}, //1
{"ПС. : 2 кр сам ", "ПС", "", "2 кр сам"}, //2
{"ПС повторная :3 кр сам", "ПС повторная", "", "3 кр сам"}, //3
{" ПС \t \t : 4 кр сам", "ПС", "", "4 кр сам"}, //4
{" ПС : ", "ПС", "", ""}, //5
{" ПС . мВ : 6 кр сам", "ПС", "мВ", "6 кр сам"}, //6
{" пс повт . мВ : 7 кр сам", "пс повт", "мВ", "7 кр сам"}, //7
{" ПС \t мВ : 8 кр сам", "ПС мВ", "", "8 кр сам"}, //8
{" ПС . мВ ", "ПС", "мВ", ""}, //9
{" ПС повт ", "ПС повт", "", ""}, //10
{" ПС мВ : 11 кр сам", "ПС мВ", "", "11 кр сам"}, //11
}
func TestParseCurveStr(t *testing.T) {
for _, tmp := range dParseCurveStr {
f := ParseCurveStr(tmp.s)
assert.Equal(t, tmp.f0, f[0])
assert.Equal(t, tmp.f1, f[1])
assert.Equal(t, tmp.f2, f[2])
}
}
func TestNewLasCurveFromString(t *testing.T) {
var lc LasCurve
for _, tmp := range dParseCurveStr {
lc = NewLasCurveFromString(tmp.s)
assert.Equal(t, tmp.f0, lc.Name)
assert.Equal(t, tmp.f1, lc.Unit)
assert.Equal(t, tmp.f2, lc.Desc)
}
}
func TestLasCurveSetLen(t *testing.T) {
curve := NewLasCurveFromString("SP.mV :self")
curve.Init(0, "SP", "SP", 5)
curve.dept[0] = 0.1
curve.dept[1] = 0.2
curve.dept[2] = 0.3
curve.dept[3] = 0.4
curve.dept[4] = 0.5
curve.SetLen(3)
assert.Equal(t, 3, len(curve.dept))
assert.Equal(t, 3, len(curve.log))
assert.Equal(t, 0.3, curve.dept[2])
curve.SetLen(4) //nothing to do, size of data slice not change
assert.Equal(t, 3, len(curve.dept))
assert.Equal(t, 3, len(curve.log))
curve.SetLen(0) //nothing to do, size of data slice not change
assert.Equal(t, 3, len(curve.dept))
assert.Equal(t, 3, len(curve.log))
curve.SetLen(-5) //nothing to do, size of data slice not change
assert.Equal(t, 3, len(curve.dept))
assert.Equal(t, 3, len(curve.log))
curve.SetLen(2)
assert.Equal(t, 2, len(curve.dept))
assert.Equal(t, 2, len(curve.log))
assert.Equal(t, 0.2, curve.dept[1])
}

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

@ -0,0 +1,181 @@
//(c) softland 2019
//softlandia@gmail.com
package glasio
import (
"bufio"
"fmt"
"os"
"testing"
fp "path/filepath"
"github.com/softlandia/cpd"
"github.com/stretchr/testify/assert"
)
type tReadWellParamStep struct {
s string
v float64
}
var dReadWellParamStep = []tReadWellParamStep{
{"STEP.M 0.10 : dept step", 0.1}, //0
{"STEP.M\t0.10 ", 0.1}, //1
{"STEP .M 0.10 : dept step", 0.1}, //2
{"STEP . M 0.10 : dept step", 0.1}, //3
{"STEP M \t \t 10.0 \t: dept step", 10}, //4
{"STEP 10 : dept step", 10}, //5 нет ед.изм.
{"STEP.\t10 : dept \t step", 10}, //6 нет ед.изм.
{" STEP . M 10.0 : dept step", 10}, //7
{" STEP . M \t 10.0 : dept step", 10}, //8
{"\t STEP M 10 : dept step ", 10}, //9
{"STEP \t M 10 : dept step ", 10}, //10
{"STEP \t M \t\t 10 : dept step ", 10}, //11
{"STEP.m : dept step ", 00}, //12 нет значения но есть ед.изм.
{"STEP 0.113: dept step", 0.113}, //13 нет ед.изм.
{"STEP.\t0.999 : dept \t step", 0.999}, //14 нет ед.изм.
}
func TestReadWellParam(t *testing.T) {
las := NewLas()
for i, tmp := range dReadWellParamStep {
las.ReadWellParam(tmp.s)
assert.Equal(t, las.Step, tmp.v, fmt.Sprintf("<ReadWellParam> on test %d return STEP: '%f' expect: '%f'\n", i, las.Step, tmp.v))
}
}
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"))
assert.GreaterOrEqual(t, las.Warnings.Count(), 20, fmt.Sprintf("<TestReachingMaxAmountWarnings> on read file data\\more_20_warnings.las warning count: %d\n", las.Warnings.Count()))
las = nil
las = NewLas()
las.maxWarningCount = 100
las.Open(fp.Join("data/more_20_warnings.las"))
if las.Warnings.Count() != 62 {
las.SaveWarning(fp.Join("data/more_20_warnings.wrn"))
assert.Equal(t, las.Warnings.Count(), 62, fmt.Sprintf("<TestReachingMaxAmountWarnings> on read file data\\more_20_warnings.las warning count: %d expected 62\n", las.Warnings.Count()))
}
}
/*
func TestLoadHeaderUtf(t *testing.T) {
las := NewLas()
las.iCodepage, _ = cpd.FileCodePageDetect(fp.Join("data/encodings_utf8wbom.las"))
las.LoadHeader(fp.Join("data/encodings_utf8wbom.las"))
assert.Equal(t, 1.2, las.Ver, fmt.Sprintf("<LoadHeader> file 'encodings_utf8wbom.las' readed VER: %f, expected %f", las.Ver, 1.2))
assert.Equal(t, "NO", las.Wrap, fmt.Sprintf("<LoadHeader> file 'encodings_utf8wbom.las' readed WRAP: %s, expected %s", las.Wrap, "NO"))
assert.Equal(t, 1670.0, las.Strt, fmt.Sprintf("<LoadHeader> file 'encodings_utf8wbom.las' readed STRT: %f, expected %f", las.Strt, 1670.0))
assert.Equal(t, 1660.0, las.Stop, fmt.Sprintf("<LoadHeader> file 'encodings_utf8wbom.las' readed STOP: %f, expected %f", las.Stop, 1660.0))
assert.Equal(t, -0.1250, las.Step, fmt.Sprintf("<LoadHeader> file 'encodings_utf8wbom.las' readed STEP: %f, expected %f", las.Step, -0.1250))
assert.Equal(t, -999.250, las.Null, fmt.Sprintf("<LoadHeader> file 'encodings_utf8wbom.las' readed NULL: %f, expected %f", las.Null, -999.250))
assert.Equal(t, "Скважина ºᶟᵌᴬń #12", las.Well, fmt.Sprintf("<LoadHeader> file 'encodings_utf8wbom.las' readed WELL: %s, expected %s", las.Well, "Скважина ºᶟᵌᴬń #12"))
}
func TestLoadHeaderUtf16le(t *testing.T) {
las := NewLas()
las.iCodepage, _ = cpd.FileCodePageDetect(fp.Join("data/encodings_utf16lebom.las"))
las.LoadHeader(fp.Join("data/encodings_utf16lebom.las"))
assert.Equal(t, 1.2, las.Ver, fmt.Sprintf("file 'encodings_utf16lebom.las' readed VER: %f, expected %f", las.Ver, 1.2))
assert.Equal(t, "NO", las.Wrap, fmt.Sprintf("file 'encodings_utf16lebom.las' readed WRAP: %s, expected %s", las.Wrap, "NO"))
assert.Equal(t, 1670.0, las.Strt, fmt.Sprintf("file 'encodings_utf16lebom.las' readed STRT: %f, expected %f", las.Strt, 1670.0))
assert.Equal(t, 1660.0, las.Stop, fmt.Sprintf("file 'encodings_utf16lebom.las' readed STOP: %f, expected %f", las.Stop, 1660.0))
assert.Equal(t, -0.1250, las.Step, fmt.Sprintf("file 'encodings_utf16lebom.las' readed STEP: %f, expected %f", las.Step, -0.1250))
assert.Equal(t, -999.25, las.Null, fmt.Sprintf("file 'encodings_utf16lebom.las' readed NULL: %f, expected %f", las.Null, -999.25))
assert.Equal(t, "ºᶟᵌᴬń BLOCK", las.Well, fmt.Sprintf("file 'encodings_utf16lebom.las' readed WELL: %s, expected %s", las.Well, "ºᶟᵌᴬń BLOCK"))
}*/
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_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/more_20_warnings.las"), 1.2, "NO", 0.0, 0.0, 1.0, -32768.0, "6"}, //in las file STEP=0.0 but this incorrect, LoadHeader replace STEP to actual from data
{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/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, "ANY ºᶟᵌᴬń OIL WELL #12"},
}
func TestLoadHeader(t *testing.T) {
var las *Las
for _, tmp := range dLoadHeader {
las = NewLas()
las.iCodepage, _ = cpd.FileCodepageDetect(tmp.fn)
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, las.Ver, tmp.ver, fmt.Sprintf("<LoadHeader> file '%s' readed VER: %f, expected %f", las.FileName, las.Ver, tmp.ver))
assert.Equal(t, las.Wrap, tmp.wrap, fmt.Sprintf("<LoadHeader> file '%s' readed WRAP: %s, expected %s", las.FileName, las.Wrap, tmp.wrap))
assert.Equal(t, las.Strt, tmp.strt, fmt.Sprintf("<LoadHeader> file '%s' readed STRT: %f, expected %f", las.FileName, las.Strt, tmp.strt))
assert.Equal(t, las.Stop, tmp.stop, fmt.Sprintf("<LoadHeader> file '%s' readed STOP: %f, expected %f", las.FileName, las.Stop, tmp.stop))
assert.Equal(t, las.Step, tmp.step, fmt.Sprintf("<LoadHeader> file '%s' readed STEP: %f, expected %f", las.FileName, las.Step, tmp.step))
assert.Equal(t, las.Null, tmp.null, fmt.Sprintf("<LoadHeader> file '%s' readed NULL: %f, expected %f", las.FileName, las.Null, tmp.null))
assert.Equal(t, las.Well, tmp.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 not exist
assert.NotNil(t, err)
assert.Nil(t, las)
}
func TestLoadLasHeader(t *testing.T) {
for _, tmp := range dLoadHeader {
las, err := LoadLasHeader(tmp.fn)
assert.Nil(t, err)
assert.Equal(t, las.Ver, tmp.ver, fmt.Sprintf("<LoadHeader> file '%s' readed VER: %f, expected %f", las.FileName, las.Ver, tmp.ver))
assert.Equal(t, las.Wrap, tmp.wrap, fmt.Sprintf("<LoadHeader> file '%s' readed WRAP: %s, expected %s", las.FileName, las.Wrap, tmp.wrap))
assert.Equal(t, las.Strt, tmp.strt, fmt.Sprintf("<LoadHeader> file '%s' readed STRT: %f, expected %f", las.FileName, las.Strt, tmp.strt))
assert.Equal(t, las.Stop, tmp.stop, fmt.Sprintf("<LoadHeader> file '%s' readed STOP: %f, expected %f", las.FileName, las.Stop, tmp.stop))
assert.Equal(t, las.Step, tmp.step, fmt.Sprintf("<LoadHeader> file '%s' readed STEP: %f, expected %f", las.FileName, las.Step, tmp.step))
assert.Equal(t, las.Null, tmp.null, fmt.Sprintf("<LoadHeader> file '%s' readed NULL: %f, expected %f", las.FileName, las.Null, tmp.null))
assert.Equal(t, las.Well, tmp.well, fmt.Sprintf("<LoadHeader> file '%s' readed WELL: %s, expected %s", las.FileName, las.Well, tmp.well))
}
//test error case
las, err := LoadLasHeader("--.--") //file not exist
assert.NotNil(t, err)
assert.Nil(t, las)
las, err = LoadLasHeader(fp.Join("data/utf-32be-bom.las")) //file not exist
assert.NotNil(t, err)
assert.Nil(t, las)
}

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

@ -0,0 +1,35 @@
package glasio
import (
"bufio"
"errors"
"os"
"github.com/softlandia/cpd"
)
func isIgnoredLine(s string) bool {
if (len(s) == 0) || (s[0] == '#') {
return true
}
return false
}
// LoadLasHeader - utility function, if need read only header without data
func LoadLasHeader(fileName string) (*Las, error) {
las := NewLas()
iFile, err := os.Open(fileName)
if err != nil {
return nil, errors.New("could not open file: '" + fileName + "'")
}
defer iFile.Close()
las.File = iFile
las.FileName = fileName
las.Reader, err = cpd.NewReader(las.File)
las.scanner = bufio.NewScanner(las.Reader)
if err != nil {
return nil, err
}
las.LoadHeader()
return las, nil
}

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

@ -0,0 +1,133 @@
package glasio
import (
"bufio"
"fmt"
"log"
"os"
)
const (
//defWarningCount = 10
//warningUNDEF = 0
directOnRead = 1
directOnWrite = 2
)
//TWarning - class to store warning
type TWarning struct {
direct int // 0 - undefine (warningUNDEF), 1 - on read (directOnRead), 2 - on write (directOnWrite)
section int // 0 - undefine (warningUNDEF), lasSecVertion, lasSecWellInfo, lasSecCurInfo, lasSecData
line int // number of line in source file
desc string // description of warning
}
//String - return string with warning
func (o TWarning) String() string {
return fmt.Sprintf("line: %d,\tdesc: %s", o.line, o.desc)
}
// ToCsvString - return string with warning
// field TWarning.direct do not write to string
func (o *TWarning) ToCsvString(sep ...string) string {
var fieldSep string
switch len(sep) {
case 0:
fieldSep = ";"
case 1:
fieldSep = sep[0]
}
return fmt.Sprintf("%d%s%d%s\"%s\"", o.section, fieldSep, o.line, fieldSep, o.desc)
}
//TLasWarnings - class to store and manipulate warnings
//Count() - return wrnings count
//SaveWarning(fileName string) error
//SaveWarningToWriter(writer *bufio.Writer) int
//SaveWarningToFile(oFile *os.File) int
//ToString() string
//for i, w := range obj {w.ToString()} - перебор всех варнингов
type TLasWarnings []TWarning
//Count - return number of element
func (o TLasWarnings) Count() int {
return len(o)
}
// ToString - make one string from all elements
// sep[0] - record separator разделитель записей
// 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 {
return ""
}
var (
result string
fieldSep string
recSep string
)
switch len(sep) {
case 0:
recSep = "\n"
fieldSep = ";"
case 1:
recSep = sep[0]
fieldSep = ";"
case 2:
recSep = sep[0]
fieldSep = sep[1]
default:
recSep = sep[0]
fieldSep = sep[1]
}
for _, w := range *o {
result += (w.ToCsvString(fieldSep) + recSep)
}
return result
}
//SaveWarning - save to file all warning
//file created and closed
func (o *TLasWarnings) SaveWarning(fileName string) error {
if o.Count() == 0 {
return nil
}
oFile, err := os.Create(fileName)
if err != nil {
return err
}
_ = o.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 {
return 0
}
for _, w := range *o {
_, err := writer.WriteString(w.String())
if err != nil {
log.Fatal("internal __error__ in SaveWarningToWriter")
}
}
return o.Count()
}
//SaveWarningToFile - store all warning to file, file not close. return count warning writed
func (o *TLasWarnings) SaveWarningToFile(oFile *os.File) int {
if oFile == nil {
return 0
}
if o.Count() == 0 {
return 0
}
for i, w := range *o {
fmt.Fprintf(oFile, "%d, %s\n", i, w)
}
return o.Count()
}

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

@ -0,0 +1,35 @@
package glasio
import (
"testing"
)
func TestToCsvString(t *testing.T) {
w := TWarning{1, 1, 1, "first"}
if w.ToCsvString() != "1;1;\"first\"" {
t.Errorf("<TWarning.ToString()> return not correct string: %s\n", w.ToCsvString())
}
w = TWarning{1, 1, 1, "first"}
if w.ToCsvString(",\t") != "1,\t1,\t\"first\"" {
t.Errorf("<TWarning.ToString()> return not correct string: %s\n", w.ToCsvString())
}
}
func TestLasWarningsToString(t *testing.T) {
warnings := TLasWarnings{}
if warnings.ToString("") != "" {
t.Errorf("<TLasWarnings.ToString> on empty input return not empty string\n")
}
warnings = TLasWarnings{
TWarning{1, 1, 1, "first"},
TWarning{2, 2, 2, "second"},
}
s := warnings.ToString("#")
if s != "1;1;\"first\"#2;2;\"second\"#" {
t.Errorf("<TLasWarnings.ToString> not correct return: %s\n", s)
}
s = warnings.ToString("\n")
if s != "1;1;\"first\"\n2;2;\"second\"\n" {
t.Errorf("<TLasWarnings.ToString> not correct return: %s\n", s)
}
}

129
linter.md Normal file
Просмотреть файл

@ -0,0 +1,129 @@
las.go:42:2: `_LasDate` is unused (varcheck)
_LasDate = " DATE. %-43.43s:DATE\n"
^
las.go:34:2: `_LasXcoord` is unused (varcheck)
_LasXcoord = " XWELL.M %8.3f :Well head X coordinate\n"
^
las.go:44:2: `_LasUwi` is unused (varcheck)
_LasUwi = " UWI . %-43.43s:UNIVERSAL WELL INDEX\n"
^
las.go:46:2: `_LasCurvFormat` is unused (varcheck)
_LasCurvFormat = "#MNEM.UNIT :DESCRIPTION\n"
^
las.go:39:2: `_LasLoc` is unused (varcheck)
_LasLoc = " LOC . %-43.43s:LOCATION\n"
^
las.go:43:2: `_LasAPI` is unused (varcheck)
_LasAPI = " API . %-43.43s:API NUMBER\n"
^
las.go:35:2: `_LasYcoord` is unused (varcheck)
_LasYcoord = " YWELL.M %8.3f :Well head Y coordinate\n"
^
las.go:40:2: `_LasCountry` is unused (varcheck)
_LasCountry = " CTRY. %-43.43s:COUNTRY\n"
^
las.go:41:2: `_LasServiceComp` is unused (varcheck)
_LasServiceComp = " SRVC. %-43.43s:SERVICE COMPANY\n"
^
las.go:28:2: `_LasMnemonicFormat` is unused (varcheck)
_LasMnemonicFormat = "#MNEM.UNIT DATA :DESCRIPTION\n"
^
las.go:49:2: `_LasCurvLine2` is unused (varcheck)
_LasCurvLine2 = " %s :\n"
^
las.go:51:2: `_LasDataLine` is unused (varcheck)
_LasDataLine = ""
^
las.go:38:2: `_LasField` is unused (varcheck)
_LasField = " FLD . %-43.43s:FIELD\n"
^
las.go:36:2: `_LasOilComp` is unused (varcheck)
_LasOilComp = " COMP. %-43.43s:OIL COMPANY\n"
^
las.go:33:2: `_LasRkb` is unused (varcheck)
_LasRkb = " RKB.M %8.3f :KB or GL\n"
^
example2\main.go:44:2: ineffectual assignment to `err` (ineffassign)
err = las.Save(las.FileName + "-") //сохраняем с символом минус в расширении
^
glasio_test.go:108:5: ineffectual assignment to `err` (ineffassign)
n, err := las.Open("empty.las")
^
glasio_test.go:131:5: ineffectual assignment to `err` (ineffassign)
n, err = las.Open("empty.las")
^
example\main.go:48:17: Error return value of `las.SaveWarning` is not checked (errcheck)
las.SaveWarning("1.warning.md")
^
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 {
^
glasio_test.go:20:10: Error return value of `las.Open` is not checked (errcheck)
las.Open(fp.Join("data/more_20_warnings.las"))
^
glasio_test.go:45:11: Error return value of `las.Open` is not checked (errcheck)
las.Open(tmp.fn)
^
glasio_test.go:75:10: Error return value of `las.Open` is not checked (errcheck)
las.Open(fp.Join("data/expand_points_01.las"))
^
glasio_test.go:77:13: Error return value of `las.SetNull` is not checked (errcheck)
las.SetNull(-999.25)
^
glasio_test.go:79:10: Error return value of `las.Save` is not checked (errcheck)
las.Save("-tmp.las")
^
glasio_test.go:126:13: Error return value of `las.SetNull` is not checked (errcheck)
las.SetNull(100.001)
^
las.go:285:21: Error return value of `writer.WriteString` is not checked (errcheck)
writer.WriteString(w.String())
^
las.go:286:21: Error return value of `writer.WriteString` is not checked (errcheck)
writer.WriteString("\n")
^
las.go:299:19: Error return value of `oFile.WriteString` is not checked (errcheck)
oFile.WriteString("**file: " + o.FileName + "**\n")
^
las.go:301:19: Error return value of `oFile.WriteString` is not checked (errcheck)
oFile.WriteString("\n")
^
las.go:649:27: Error return value of `o.setActuallyNumberPoints` is not checked (errcheck)
o.setActuallyNumberPoints(i)
^
las_test.go:43:20: Error return value of `las.ReadWellParam` is not checked (errcheck)
las.ReadWellParam(tmp.s)
^
las_test.go:81:18: Error return value of `las.SaveWarning` is not checked (errcheck)
las.SaveWarning(fp.Join("data/more_20_warnings.wrn"))
^
las_test.go:144:17: Error return value of `las.LoadHeader` is not checked (errcheck)
las.LoadHeader()
^
las_util.go:33:16: Error return value of `las.LoadHeader` is not checked (errcheck)
las.LoadHeader()
^
las.go:733:17: SA1006: printf-style function with dynamic format string and no further arguments should use print-style function instead (staticcheck)
fmt.Fprintf(f, _LasDataSec)
^
las.go:736:17: SA1006: printf-style function with dynamic format string and no further arguments should use print-style function instead (staticcheck)
fmt.Fprintf(f, o.convertStrToOut(s))
^
las.go:509:29: S1019: should use make([]float64, o.expPoints) instead (gosimple)
newDept := make([]float64, o.expPoints, o.expPoints)
^
las.go:513:28: S1019: should use make([]float64, o.expPoints) instead (gosimple)
newLog := make([]float64, o.expPoints, o.expPoints)
^
las.go:524:30: S1019: should use make([]float64, o.expPoints) instead (gosimple)
newDept := make([]float64, o.expPoints, o.expPoints)
^
las_param.go:123:23: S1019: should use make([]float64, n) instead (gosimple)
t := make([]float64, n, n)
^
las_param.go:126:22: S1019: should use make([]float64, n) instead (gosimple)
t = make([]float64, n, n)
^
las.go:261:10: S1003: should use strings.Contains(strings.ToUpper(o.Wrap), "Y") instead (gosimple)
return (strings.Index(strings.ToUpper(o.Wrap), "Y") >= 0)
^