Skip to main content

D17Oscaling

Perform two-point normalization of triple oxygen isotope measurements based on two or more reference materials with sufficiently different δ18O values.

The normalization applies two affine transformations:

  • δ18Onew = a18 ∙ δ18Oold + b18
  • δ17Onew = a17 ∙ δ17Oold + b17

Provided with (1) a set of measurements of one or more unknown samples, with uncertainties; (2) a set of measurement of two or more known reference materials, with uncertaines; (3) nominal (δ18O, Δ17O) values for the reference materials, D17Oscaling computes the normalized (δ18O, Δ17O) values for all unknown samples and the variance-covariance matrix describing the (correlated) uncertainties of these normalized values.

D17Oscaling is also capable of processing a list of “raw” individual (δ18O, Δ17O) analyses, compute the average composition of each sample and assign uncertainties to these average compositions based on the pooled variances of all δ18O and all Δ17O measurements, respectively.

Usage

First import D17Oscaling and define some reference materials:

from D17Oscaling import DataSet

RM = {
	'VSMOW': {'d18O': 0., 'D17O': 0.},
	'SLAP': {'d18O': -55.5, 'D17O': 0.},
}

Then create a DataSet() object, import some analytical data and print out what the DataSet looks like now:

# create DataSet() instance
data = DataSet()

# import some analytical data;
data.import_analyses(
	'examples/data.csv',
	columns = {
		'd18O': 'd18O_raw',
		'D17O': 'D17O_raw'
	},
)
# `columns` renames columns to 'd18O_raw' and 'D17O_raw',
# meaning that these values are not yet normalized.

# take a look
print(data)

down arrow

This should look like this.

  • The raw data we just imported is stored as a pandas.DataFrame in data.analyses.
  • The pooled standard deviantion of d18O_raw and D17O_raw for this dataset is stored as data.SD_d18O_raw and data.SD_D17O_raw.
  • The mean raw values for each analyte were automatically computed, with uncertainties derived from SD_d18O_raw, SD_D17O_raw, and the number of replicate analyses for each analyte. These mean values are saved as uncertainties.UFloat values in a pandas.DataFrame stored as data.analytes.
DataSet(
  [analyses] =
        UID Analyte   d18O_raw  D17O_raw
    0   X01     FOO -12.532655 -0.098675
    1   X02     BAR  -7.879440  0.097711
    2   X03     BAZ -50.274837 -0.126091
    3   X04   VSMOW  -0.085304  0.004308
    4   X05    SLAP -55.412060  0.021416
    5   X06     FOO -12.467660 -0.108063
    6   X07     BAR  -7.841212  0.088934
    7   X08     BAZ -50.160433 -0.138356
    8   X09   VSMOW   0.046751  0.006160
    9   X10    SLAP -55.585929  0.011290
    10  X11     FOO -12.508564 -0.105138
    11  X12     BAR  -7.943704  0.085655
    12  X13     BAZ -50.185312 -0.138463
    13  X14   VSMOW  -0.004993  0.006506
    14  X15    SLAP -55.518486  0.007433
    15  X16     FOO -12.613532 -0.098567
    16  X17     BAR  -7.725561  0.087401
    17  X18     BAZ -50.288610 -0.127896
    18  X19   VSMOW  -0.042833  0.001167
    19  X20    SLAP -55.535213  0.002187
  [SD_d18O_raw] = 0.07035790333040727
  [SD_D17O_raw] = 0.005786843071251322
  [analytes] =
             N         d18O_raw          D17O_raw
    Analyte
    BAR      4   -7.847+/-0.035   0.0899+/-0.0029
    BAZ      4  -50.227+/-0.035  -0.1327+/-0.0029
    FOO      4  -12.531+/-0.035  -0.1026+/-0.0029
    SLAP     4  -55.513+/-0.035   0.0106+/-0.0029
    VSMOW    4   -0.022+/-0.035   0.0045+/-0.0029
)

We can then normalize data.analytes based on the nominal compositions of the reference materials.

data.normalize(RM)
print(data)

down arrow

As seen below, this adds two columns named d18O and D17O to data.analytes, corresponding to the normalized compositions of each analyte. These values are all uncertainties.UFloat values, so that their correlated uncertainties are all explictly computed and accessible using the methods described in the uncertainties documentation. The parameters a18, b18, a17, and b17 (see equations above) are also stored as uncertainties.UFloat values in data.a18, data.b18, data.a17, and data.b17.

DataSet(
  [analyses] =
        UID Analyte   d18O_raw  D17O_raw
    0   X01     FOO -12.532655 -0.098675
    1   X02     BAR  -7.879440  0.097711
    2   X03     BAZ -50.274837 -0.126091
    3   X04   VSMOW  -0.085304  0.004308
    4   X05    SLAP -55.412060  0.021416
    5   X06     FOO -12.467660 -0.108063
    6   X07     BAR  -7.841212  0.088934
    7   X08     BAZ -50.160433 -0.138356
    8   X09   VSMOW   0.046751  0.006160
    9   X10    SLAP -55.585929  0.011290
    10  X11     FOO -12.508564 -0.105138
    11  X12     BAR  -7.943704  0.085655
    12  X13     BAZ -50.185312 -0.138463
    13  X14   VSMOW  -0.004993  0.006506
    14  X15    SLAP -55.518486  0.007433
    15  X16     FOO -12.613532 -0.098567
    16  X17     BAR  -7.725561  0.087401
    17  X18     BAZ -50.288610 -0.127896
    18  X19   VSMOW  -0.042833  0.001167
    19  X20    SLAP -55.535213  0.002187
  [SD_d18O_raw] = 0.07035790333040727
  [SD_D17O_raw] = 0.005786843071251322
  [analytes] =
             N         d18O_raw          D17O_raw         d17O_raw           d18O             d17O            D17O
    Analyte
    BAR      4   -7.847+/-0.035   0.0899+/-0.0029   -4.062+/-0.019   -7.83+/-0.05   -4.056+/-0.025   0.085+/-0.023
    BAZ      4  -50.227+/-0.035  -0.1327+/-0.0029  -26.971+/-0.019  -50.21+/-0.05  -26.974+/-0.026  -0.143+/-0.026
    FOO      4  -12.531+/-0.035  -0.1026+/-0.0029   -6.738+/-0.019  -12.51+/-0.05   -6.733+/-0.024  -0.109+/-0.022
    SLAP     4  -55.513+/-0.035   0.0106+/-0.0029  -29.695+/-0.019  -55.50+/-0.05  -29.699+/-0.027   0.000+/-0.028
    VSMOW    4   -0.022+/-0.035   0.0045+/-0.0029   -0.007+/-0.019    0.00+/-0.05    0.000+/-0.027   0.000+/-0.027
  [refmaterials] = {'VSMOW': {'d18O': 0.0, 'D17O': 0.0, 'd17O': 0.0}, 'SLAP': {'d18O': -55.5, 'D17O': 0.0, 'd17O': -29.69864899849639}}
  [a18] = 1.0002+/-0.0009
  [b18] = 0.022+/-0.035
  [a17] = 1.0003+/-0.0009
  [b17] = 0.007+/-0.019
)

Alternatively, one may perform the same normalization steps based directly on the analytes table, skipping the computation of d18O_raw and D17O_raw uncertainties (assigning these uncertainties is then solely the user's responsibility).

data = DataSet()
data.import_analytes('examples/analytes.csv')

print(data)

down arrow

DataSet(
  [analytes] =
             N         d18O_raw          D17O_raw
    Analyte
    BAR      4   -7.847+/-0.035   0.0899+/-0.0029
    BAZ      4  -50.227+/-0.035  -0.1327+/-0.0029
    FOO      4  -12.531+/-0.035  -0.1026+/-0.0029
    SLAP     4  -55.513+/-0.035   0.0106+/-0.0029
    VSMOW    4   -0.022+/-0.035   0.0045+/-0.0029
)

And the normalized results are identical to those in the first example:

data.normalize(RM)
print(data)

down arrow

DataSet(
  [analytes] =
             N         d18O_raw          D17O_raw         d17O_raw           d18O             d17O            D17O
    Analyte
    BAR      4   -7.847+/-0.035   0.0899+/-0.0029   -4.061+/-0.019   -7.83+/-0.05   -4.056+/-0.025   0.085+/-0.023
    BAZ      4  -50.227+/-0.035  -0.1327+/-0.0029  -26.971+/-0.019  -50.21+/-0.05  -26.974+/-0.026  -0.143+/-0.025
    FOO      4  -12.531+/-0.035  -0.1026+/-0.0029   -6.738+/-0.019  -12.51+/-0.04   -6.733+/-0.024  -0.108+/-0.022
    SLAP     4  -55.513+/-0.035   0.0106+/-0.0029  -29.695+/-0.019  -55.50+/-0.05  -29.699+/-0.027   0.000+/-0.028
    VSMOW    4   -0.022+/-0.035   0.0045+/-0.0029   -0.007+/-0.019    0.00+/-0.05    0.000+/-0.026   0.000+/-0.026
  [refmaterials] = {'VSMOW': {'d18O': 0.0, 'D17O': 0.0, 'd17O': 0.0}, 'SLAP': {'d18O': -55.5, 'D17O': 0.0, 'd17O': -29.69864899849639}}
  [a18] = 1.0002+/-0.0009
  [b18] = 0.022+/-0.035
  [a17] = 1.0003+/-0.0009
  [b17] = 0.007+/-0.019
)

Metadata

Release files for D17Oscaling 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for D17Oscaling 1.1.0
File Size Uploaded Provenance Actions
d17oscaling-1.1.0.tar.gz 5.3 kB Without provenance Details for d17oscaling-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for D17Oscaling 1.1.0
File Interpreter ABI Platform Actions
d17oscaling-1.1.0-py3-none-any.whl Python 3 none any Details for d17oscaling-1.1.0-py3-none-any.whl

Total release size: 11.5 kB

Release files / d17oscaling-1.1.0.tar.gz

Download URL d17oscaling-1.1.0.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8bbe4f1a1929314a56284582fc122ff0709412e8615b72ebe0ad11b5e11a788e
BLAKE2b-256 checksum
How to use checksums
06b943c1743109727ccfa9261651b5eb61bfd2c964bddb9f8f2df67d6433642a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / d17oscaling-1.1.0-py3-none-any.whl

Download URL d17oscaling-1.1.0-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f6f8dd3f643305498a93f21ee38a9f1b1305223d132d8c0eaa709ba10acad177
BLAKE2b-256 checksum
How to use checksums
6ebdbbc2e17ed51da868024b8110511f3b972f8097e5c101b4956002ed7d1199
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for D17Oscaling 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page