Skip to content

Add Unit NTU (Turbidity) #825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rgomez90 opened this issue Aug 18, 2020 · 3 comments · Fixed by #842
Closed

Add Unit NTU (Turbidity) #825

rgomez90 opened this issue Aug 18, 2020 · 3 comments · Fixed by #842

Comments

@rgomez90
Copy link
Contributor

rgomez90 commented Aug 18, 2020

Is your feature request related to a problem? Please describe.
Add new Quantity => Turbidity + Unit => [NTU]

Describe the solution you'd like
New Quantity Turbidity with unit NTU

Additional context
I already implemented this in my fork and could build/generate custom code without issues.

But since NTU is not an SI unit, I would like to ask if I should make a PR for this, i.e. add the quantity to the library, instead of creating my own copy.

This is the json for Turbidity

{
  "Name": "Turbidity",
  "BaseUnit": "NTU",
  "XmlDoc": "Turbidity is the cloudiness or haziness of a fluid caused by large numbers of individual particles that are generally invisible to the naked eye, similar to smoke in air. The measurement of turbidity is a key test of water quality.",
  "XmlDocRemarks": "https://en.wikipedia.org/wiki/Turbidity",
  "BaseDimensions": {
    "M": 0,
    "T": 0,
    "I": 0
  },
  "Units": [
    {
      "SingularName": "NTU",
      "PluralName": "NTU",
      "FromUnitToBaseFunc": "x",
      "FromBaseToUnitFunc": "x",
      "Localization": [
        {
          "Culture": "en-US",
          "Abbreviations": ["NTU"]
        }
      ]
    }
  ]
}

My question is about BaseDimensions...Due NTU not being SI, there are no BaseDimensions for it. Can I do like this and set all to 0?

If OK, then I would make a PR for this.

@angularsen
Copy link
Owner

Base dimensions default to 0 so you can simply remove the entire BaseDimensions field.

  1. Should the singular/plural names be NTU or NephelometricTurbidityUnit/...Units?

For example, should we in code type var x = Turbidity.FromNTU(10) or var x = Turbidity.FromNephelometricTurbidityUnits(10)? The name is really long, so I can understand if the short hand is preferred.

  1. Are there other units of turbidity to consider adding? I couldn't immediately find any, but related measurements are mentioned like NTU, FNU, FTU, FAU, and JTU

  2. Are there conversions from Turbidity to say Mass or Volume or other quantities that it would make sense to add? Something like Turbidity / Volume = Mass or similar.

The reason I ask is that there is more value in adding this quantity if it allows us to convert between units or quantities.

@rgomez90
Copy link
Contributor Author

rgomez90 commented Aug 20, 2020

Turbidity units are very "special" units. They have no conversion between each other, since they base on a calibrated solution liquuid and the equipment used to measure. So depending on how you measure, you use an unit or other.

Nowadays the most (or close to only) used method is the one of NTU. So I think just implementing NTU should be ok.

This 'old' text explains it.

  1. 'NTU' and singular should be used => see this

  2. Could be added if desired, but they have close to no use nowadays. (Maybe another way could be, due the "specialness" of this units, to see each one (JTU,NTU,FTU, etc.) as a quantity with only one unit. So we would have TurbidityNTU (with NTU as single unit), TurbidityFTU (with FTU as single unit) etc...

  3. AFAIK there are, I only ever have heared one NTU => mg/l => ppm [based on 1mg/l =1 ppm], with 3NTU = 1ppm = 1mg/l, but I am not a specialist, so finding more, if any, would need some research (which I would do if needed).

This unit is often used in water quality measurements. I think the value of the quantity is high (you could use in for example in IOT) and the conversion to ppm adds way more value to it.

I work as an engineer in a industrial sensors manufacturer (mainly sensors for food and pharma industry) and for example all our Turbidity sensors use this quantity as output quantity.
(Also my use case here, since I am programming a calibration system for this type of transmitters).

A lot of other manufacturers use also the same unit. which as said, implies the same type of measurement, in their transmitters.

@angularsen
Copy link
Owner

Thank you for clarifying.

  1. Perfect
  2. Based on your description, I don't we should add JTU,FTU etc.
  3. We try to avoid bloat by only adding stuff that will actually be used by someone. We can hold off on this.

I am convinced that adding this quantity, even without conversions, does have some value. Mostly because it is so widely used.

Please go ahead with creating a pull request, I will be happy to assist if you have any questions.
https://github.com/angularsen/UnitsNet/wiki/Adding-a-New-Unit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants