From fe0e97567401abe3fcadd4889a9cbc57509ca1d4 Mon Sep 17 00:00:00 2001 From: Kent Inverarity Date: Tue, 2 Feb 2016 19:17:35 +1030 Subject: [PATCH] Add tests for null_policy=... (#49) Also fixed the (un)wrapped tests --- notebooks/issues/sample_wrapped.ipynb | 314 ++++++++++---------- tests/examples/null_policy_alphanumeric.las | 35 +++ tests/examples/null_policy_numeric.las | 35 +++ tests/examples/null_subs.las | 46 --- tests/test_read.py | 57 +++- tests/test_wrapped.py | 4 +- 6 files changed, 274 insertions(+), 217 deletions(-) create mode 100644 tests/examples/null_policy_alphanumeric.las create mode 100644 tests/examples/null_policy_numeric.las delete mode 100644 tests/examples/null_subs.las diff --git a/notebooks/issues/sample_wrapped.ipynb b/notebooks/issues/sample_wrapped.ipynb index f514568f..10383be7 100644 --- a/notebooks/issues/sample_wrapped.ipynb +++ b/notebooks/issues/sample_wrapped.ipynb @@ -2,10 +2,10 @@ "cells": [ { "cell_type": "code", - "execution_count": 2, + "execution_count": 5, "metadata": { "collapsed": false, - "scrolled": false + "scrolled": true }, "outputs": [ { @@ -28,46 +28,46 @@ "DEBUG:lasio.las:SectionItems.append type= str=HeaderItem(mnemonic=SON, unit=, value=142085, descr=SERVICE ORDER, original_mnemonic=SON)\n", "DEBUG:lasio.las:SectionItems.append type= str=HeaderItem(mnemonic=DATE, unit=, value=13-DEC-86, descr=LOG DATE, original_mnemonic=DATE)\n", "DEBUG:lasio.las:SectionItems.append type= str=HeaderItem(mnemonic=UWI, unit=, value=, descr=UNIQUE WELL ID, original_mnemonic=UWI)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=DEPT, unit=M, value=, descr=Depth, original_mnemonic=DEPT)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=DT, unit=US/M, value=, descr=1 Sonic Travel Time, original_mnemonic=DT)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RHOB, unit=K/M, value=, descr=2 Density-Bulk Density, original_mnemonic=RHOB)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=NPHI, unit=V/V, value=, descr=3 Porosity -Neutron, original_mnemonic=NPHI)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RX0, unit=OHMM, value=, descr=4 Resistivity -Rxo, original_mnemonic=RX0)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RESS, unit=OHMM, value=, descr=5 Resistivity -Shallow, original_mnemonic=RESS)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RESM, unit=OHMM, value=, descr=6 Resistivity -Medium, original_mnemonic=RESM)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RESD, unit=OHMM, value=, descr=7 Resistivity -Deep, original_mnemonic=RESD)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=SP, unit=MV, value=, descr=8 Spon. Potential, original_mnemonic=SP)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=GR, unit=GAPI, value=, descr=9 Gamma Ray, original_mnemonic=GR)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=CALI, unit=MM, value=, descr=10 Caliper, original_mnemonic=CALI)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=DRHO, unit=K/M3, value=, descr=11 Delta-Rho, original_mnemonic=DRHO)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=EATT, unit=DBM, value=, descr=12 EPT Attenuation, original_mnemonic=EATT)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=TPL, unit=NS/M, value=, descr=13 TP -EPT, original_mnemonic=TPL)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=PEF, unit=, value=, descr=14 PhotoElectric Factor, original_mnemonic=PEF)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=FFI, unit=V/V, value=, descr=15 Porosity -NML FFI, original_mnemonic=FFI)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=DCAL, unit=MM, value=, descr=16 Caliper-Differential, original_mnemonic=DCAL)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RHGF, unit=K/M3, value=, descr=17 Density-Formation, original_mnemonic=RHGF)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RHGA, unit=K/M3, value=, descr=18 Density-Apparent, original_mnemonic=RHGA)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=SPBL, unit=MV, value=, descr=19 Baselined SP, original_mnemonic=SPBL)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=GRC, unit=GAPI, value=, descr=20 Gamma Ray BHC, original_mnemonic=GRC)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=PHIA, unit=V/V, value=, descr=21 Porosity -Apparent, original_mnemonic=PHIA)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=PHID, unit=V/V, value=, descr=22 Porosity -Density, original_mnemonic=PHID)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=PHIE, unit=V/V, value=, descr=23 Porosity -Effective, original_mnemonic=PHIE)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=PHIN, unit=V/V, value=, descr=24 Porosity -Neut BHC, original_mnemonic=PHIN)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=PHIC, unit=V/V, value=, descr=25 Porosity -Total HCC, original_mnemonic=PHIC)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=R0, unit=OHMM, value=, descr=26 Ro, original_mnemonic=R0)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RWA, unit=OHMM, value=, descr=27 Rfa, original_mnemonic=RWA)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=SW, unit=, value=, descr=28 Sw -Effective, original_mnemonic=SW)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=MSI, unit=, value=, descr=29 Sh Idx -Min, original_mnemonic=MSI)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=BVW, unit=, value=, descr=30 BVW, original_mnemonic=BVW)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=FGAS, unit=, value=, descr=31 Flag -Gas Index, original_mnemonic=FGAS)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=PIDX, unit=, value=, descr=32 Prod Idx, original_mnemonic=PIDX)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=FBH, unit=, value=, descr=33 Flag -Bad Hole, original_mnemonic=FBH)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=FHCC, unit=, value=, descr=34 Flag -HC Correction, original_mnemonic=FHCC)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=LSWB, unit=, value=, descr=35 Flag -Limit SWB, original_mnemonic=LSWB)\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=DEPT, unit=M, value=, descr=Depth, original_mnemonic=DEPT, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=DT, unit=US/M, value=, descr=1 Sonic Travel Time, original_mnemonic=DT, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RHOB, unit=K/M, value=, descr=2 Density-Bulk Density, original_mnemonic=RHOB, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=NPHI, unit=V/V, value=, descr=3 Porosity -Neutron, original_mnemonic=NPHI, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RX0, unit=OHMM, value=, descr=4 Resistivity -Rxo, original_mnemonic=RX0, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RESS, unit=OHMM, value=, descr=5 Resistivity -Shallow, original_mnemonic=RESS, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RESM, unit=OHMM, value=, descr=6 Resistivity -Medium, original_mnemonic=RESM, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RESD, unit=OHMM, value=, descr=7 Resistivity -Deep, original_mnemonic=RESD, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=SP, unit=MV, value=, descr=8 Spon. Potential, original_mnemonic=SP, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=GR, unit=GAPI, value=, descr=9 Gamma Ray, original_mnemonic=GR, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=CALI, unit=MM, value=, descr=10 Caliper, original_mnemonic=CALI, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=DRHO, unit=K/M3, value=, descr=11 Delta-Rho, original_mnemonic=DRHO, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=EATT, unit=DBM, value=, descr=12 EPT Attenuation, original_mnemonic=EATT, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=TPL, unit=NS/M, value=, descr=13 TP -EPT, original_mnemonic=TPL, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=PEF, unit=, value=, descr=14 PhotoElectric Factor, original_mnemonic=PEF, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=FFI, unit=V/V, value=, descr=15 Porosity -NML FFI, original_mnemonic=FFI, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=DCAL, unit=MM, value=, descr=16 Caliper-Differential, original_mnemonic=DCAL, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RHGF, unit=K/M3, value=, descr=17 Density-Formation, original_mnemonic=RHGF, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RHGA, unit=K/M3, value=, descr=18 Density-Apparent, original_mnemonic=RHGA, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=SPBL, unit=MV, value=, descr=19 Baselined SP, original_mnemonic=SPBL, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=GRC, unit=GAPI, value=, descr=20 Gamma Ray BHC, original_mnemonic=GRC, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=PHIA, unit=V/V, value=, descr=21 Porosity -Apparent, original_mnemonic=PHIA, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=PHID, unit=V/V, value=, descr=22 Porosity -Density, original_mnemonic=PHID, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=PHIE, unit=V/V, value=, descr=23 Porosity -Effective, original_mnemonic=PHIE, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=PHIN, unit=V/V, value=, descr=24 Porosity -Neut BHC, original_mnemonic=PHIN, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=PHIC, unit=V/V, value=, descr=25 Porosity -Total HCC, original_mnemonic=PHIC, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=R0, unit=OHMM, value=, descr=26 Ro, original_mnemonic=R0, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RWA, unit=OHMM, value=, descr=27 Rfa, original_mnemonic=RWA, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=SW, unit=, value=, descr=28 Sw -Effective, original_mnemonic=SW, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=MSI, unit=, value=, descr=29 Sh Idx -Min, original_mnemonic=MSI, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=BVW, unit=, value=, descr=30 BVW, original_mnemonic=BVW, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=FGAS, unit=, value=, descr=31 Flag -Gas Index, original_mnemonic=FGAS, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=PIDX, unit=, value=, descr=32 Prod Idx, original_mnemonic=PIDX, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=FBH, unit=, value=, descr=33 Flag -Bad Hole, original_mnemonic=FBH, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=FHCC, unit=, value=, descr=34 Flag -HC Correction, original_mnemonic=FHCC, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=LSWB, unit=, value=, descr=35 Flag -Limit SWB, original_mnemonic=LSWB, data.shape=())\n", "DEBUG:lasio.las:Reader.read_data arr shape = 180\n", "DEBUG:lasio.las:Reader.read_data number of curves = 36\n", - "INFO:lasio.las:Reader.read_data LAS file shape = (5, 36)\n", - "DEBUG:lasio.las:Reader.read_data checking for nulls (NULL = -999.25)\n", + "INFO:lasio.las:LAS file shape = (5L, 36L)\n", + "DEBUG:lasio.las:checking for nulls (NULL = -999.25)\n", "DEBUG:lasio.las:SectionItems.__setitem__ Replaced WRAP item\n", "DEBUG:lasio.las:SectionItems.__setitem__ Replaced VERS item\n", "DEBUG:lasio.las:LASFile.write Version section\n", @@ -133,77 +133,77 @@ "DEBUG:lasio.las:LASFile.write HeaderItem(mnemonic=UWI, unit=, value=, descr=UNIQUE WELL ID, original_mnemonic=UWI)\n", "order=value:descr section_widths={'left_width': 4, 'middle_width': 25}\n", "DEBUG:lasio.las:LASFile.write Curves section\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=DEPT, unit=M, value=, descr=Depth, original_mnemonic=DEPT)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=DEPT, unit=M, value=, descr=Depth, original_mnemonic=DEPT, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=DT, unit=US/M, value=, descr=1 Sonic Travel Time, original_mnemonic=DT)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=DT, unit=US/M, value=, descr=1 Sonic Travel Time, original_mnemonic=DT, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RHOB, unit=K/M, value=, descr=2 Density-Bulk Density, original_mnemonic=RHOB)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RHOB, unit=K/M, value=, descr=2 Density-Bulk Density, original_mnemonic=RHOB, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=NPHI, unit=V/V, value=, descr=3 Porosity -Neutron, original_mnemonic=NPHI)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=NPHI, unit=V/V, value=, descr=3 Porosity -Neutron, original_mnemonic=NPHI, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RX0, unit=OHMM, value=, descr=4 Resistivity -Rxo, original_mnemonic=RX0)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RX0, unit=OHMM, value=, descr=4 Resistivity -Rxo, original_mnemonic=RX0, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RESS, unit=OHMM, value=, descr=5 Resistivity -Shallow, original_mnemonic=RESS)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RESS, unit=OHMM, value=, descr=5 Resistivity -Shallow, original_mnemonic=RESS, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RESM, unit=OHMM, value=, descr=6 Resistivity -Medium, original_mnemonic=RESM)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RESM, unit=OHMM, value=, descr=6 Resistivity -Medium, original_mnemonic=RESM, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RESD, unit=OHMM, value=, descr=7 Resistivity -Deep, original_mnemonic=RESD)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RESD, unit=OHMM, value=, descr=7 Resistivity -Deep, original_mnemonic=RESD, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=SP, unit=MV, value=, descr=8 Spon. Potential, original_mnemonic=SP)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=SP, unit=MV, value=, descr=8 Spon. Potential, original_mnemonic=SP, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=GR, unit=GAPI, value=, descr=9 Gamma Ray, original_mnemonic=GR)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=GR, unit=GAPI, value=, descr=9 Gamma Ray, original_mnemonic=GR, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=CALI, unit=MM, value=, descr=10 Caliper, original_mnemonic=CALI)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=CALI, unit=MM, value=, descr=10 Caliper, original_mnemonic=CALI, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=DRHO, unit=K/M3, value=, descr=11 Delta-Rho, original_mnemonic=DRHO)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=DRHO, unit=K/M3, value=, descr=11 Delta-Rho, original_mnemonic=DRHO, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=EATT, unit=DBM, value=, descr=12 EPT Attenuation, original_mnemonic=EATT)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=EATT, unit=DBM, value=, descr=12 EPT Attenuation, original_mnemonic=EATT, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=TPL, unit=NS/M, value=, descr=13 TP -EPT, original_mnemonic=TPL)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=TPL, unit=NS/M, value=, descr=13 TP -EPT, original_mnemonic=TPL, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=PEF, unit=, value=, descr=14 PhotoElectric Factor, original_mnemonic=PEF)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=PEF, unit=, value=, descr=14 PhotoElectric Factor, original_mnemonic=PEF, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=FFI, unit=V/V, value=, descr=15 Porosity -NML FFI, original_mnemonic=FFI)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=FFI, unit=V/V, value=, descr=15 Porosity -NML FFI, original_mnemonic=FFI, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=DCAL, unit=MM, value=, descr=16 Caliper-Differential, original_mnemonic=DCAL)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=DCAL, unit=MM, value=, descr=16 Caliper-Differential, original_mnemonic=DCAL, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RHGF, unit=K/M3, value=, descr=17 Density-Formation, original_mnemonic=RHGF)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RHGF, unit=K/M3, value=, descr=17 Density-Formation, original_mnemonic=RHGF, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RHGA, unit=K/M3, value=, descr=18 Density-Apparent, original_mnemonic=RHGA)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RHGA, unit=K/M3, value=, descr=18 Density-Apparent, original_mnemonic=RHGA, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=SPBL, unit=MV, value=, descr=19 Baselined SP, original_mnemonic=SPBL)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=SPBL, unit=MV, value=, descr=19 Baselined SP, original_mnemonic=SPBL, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=GRC, unit=GAPI, value=, descr=20 Gamma Ray BHC, original_mnemonic=GRC)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=GRC, unit=GAPI, value=, descr=20 Gamma Ray BHC, original_mnemonic=GRC, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=PHIA, unit=V/V, value=, descr=21 Porosity -Apparent, original_mnemonic=PHIA)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=PHIA, unit=V/V, value=, descr=21 Porosity -Apparent, original_mnemonic=PHIA, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=PHID, unit=V/V, value=, descr=22 Porosity -Density, original_mnemonic=PHID)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=PHID, unit=V/V, value=, descr=22 Porosity -Density, original_mnemonic=PHID, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=PHIE, unit=V/V, value=, descr=23 Porosity -Effective, original_mnemonic=PHIE)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=PHIE, unit=V/V, value=, descr=23 Porosity -Effective, original_mnemonic=PHIE, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=PHIN, unit=V/V, value=, descr=24 Porosity -Neut BHC, original_mnemonic=PHIN)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=PHIN, unit=V/V, value=, descr=24 Porosity -Neut BHC, original_mnemonic=PHIN, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=PHIC, unit=V/V, value=, descr=25 Porosity -Total HCC, original_mnemonic=PHIC)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=PHIC, unit=V/V, value=, descr=25 Porosity -Total HCC, original_mnemonic=PHIC, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=R0, unit=OHMM, value=, descr=26 Ro, original_mnemonic=R0)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=R0, unit=OHMM, value=, descr=26 Ro, original_mnemonic=R0, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RWA, unit=OHMM, value=, descr=27 Rfa, original_mnemonic=RWA)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RWA, unit=OHMM, value=, descr=27 Rfa, original_mnemonic=RWA, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=SW, unit=, value=, descr=28 Sw -Effective, original_mnemonic=SW)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=SW, unit=, value=, descr=28 Sw -Effective, original_mnemonic=SW, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=MSI, unit=, value=, descr=29 Sh Idx -Min, original_mnemonic=MSI)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=MSI, unit=, value=, descr=29 Sh Idx -Min, original_mnemonic=MSI, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=BVW, unit=, value=, descr=30 BVW, original_mnemonic=BVW)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=BVW, unit=, value=, descr=30 BVW, original_mnemonic=BVW, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=FGAS, unit=, value=, descr=31 Flag -Gas Index, original_mnemonic=FGAS)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=FGAS, unit=, value=, descr=31 Flag -Gas Index, original_mnemonic=FGAS, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=PIDX, unit=, value=, descr=32 Prod Idx, original_mnemonic=PIDX)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=PIDX, unit=, value=, descr=32 Prod Idx, original_mnemonic=PIDX, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=FBH, unit=, value=, descr=33 Flag -Bad Hole, original_mnemonic=FBH)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=FBH, unit=, value=, descr=33 Flag -Bad Hole, original_mnemonic=FBH, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=FHCC, unit=, value=, descr=34 Flag -HC Correction, original_mnemonic=FHCC)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=FHCC, unit=, value=, descr=34 Flag -HC Correction, original_mnemonic=FHCC, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=LSWB, unit=, value=, descr=35 Flag -Limit SWB, original_mnemonic=LSWB)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=LSWB, unit=, value=, descr=35 Flag -Limit SWB, original_mnemonic=LSWB, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", "DEBUG:lasio.las:LASFile.write Wrapped 6 lines out of 910.00000 -999.25 2692.70750 0.31400 19.40860 19.40860 13.17090 12.26810 -1.50100 96.53060 204.71770 30.58220 -999.25 -999.25 3.25150 -999.25 4.71770 3025.02640 3025.02640 -1.50100 93.13780 0.16410 0.01010 0.16410 0.31400 0.16410 11.13970 0.33040 0.95290 0.00000 0.15640 0.00000 11.13970 0.00000 0.00000 0.00000\n", "DEBUG:lasio.las:LASFile.write Wrapped 6 lines out of 909.87500 -999.25 2712.64600 0.28860 23.39870 23.39870 13.61290 12.47440 -1.47200 90.28030 203.10930 18.75660 -999.25 -999.25 3.70580 -999.25 3.10930 3004.60500 3004.60500 -1.47200 86.90780 0.14560 -0.00150 0.14560 0.28860 0.14560 14.14280 0.26460 1.00000 0.00000 0.14560 0.00000 14.14280 0.00000 0.00000 0.00000\n", @@ -312,7 +312,7 @@ "logging.getLogger().setLevel(level=logging.DEBUG)\n", "import lasio\n", "import StringIO\n", - "l = lasio.read(r'D:\\personal\\code\\lasio\\tests\\examples\\1.2\\sample_wrapped.las')\n", + "l = lasio.read(r'D:\\personal\\code\\lasio\\tests\\examples\\1.2\\sample_wrapped.las', null_policy='NULL')\n", "s = StringIO.StringIO()\n", "l.write(s, version=2.0, wrap=True, fmt=\"%.5f\")\n", "s.seek(0); print s.read()" @@ -320,7 +320,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 6, "metadata": { "collapsed": false, "scrolled": false @@ -346,46 +346,46 @@ "DEBUG:lasio.las:SectionItems.append type= str=HeaderItem(mnemonic=SON, unit=, value=142085, descr=SERVICE ORDER, original_mnemonic=SON)\n", "DEBUG:lasio.las:SectionItems.append type= str=HeaderItem(mnemonic=DATE, unit=, value=13-DEC-86, descr=LOG DATE, original_mnemonic=DATE)\n", "DEBUG:lasio.las:SectionItems.append type= str=HeaderItem(mnemonic=UWI, unit=, value=, descr=UNIQUE WELL ID, original_mnemonic=UWI)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=DEPT, unit=M, value=, descr=Depth, original_mnemonic=DEPT)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=DT, unit=US/M, value=, descr=1 Sonic Travel Time, original_mnemonic=DT)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RHOB, unit=K/M, value=, descr=2 Density-Bulk Density, original_mnemonic=RHOB)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=NPHI, unit=V/V, value=, descr=3 Porosity -Neutron, original_mnemonic=NPHI)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RX0, unit=OHMM, value=, descr=4 Resistivity -Rxo, original_mnemonic=RX0)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RESS, unit=OHMM, value=, descr=5 Resistivity -Shallow, original_mnemonic=RESS)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RESM, unit=OHMM, value=, descr=6 Resistivity -Medium, original_mnemonic=RESM)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RESD, unit=OHMM, value=, descr=7 Resistivity -Deep, original_mnemonic=RESD)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=SP, unit=MV, value=, descr=8 Spon. Potential, original_mnemonic=SP)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=GR, unit=GAPI, value=, descr=9 Gamma Ray, original_mnemonic=GR)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=CALI, unit=MM, value=, descr=10 Caliper, original_mnemonic=CALI)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=DRHO, unit=K/M3, value=, descr=11 Delta-Rho, original_mnemonic=DRHO)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=EATT, unit=DBM, value=, descr=12 EPT Attenuation, original_mnemonic=EATT)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=TPL, unit=NS/M, value=, descr=13 TP -EPT, original_mnemonic=TPL)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=PEF, unit=, value=, descr=14 PhotoElectric Factor, original_mnemonic=PEF)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=FFI, unit=V/V, value=, descr=15 Porosity -NML FFI, original_mnemonic=FFI)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=DCAL, unit=MM, value=, descr=16 Caliper-Differential, original_mnemonic=DCAL)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RHGF, unit=K/M3, value=, descr=17 Density-Formation, original_mnemonic=RHGF)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RHGA, unit=K/M3, value=, descr=18 Density-Apparent, original_mnemonic=RHGA)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=SPBL, unit=MV, value=, descr=19 Baselined SP, original_mnemonic=SPBL)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=GRC, unit=GAPI, value=, descr=20 Gamma Ray BHC, original_mnemonic=GRC)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=PHIA, unit=V/V, value=, descr=21 Porosity -Apparent, original_mnemonic=PHIA)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=PHID, unit=V/V, value=, descr=22 Porosity -Density, original_mnemonic=PHID)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=PHIE, unit=V/V, value=, descr=23 Porosity -Effective, original_mnemonic=PHIE)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=PHIN, unit=V/V, value=, descr=24 Porosity -Neut BHC, original_mnemonic=PHIN)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=PHIC, unit=V/V, value=, descr=25 Porosity -Total HCC, original_mnemonic=PHIC)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=R0, unit=OHMM, value=, descr=26 Ro, original_mnemonic=R0)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RWA, unit=OHMM, value=, descr=27 Rfa, original_mnemonic=RWA)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=SW, unit=, value=, descr=28 Sw -Effective, original_mnemonic=SW)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=MSI, unit=, value=, descr=29 Sh Idx -Min, original_mnemonic=MSI)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=BVW, unit=, value=, descr=30 BVW, original_mnemonic=BVW)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=FGAS, unit=, value=, descr=31 Flag -Gas Index, original_mnemonic=FGAS)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=PIDX, unit=, value=, descr=32 Prod Idx, original_mnemonic=PIDX)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=FBH, unit=, value=, descr=33 Flag -Bad Hole, original_mnemonic=FBH)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=FHCC, unit=, value=, descr=34 Flag -HC Correction, original_mnemonic=FHCC)\n", - "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=LSWB, unit=, value=, descr=35 Flag -Limit SWB, original_mnemonic=LSWB)\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=DEPT, unit=M, value=, descr=Depth, original_mnemonic=DEPT, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=DT, unit=US/M, value=, descr=1 Sonic Travel Time, original_mnemonic=DT, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RHOB, unit=K/M, value=, descr=2 Density-Bulk Density, original_mnemonic=RHOB, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=NPHI, unit=V/V, value=, descr=3 Porosity -Neutron, original_mnemonic=NPHI, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RX0, unit=OHMM, value=, descr=4 Resistivity -Rxo, original_mnemonic=RX0, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RESS, unit=OHMM, value=, descr=5 Resistivity -Shallow, original_mnemonic=RESS, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RESM, unit=OHMM, value=, descr=6 Resistivity -Medium, original_mnemonic=RESM, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RESD, unit=OHMM, value=, descr=7 Resistivity -Deep, original_mnemonic=RESD, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=SP, unit=MV, value=, descr=8 Spon. Potential, original_mnemonic=SP, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=GR, unit=GAPI, value=, descr=9 Gamma Ray, original_mnemonic=GR, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=CALI, unit=MM, value=, descr=10 Caliper, original_mnemonic=CALI, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=DRHO, unit=K/M3, value=, descr=11 Delta-Rho, original_mnemonic=DRHO, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=EATT, unit=DBM, value=, descr=12 EPT Attenuation, original_mnemonic=EATT, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=TPL, unit=NS/M, value=, descr=13 TP -EPT, original_mnemonic=TPL, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=PEF, unit=, value=, descr=14 PhotoElectric Factor, original_mnemonic=PEF, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=FFI, unit=V/V, value=, descr=15 Porosity -NML FFI, original_mnemonic=FFI, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=DCAL, unit=MM, value=, descr=16 Caliper-Differential, original_mnemonic=DCAL, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RHGF, unit=K/M3, value=, descr=17 Density-Formation, original_mnemonic=RHGF, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RHGA, unit=K/M3, value=, descr=18 Density-Apparent, original_mnemonic=RHGA, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=SPBL, unit=MV, value=, descr=19 Baselined SP, original_mnemonic=SPBL, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=GRC, unit=GAPI, value=, descr=20 Gamma Ray BHC, original_mnemonic=GRC, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=PHIA, unit=V/V, value=, descr=21 Porosity -Apparent, original_mnemonic=PHIA, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=PHID, unit=V/V, value=, descr=22 Porosity -Density, original_mnemonic=PHID, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=PHIE, unit=V/V, value=, descr=23 Porosity -Effective, original_mnemonic=PHIE, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=PHIN, unit=V/V, value=, descr=24 Porosity -Neut BHC, original_mnemonic=PHIN, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=PHIC, unit=V/V, value=, descr=25 Porosity -Total HCC, original_mnemonic=PHIC, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=R0, unit=OHMM, value=, descr=26 Ro, original_mnemonic=R0, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=RWA, unit=OHMM, value=, descr=27 Rfa, original_mnemonic=RWA, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=SW, unit=, value=, descr=28 Sw -Effective, original_mnemonic=SW, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=MSI, unit=, value=, descr=29 Sh Idx -Min, original_mnemonic=MSI, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=BVW, unit=, value=, descr=30 BVW, original_mnemonic=BVW, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=FGAS, unit=, value=, descr=31 Flag -Gas Index, original_mnemonic=FGAS, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=PIDX, unit=, value=, descr=32 Prod Idx, original_mnemonic=PIDX, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=FBH, unit=, value=, descr=33 Flag -Bad Hole, original_mnemonic=FBH, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=FHCC, unit=, value=, descr=34 Flag -HC Correction, original_mnemonic=FHCC, data.shape=())\n", + "DEBUG:lasio.las:SectionItems.append type= str=CurveItem(mnemonic=LSWB, unit=, value=, descr=35 Flag -Limit SWB, original_mnemonic=LSWB, data.shape=())\n", "DEBUG:lasio.las:Reader.read_data arr shape = 180\n", "DEBUG:lasio.las:Reader.read_data number of curves = 36\n", - "INFO:lasio.las:Reader.read_data LAS file shape = (5, 36)\n", - "DEBUG:lasio.las:Reader.read_data checking for nulls (NULL = -999.25)\n", + "INFO:lasio.las:LAS file shape = (5L, 36L)\n", + "DEBUG:lasio.las:checking for nulls (NULL = -999.25)\n", "DEBUG:lasio.las:SectionItems.__setitem__ Replaced WRAP item\n", "DEBUG:lasio.las:SectionItems.__setitem__ Replaced VERS item\n", "DEBUG:lasio.las:LASFile.write Version section\n", @@ -451,77 +451,77 @@ "DEBUG:lasio.las:LASFile.write HeaderItem(mnemonic=UWI, unit=, value=, descr=UNIQUE WELL ID, original_mnemonic=UWI)\n", "order=value:descr section_widths={'left_width': 4, 'middle_width': 25}\n", "DEBUG:lasio.las:LASFile.write Curves section\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=DEPT, unit=M, value=, descr=Depth, original_mnemonic=DEPT)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=DEPT, unit=M, value=, descr=Depth, original_mnemonic=DEPT, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=DT, unit=US/M, value=, descr=1 Sonic Travel Time, original_mnemonic=DT)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=DT, unit=US/M, value=, descr=1 Sonic Travel Time, original_mnemonic=DT, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RHOB, unit=K/M, value=, descr=2 Density-Bulk Density, original_mnemonic=RHOB)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RHOB, unit=K/M, value=, descr=2 Density-Bulk Density, original_mnemonic=RHOB, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=NPHI, unit=V/V, value=, descr=3 Porosity -Neutron, original_mnemonic=NPHI)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=NPHI, unit=V/V, value=, descr=3 Porosity -Neutron, original_mnemonic=NPHI, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RX0, unit=OHMM, value=, descr=4 Resistivity -Rxo, original_mnemonic=RX0)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RX0, unit=OHMM, value=, descr=4 Resistivity -Rxo, original_mnemonic=RX0, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RESS, unit=OHMM, value=, descr=5 Resistivity -Shallow, original_mnemonic=RESS)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RESS, unit=OHMM, value=, descr=5 Resistivity -Shallow, original_mnemonic=RESS, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RESM, unit=OHMM, value=, descr=6 Resistivity -Medium, original_mnemonic=RESM)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RESM, unit=OHMM, value=, descr=6 Resistivity -Medium, original_mnemonic=RESM, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RESD, unit=OHMM, value=, descr=7 Resistivity -Deep, original_mnemonic=RESD)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RESD, unit=OHMM, value=, descr=7 Resistivity -Deep, original_mnemonic=RESD, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=SP, unit=MV, value=, descr=8 Spon. Potential, original_mnemonic=SP)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=SP, unit=MV, value=, descr=8 Spon. Potential, original_mnemonic=SP, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=GR, unit=GAPI, value=, descr=9 Gamma Ray, original_mnemonic=GR)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=GR, unit=GAPI, value=, descr=9 Gamma Ray, original_mnemonic=GR, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=CALI, unit=MM, value=, descr=10 Caliper, original_mnemonic=CALI)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=CALI, unit=MM, value=, descr=10 Caliper, original_mnemonic=CALI, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=DRHO, unit=K/M3, value=, descr=11 Delta-Rho, original_mnemonic=DRHO)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=DRHO, unit=K/M3, value=, descr=11 Delta-Rho, original_mnemonic=DRHO, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=EATT, unit=DBM, value=, descr=12 EPT Attenuation, original_mnemonic=EATT)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=EATT, unit=DBM, value=, descr=12 EPT Attenuation, original_mnemonic=EATT, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=TPL, unit=NS/M, value=, descr=13 TP -EPT, original_mnemonic=TPL)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=TPL, unit=NS/M, value=, descr=13 TP -EPT, original_mnemonic=TPL, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=PEF, unit=, value=, descr=14 PhotoElectric Factor, original_mnemonic=PEF)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=PEF, unit=, value=, descr=14 PhotoElectric Factor, original_mnemonic=PEF, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=FFI, unit=V/V, value=, descr=15 Porosity -NML FFI, original_mnemonic=FFI)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=FFI, unit=V/V, value=, descr=15 Porosity -NML FFI, original_mnemonic=FFI, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=DCAL, unit=MM, value=, descr=16 Caliper-Differential, original_mnemonic=DCAL)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=DCAL, unit=MM, value=, descr=16 Caliper-Differential, original_mnemonic=DCAL, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RHGF, unit=K/M3, value=, descr=17 Density-Formation, original_mnemonic=RHGF)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RHGF, unit=K/M3, value=, descr=17 Density-Formation, original_mnemonic=RHGF, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RHGA, unit=K/M3, value=, descr=18 Density-Apparent, original_mnemonic=RHGA)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RHGA, unit=K/M3, value=, descr=18 Density-Apparent, original_mnemonic=RHGA, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=SPBL, unit=MV, value=, descr=19 Baselined SP, original_mnemonic=SPBL)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=SPBL, unit=MV, value=, descr=19 Baselined SP, original_mnemonic=SPBL, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=GRC, unit=GAPI, value=, descr=20 Gamma Ray BHC, original_mnemonic=GRC)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=GRC, unit=GAPI, value=, descr=20 Gamma Ray BHC, original_mnemonic=GRC, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=PHIA, unit=V/V, value=, descr=21 Porosity -Apparent, original_mnemonic=PHIA)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=PHIA, unit=V/V, value=, descr=21 Porosity -Apparent, original_mnemonic=PHIA, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=PHID, unit=V/V, value=, descr=22 Porosity -Density, original_mnemonic=PHID)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=PHID, unit=V/V, value=, descr=22 Porosity -Density, original_mnemonic=PHID, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=PHIE, unit=V/V, value=, descr=23 Porosity -Effective, original_mnemonic=PHIE)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=PHIE, unit=V/V, value=, descr=23 Porosity -Effective, original_mnemonic=PHIE, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=PHIN, unit=V/V, value=, descr=24 Porosity -Neut BHC, original_mnemonic=PHIN)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=PHIN, unit=V/V, value=, descr=24 Porosity -Neut BHC, original_mnemonic=PHIN, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=PHIC, unit=V/V, value=, descr=25 Porosity -Total HCC, original_mnemonic=PHIC)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=PHIC, unit=V/V, value=, descr=25 Porosity -Total HCC, original_mnemonic=PHIC, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=R0, unit=OHMM, value=, descr=26 Ro, original_mnemonic=R0)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=R0, unit=OHMM, value=, descr=26 Ro, original_mnemonic=R0, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RWA, unit=OHMM, value=, descr=27 Rfa, original_mnemonic=RWA)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=RWA, unit=OHMM, value=, descr=27 Rfa, original_mnemonic=RWA, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=SW, unit=, value=, descr=28 Sw -Effective, original_mnemonic=SW)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=SW, unit=, value=, descr=28 Sw -Effective, original_mnemonic=SW, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=MSI, unit=, value=, descr=29 Sh Idx -Min, original_mnemonic=MSI)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=MSI, unit=, value=, descr=29 Sh Idx -Min, original_mnemonic=MSI, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=BVW, unit=, value=, descr=30 BVW, original_mnemonic=BVW)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=BVW, unit=, value=, descr=30 BVW, original_mnemonic=BVW, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=FGAS, unit=, value=, descr=31 Flag -Gas Index, original_mnemonic=FGAS)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=FGAS, unit=, value=, descr=31 Flag -Gas Index, original_mnemonic=FGAS, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=PIDX, unit=, value=, descr=32 Prod Idx, original_mnemonic=PIDX)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=PIDX, unit=, value=, descr=32 Prod Idx, original_mnemonic=PIDX, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=FBH, unit=, value=, descr=33 Flag -Bad Hole, original_mnemonic=FBH)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=FBH, unit=, value=, descr=33 Flag -Bad Hole, original_mnemonic=FBH, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=FHCC, unit=, value=, descr=34 Flag -HC Correction, original_mnemonic=FHCC)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=FHCC, unit=, value=, descr=34 Flag -HC Correction, original_mnemonic=FHCC, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n", - "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=LSWB, unit=, value=, descr=35 Flag -Limit SWB, original_mnemonic=LSWB)\n", + "DEBUG:lasio.las:get_section_widths CurveItem(mnemonic=LSWB, unit=, value=, descr=35 Flag -Limit SWB, original_mnemonic=LSWB, data.shape=(5L,))\n", "\torder=value:descr rhs_element=value\n" ] }, @@ -600,7 +600,7 @@ "logging.getLogger().setLevel(level=logging.DEBUG)\n", "import lasio\n", "import StringIO\n", - "l = lasio.read(r'D:\\personal\\code\\lasio\\tests\\examples\\1.2\\sample_wrapped.las')\n", + "l = lasio.read(r'D:\\personal\\code\\lasio\\tests\\examples\\1.2\\sample_wrapped.las', null_policy='NULL')\n", "s = StringIO.StringIO()\n", "l.write(s, version=2.0, wrap=False, fmt=\"%.5f\")\n", "s.seek(0); print s.read()" @@ -608,7 +608,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": { "collapsed": false }, @@ -616,10 +616,10 @@ { "data": { "text/plain": [ - "8" + "15" ] }, - "execution_count": 3, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -654,7 +654,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", - "version": "2.7.10" + "version": "2.7.11" } }, "nbformat": 4, diff --git a/tests/examples/null_policy_alphanumeric.las b/tests/examples/null_policy_alphanumeric.las new file mode 100644 index 00000000..ee640c2b --- /dev/null +++ b/tests/examples/null_policy_alphanumeric.las @@ -0,0 +1,35 @@ +~VERSION INFORMATION + VERS. 1.2: CWLS LOG ASCII STANDARD -VERSION 1.2 + WRAP. NO: ONE LINE PER DEPTH STEP +~WELL INFORMATION BLOCK + 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 + 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 +~PARAMETER INFORMATION +~Other +~A DEPTH DT RHOB NPHI SFLU SFLA +1.000 -999.25 -9999 0.450 123.450 1 +2.000 -999.25 -9999 0.460 123.460 2 +3.000 1 -9999 0.47 123.45 3 +4.000 2 3 0.48 123.46 4 +5.000 #N/A 4 231.2 123.45 5 +6.000 4 1.#INF 231.2 1 6 +7.000 5 6 231.2 1 7 +8.000 6 7 231.2 1 1.#IND +9.000 6 32767 -1.#IO -999.25 9 diff --git a/tests/examples/null_policy_numeric.las b/tests/examples/null_policy_numeric.las new file mode 100644 index 00000000..aeab9832 --- /dev/null +++ b/tests/examples/null_policy_numeric.las @@ -0,0 +1,35 @@ +~VERSION INFORMATION + VERS. 1.2: CWLS LOG ASCII STANDARD -VERSION 1.2 + WRAP. NO: ONE LINE PER DEPTH STEP +~WELL INFORMATION BLOCK + 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 + 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 +~PARAMETER INFORMATION +~Other +~A DEPTH DT RHOB NPHI SFLU SFLA +1.000 -999.25 -9999 0.450 123.450 1 +2.000 -999.25 -9999 0.460 123.460 2 +3.000 1 -9999 0.47 123.45 3 +4.000 2 3 0.48 123.46 4 +5.000 3 4 231.2 123.45 5 +6.000 4 5 231.2 1 6 +7.000 5 6 231.2 1 7 +8.000 6 7 231.2 1 8 +9.000 6 32767 231.2 -999.25 9 diff --git a/tests/examples/null_subs.las b/tests/examples/null_subs.las deleted file mode 100644 index 765b6968..00000000 --- a/tests/examples/null_subs.las +++ /dev/null @@ -1,46 +0,0 @@ -~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 -999.25 2550.000 0.450 123.450 123.450 110.200 105.600 -1669.875 -999.25 2550.000 0.450 123.450 123.450 110.200 105.600 -1669.750 123.450 2550.000 0.450 123.450 -999.25 110.200 105.600 diff --git a/tests/test_read.py b/tests/test_read.py index 5abf8266..a0bc7393 100644 --- a/tests/test_read.py +++ b/tests/test_read.py @@ -2,7 +2,7 @@ import fnmatch -import numpy +import numpy as np import pytest from lasio import read @@ -13,6 +13,8 @@ stegfn = lambda vers, fn: os.path.join( os.path.dirname(__file__), "examples", vers, fn) +NaN = np.nan + def test_read_v12_sample(): l = read(stegfn("1.2", "sample.las")) @@ -80,17 +82,48 @@ def test_mnemonic_missing_multiple(): assert [c.mnemonic for c in l.curves] == [ "DEPT", "DT", "RHOB", "NPHI", "UNKNOWN:1", "UNKNOWN:2", "ILM", "ILD"] -def test_null_subs_default(): - l = read(egfn("null_subs.las")) - assert numpy.isnan(l['DT'][0]) - -def test_null_subs_True(): - l = read(egfn("null_subs.las"), null_subs=True) - assert numpy.isnan(l['DT'][0]) - -def test_null_subs_False(): - l = read(egfn("null_subs.las"), null_subs=False) - assert l['DT'][0] == -999.25 +# ~A DEPTH DT RHOB NPHI SFLU SFLA +# 1.000 -999.25 -9999 0.450 123.450 1 +# 2.000 -999.25 -9999 0.460 123.460 2 +# 3.000 1 -9999 0.47 123.45 3 +# 4.000 2 3 0.48 123.46 4 +# 5.000 3 4 231.2 123.45 5 +# 6.000 4 5 231.2 1 6 +# 7.000 5 6 231.2 1 7 +# 8.000 6 7 231.2 1 8 +# 9.000 6 32767 231.2 -999.25 9 + +def test_null_policy_numeric_None(): + l = read(egfn("null_policy_numeric.las"), null_policy=None) + assert np.all(l['DT'] == [-999.25, -999.25, 1, 2, 3, 4, 5, 6, 6]) + assert np.all(l['RHOB'] == [-9999, -9999, -9999, 3, 4, 5, 6, 7, 32767]) + assert np.all(l['NPHI'] == [.45, .46, .47, .48, 231.2, 231.2, 231.2, 231.2, 231.2]) + assert np.all(l['SFLU'] == [123.45, 123.46, 123.45, 123.46, 123.45, 1, 1, 1, -999.25]) + assert np.all(l['SFLA'] == [1, 2, 3, 4, 5, 6, 7, 8, 9]) + +def test_null_policy_numeric_NULL(): + l = read(egfn("null_policy_numeric.las"), null_policy='NULL') + assert np.all(np.isnan(l['DT']) == [True, True, False, False, False, False, False, False, False]) + assert np.isfinite(l['RHOB']).all() + assert np.isfinite(l['NPHI']).all() + assert np.all(np.isnan(l['SFLU']) == [False, False, False, False, False, False, False, False, True]) + assert np.isfinite(l['SFLA']).all() + +def test_null_policy_numeric_common(): + l = read(egfn("null_policy_numeric.las"), null_policy='common') + assert np.all(np.isnan(l['DT']) == [True, True, False, False, False, False, False, False, False]) + assert np.all(np.isnan(l['RHOB']) == [True, True, True, False, False, False, False, False, True]) + assert np.isfinite(l['NPHI']).all() + assert np.all(np.isnan(l['SFLU']) == [False, False, False, False, False, False, False, False, True]) + assert np.isfinite(l['SFLA']).all() + +def test_null_policy_numeric_aggressive(): + l = read(egfn("null_policy_numeric.las"), null_policy='aggressive') + assert np.all(np.isnan(l['DT']) == [True, True, False, False, False, False, False, True, True]) + assert np.all(np.isnan(l['RHOB']) == [True, True, True, False, False, False, False, False, True]) + assert np.all(np.isnan(l['NPHI']) == [False, False, False, False, True, True, True, True, True]) + assert np.all(np.isnan(l['SFLU']) == [False, False, False, False, False, True, True, True, True]) + assert np.isfinite(l['SFLA']).all() def test_multi_curve_mnemonics(): l = read(egfn('sample_issue105_a.las')) diff --git a/tests/test_wrapped.py b/tests/test_wrapped.py index 0d8fea64..f24ab81c 100644 --- a/tests/test_wrapped.py +++ b/tests/test_wrapped.py @@ -13,7 +13,7 @@ def test_wrapped(): def test_write_wrapped(): fn = stegfn("1.2", "sample_wrapped.las") - l = read(fn) + l = read(fn, null_policy='NULL') s = StringIO() l.write(s, version=2.0, wrap=True, fmt="%.5f") s.seek(0) @@ -108,7 +108,7 @@ def test_write_wrapped(): def test_write_unwrapped(): fn = stegfn("1.2", "sample_wrapped.las") - l = read(fn) + l = read(fn, null_policy='NULL') s = StringIO() l.write(s, version=2, wrap=False, fmt="%.5f") s.seek(0)