Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@hillarymarler
Copy link
Collaborator

Updates to result unit conversion and synonym harmonization to address the issues described by MT.

Here are the issues they described (that are addressed in this PR):
Issue 1: Harmonization of Naming Convention for Dissolved Oxygen and pH – Sample Fraction

When applying the TADA_HarmonizeSynonyms() function, the sample fraction for dissolved oxygen (DO) is not being harmonized correctly. The harmonization reference table provided by EPATADA attempts to convert the Result Sample Fraction Text for all DO samples to “NA”. This is explained in the 'TADA.ResultSampleFractionTextAssumptions' column of the reference table which states for DO, “Assumes fraction is NA for DISSOLVED OXYGEN (DO) and DISSOLVED OXYGEN SATURATION. Harmonizing to NA.”

Now the fraction for DO harmonizes to NONE

Issue 2: Harmonization of Naming Convention for Dissolved Oxygen – Speciation
The harmonization table provided by EPATADA attempts to convert the Method Speciation Name for all DO samples to “NA”. This is explained in the ‘TADA.SpecationAssumptions’ column which states for DO, “Assumes speciation is NA for DISSOLVED OXYGEN (DO) and DISSOLVED OXYGEN SATURATION. Harmonizing to NA.”

Now the fraction for DO harmonizes to NONE

Issue 3: Harmonization of Units for pH

When pH data exist in the data set, after creating a unit conversion reference file for my data set, all units associated with pH do not show up in the reference file.

pH results now harmonize correctly as std units has been added to the reference files

updates to handle USGS results separately to prevent issues w/ speciation
fixed join bug for usgs unit ref
fix usgs data bug
joining bug fix for joinUSGSother
detection limit bug fix
det limit conversion bug fix
edit comments for internal functions, fix issues with checking for usgs and other results
remove int objects
fix setNull internal function
more work on setNull
fixes in transform section
remove test files from .gitignore
@hillarymarler
Copy link
Collaborator Author

I should be able to work through the check issues tomorrow, @wokenny13 and @cristinamullin. They are related to conversion of depth units, so maybe something I changed in a ref file caused a problem? I'll start there with troubleshooting.

add missing rows to final .data
@cristinamullin
Copy link
Collaborator

cristinamullin commented Jul 25, 2025

Do you think our target for PH should be "PH_NONE_NONE_STD UNITS" or "PH_NONE_NONE_NONE"? It looks like we are going with the latter here which works just fine.

"DISSOLVED OXYGEN (DO)NONE_NONE_MG/L" looks good for that one. I updated the harmonization ref to use NONE for DO SAT as well: target is now "DISSOLVED OXYGEN SATURATION_NONE_NONE%". I also fixed some issues with the TURBILITY harmonization while reviewing.

I added NU to the unit conversion table as well since it is valid in WQX. I don't see STD UNITS here, but see STD********* (rejected value), have you run into anything like that?

Domain Characteristic Search Status Source Value Unit Minimum Maximum Conversion Factor Conversion Coefficient Last Change
CharacteristicUnit PH Rejected SOIL STD********* NONE 0 14 1 0 ########
CharacteristicUnit PH Rejected WATER MOLE/L MOLE/L -999999 999999 1 0 ########
CharacteristicUnit PH Rejected WATER #/L #/100ML -999999 999999 0.1 0 ########
CharacteristicUnit PH Rejected WATER % % -999999 999999 1 0 ########
CharacteristicUnit PH Rejected AIR ADMI VALUE ADMI VALUE -999999 999999 1 0 ########
CharacteristicUnit PH Rejected WATER COUNT COUNT -999999 999999 1 0 ########
CharacteristicUnit PH Rejected WATER DEG C DEG C -999999 999999 1 0 ########
CharacteristicUnit PH Rejected WATER FT IN -999999 999999 12 0 ########
CharacteristicUnit PH Rejected WATER IN IN -999999 999999 1 0 ########
CharacteristicUnit PH Rejected AIR KGAL M3 -999999 999999 3.785412 0 ########
CharacteristicUnit PH Rejected WATER KGAL M3 -999999 999999 3.785412 0 ########
CharacteristicUnit PH Rejected WATER M IN -999999 999999 39.370079 0 ########
CharacteristicUnit PH Rejected WATER MOLAR MOLE/L -999999 999999 1 0 ########
CharacteristicUnit PH Rejected WATER #/100 GAL #/100ML -999999 999999 0.0002642 0 ########
CharacteristicUnit PH Rejected WATER 0/00 NONE 0 14 1 0 ########
CharacteristicUnit PH Rejected WATER MG/L UG/L -999999 999999 1000 0 ########
CharacteristicUnit PH Rejected WATER US/CM US/CM -999999 999999 1 0 ########
CharacteristicUnit PH Rejected WATER MS/CM US/CM -999999 999999 1000 0 ########
CharacteristicUnit PH Rejected WATER VOLTS VOLTS -999999 999999 1 0 ########
CharacteristicUnit PH Rejected WATER PPM UG/KG -999999 999999 1000 0 ########
CharacteristicUnit PH Rejected WATER NG G -999999 999999 1E-09 0 ########
CharacteristicUnit PH Rejected SEDIMENT MG/KG UG/KG -999999 999999 1 0 ########
CharacteristicUnit PH Rejected WATER DAYS MINUTES -999999 999999 1440 0 ########
CharacteristicUnit PH Rejected AIR DAYS MINUTES -999999 999999 1440 0 ########
CharacteristicUnit PH Rejected AIR NG G -999999 999999 1E-09 0 ########
CharacteristicUnit PH Rejected WATER ADMI VALUE ADMI VALUE -999999 999999 1 0 ########
CharacteristicUnit PH Rejected WATER NORMAL MG/L -999999 999999 1000 0 ########
CharacteristicUnit PH Rejected WATER NTU NTU -999999 999999 1 0 ########
CharacteristicUnit PH Rejected WATER UNITS/CM UNITS/CM -999999 999999 1 0 ########
CharacteristicUnit PH Rejected WATER UG/L UG/L -999999 999999 1 0 ########
CharacteristicUnit PH Rejected SEDIMENT UG/L UG/L -999999 999999 1 0 ########
CharacteristicUnit PH Rejected WATER S/M US/CM -999999 999999 10000 0 ########
CharacteristicUnit PH Rejected WATER PPT UG/KG -999999 999999 0.001 0 ########
CharacteristicUnit PH Rejected WATER MV VOLTS -999999 999999 0.001 0 ########
CharacteristicUnit PH Rejected SOIL S/M US/CM -999999 999999 10000 0 ########
CharacteristicUnit PH Accepted AIR NONE NONE 0 14 1 0 ########
CharacteristicUnit PH Accepted TISSUE NONE NONE 0 14 1 0 ########
CharacteristicUnit PH Accepted BIOLOGICAL NONE NONE 0 14 1 0 ########
CharacteristicUnit PH Accepted SEDIMENT NONE NONE 0 14 1 0 ########
CharacteristicUnit PH Accepted OTHER NU NONE 0 14 1 0 ########
CharacteristicUnit PH Accepted AIR NU NONE 0 14 1 0 ########
CharacteristicUnit PH Accepted SOIL NONE NONE 0 14 1 0 ########
CharacteristicUnit PH Accepted WATER NONE NONE 0 14 1 0 ########
CharacteristicUnit PH Accepted WATER NU NONE 0 14 1 0 ########
CharacteristicUnit PH Accepted OTHER NONE NONE 0 14 1 0 ########
CharacteristicUnit PH Accepted SOIL NU NONE 0 14 1 0 ########
CharacteristicUnit PH Accepted SEDIMENT NU NONE 0 14 1 0 ########
CharacteristicUnit PH Accepted HABITAT NONE NONE 0 14 1 0 ########
CharacteristicUnit PH Accepted HABITAT NU NONE 0 14 1 0 ########
0 5/14/2024 17:02


# Change NONE in unit, fraction, and speciation to NA for better harmonization
# Changes NONE in fraction and speciation to NA for better harmonization
# Should this be specified in the template instead? 7/25/25 cm
Copy link
Collaborator

@cristinamullin cristinamullin Jul 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TADA_HarmonizeSynonyms was still changing NONE back to NA for PH units. Removed this line here so it is now resolving to
"PH_NONE_NONE_NONE"

The functions still changes NONE in fraction and speciation to NA for better harmonization as a generalized solution. For pH and DO, NONE is specified in the template so that overrides the generalized solution for those two. Does that still make sense as a generalized solution for all others not specified in the harmonization template... or should these lines be removed and everything done in the template (lots more rows we would need to add...)?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hillarymarler this has already been merged, but can you double check the logic?

@cristinamullin cristinamullin merged commit 7a90b4e into develop Jul 28, 2025
7 checks passed
@cristinamullin cristinamullin deleted the MT_troubleshooting branch July 28, 2025 18:24
@cristinamullin
Copy link
Collaborator

Note that STD********* unit has this note from the WQX team: DO NOT USE, Quantity, Standard Unitretireduse None"

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TADA_SimpleCensoredMethods does not deal with certain TADA.CensoredData.Flags correctly

3 participants