---
layout: post
title: ITS-90 temperature scale
tags: [oce,R]
category: R
year: 2015
month: 5
day: 10
summary: Oce will soon be getting functions to convert between the IPTS-68 and ITS-90 temperature scales. This posting investigates how much difference this might make in practical work.
---

# Introduction

Recently, oce has been gaining flexibility in terms of conductivities stored in
data files. This is necessitated by the fact that RBR files store conductivity
in mS/cm, whereas calculations for seawater properties use the unitless
conductivity ratio.  With the CTD code under examination for this work, it
might make sense to also handle temperatures stored in files. The two choices
for that seem to be the IPTS-68 and ITS-90 conventions [1,2], and a natural
question is whether using ITS-90 temperatures in formula designed for IPTS-68
will yield errors of practical significance.

# Functions
The following are functions for the conversion, as suggested in [1].
```{r}
T90toT68 <- function(T90) 1.00024 * T90
T68toT90 <- function(T68) T68 / 1.00024
```

# Test of inferred density

First, define some base quantities
```{r,results="hide",message=FALSE}
library(oce)
S <- 35
T90 <- 20
p <- 100
```
and then do some calculations, e.g.
```{r}
T90toT68(T90)
```
This temperature difference, `r abs(T90-T90toT68(T90))`, is several
times larger than the 
SBE911plus initial accuracy of 0.001 C as stated at [3]. (It is about double the stated
stability over a year of drift.)

Another test is of density:

```{r}
swRho(S, T90, p) # incorrect
swRho(S, T90toT68(T90), p)
```

Finally, the following tests the amount that salinity would need to be adjusted to 
compensate (in density terms) for a temperature misapplication.
```{r}
rho0 <- swRho(S, T90toT68(T90), p)
uniroot(function(S) swRho(S, T90, p) - rho0, lower=34, upper=36)$root
```
In a practical application, one might compare this salinity difference,
`r S-uniroot(function(S) swRho(S, T90, p) - rho0, lower=34, upper=36)$root`,
with expected inaccuracies in measurement, or perhaps with the inter-sample "noise".


# References and resources

1. [Seabird Electronics application note on temperature conversion](http://www.seabird.com/sites/default/files/documents/appnote42Feb14.pdf)

2. [Saunders 1990](http://www.nodc.noaa.gov/woce/wdiu/wocedocs/newsltr/news10/news10.pdf)
article on IPTS-68 to ITS-90 conversion, in WOCE newsletter Sept 1990 number 10, page 10.

3. [Seabird Electronics SBE911plus specifications](http://www.seabird.com//sbe911plus-ctd)

4. [Oce website](https://dankelley.github.io/oce/)   

5. Jekyll source code for this blog entry: [2015-05-10-ITS90-temperature-scale.Rmd](https://raw.github.com/dankelley/dankelley.github.io/master/assets/2015-05-10-ITS90-temperature-scale.Rmd)

