Read files on your computer
Ophiolite reads many kinds of files itself: LAS logs, tops and survey tables, grids, seismic and GIS files. Some files your team works with are not among them: a PDF report with a table of formation tops, or a spreadsheet laid out the way your team has always laid it out. A read procedure reads such a file on your own computer and makes data Ophiolite knows, such as well tops. The procedure runs only on your computer, never on the server, and what it made is read again by Ophiolite’s own reader before anything is added.
Read procedures are ordinary procedures with the step read. How to write, check and share one is in
Write and run a procedure.
Upload the file as usual
Section titled “Upload the file as usual”Upload the file, or the folder it is in, as you always do. When a read procedure your project shares can read the file, the upload report says so instead of refusing the file:
- In Workspace the file shows Can be read on your computer, with the read procedures that can read it.
ophiolite uploadprints the command to run:
To read it on this computer: ophiolite intake read RUN 'end of well report.pdf'RUN is the upload’s run id, as the report prints it. Nothing is added yet, and nothing ran.
Read it on your computer
Section titled “Read it on your computer”ophiolite intake read RUN "end of well report.pdf"The command checks that the file on your computer is the one you uploaded (its size and checksum), asks you to trust the read procedure version once, runs it on your computer and sends what it made into the same upload. The report then shows the file as Read on your computer, with each output under it.
--keep-originalkeeps the file you uploaded beside what was read from it, private like any upload. Without it, only the file’s name, size and checksum are kept.--version DIGESTchooses the version when several can read the file; without it the command lists them.--setting NAME=VALUEgives a setting the read procedure asks for. A required setting without a value is refused before anything runs.- If the command stops part way, run it again: it continues where it stopped, without running the procedure again.
What was read is checked by Ophiolite’s own reader for its kind, exactly as an upload of that file would be. A file the procedure made that the reader refuses is not added; the report says which file and why.
Two examples
Section titled “Two examples”The folder examples/procedures/ of the Ophiolite repository has two read procedures you can copy:
groningen-pdf-topsreads the stratigraphy table of an end of well report (PDF) into well tops. It needs the Python librarypypdfon your computer; the procedure lists it underrequires.team-tops-csvreads a tops table with the columnswell_id,top_md_m,base_md_m,stratigraphic_unitandsource(the layout of NLOG’s stratigraphic interpretations) into well tops.
Both give the tops in metres along hole, with the depth reference not stated.
Which reader reads a file
Section titled “Which reader reads a file”One rule decides, in this order:
- A file a built-in reader recognises by its content is read by that reader, even when a read procedure would match.
- A file more than one built-in reader recognises asks which kind it is, as before.
- A file exactly one read procedure matches can be read on your computer with that one.
- Otherwise, a file whose extension one built-in reader lists is read by that reader.
- A file several read procedures match can be read on your computer with the one you choose.
- Anything else is not supported.
A read procedure matches a file by the extensions and the first bytes its procedure.json names.
What the story says
Section titled “What the story says”The story of each output names the original file, the read procedure and its version, and whether the original file is kept. When you export it, a portable bundle carries the kept original beside it (bundle 2.9); a project that imports the bundle keeps the original and says the file was read “as recorded in the exporting project”.
