laccore / coretools

PSICAT: Initial Core Description software for Windows and macOS/OSX
https://cse.umn.edu/csd/psicat
Apache License 2.0
14 stars 0 forks source link

Exported tabular data doesn't include scheme:code for old Andrill Interval models #15

Closed sorghumking closed 3 weeks ago

sorghumking commented 3 weeks ago
  1. Dig up an old PSICAT project with only "Intervals" and "Symbols" columns: these correspond to the old (Andrill) Interval and Occurrences models, respectively
  2. Open that project in PSICAT 1.1.0 or later
  3. File > Export > Tabular Data... and choose a single section that has at least one Interval with a lithology selected
  4. Open the exported .xls file in Excel
  5. Notice that there are two 'lithology' columns, but the first contains only the human-readable lithology name, and the second is empty
sorghumking commented 3 weeks ago

This happens because the Interval model is an oddball - its SchemeEntry property is named 'lithology' instead of 'scheme' like all other models. PSICAT uses the scheme's type to name the human-readable name column. For Interval, both the property and scheme type are 'lithology'.

When we write cells in tabular data, we find the column header with the matching name to determine which column to write to. The Interval's 'lithology' property correctly written to a cell in the first 'lithology' column. However, when the human-readable name is written, it also seeks the 'lithology' column (that's the scheme's type). It finds the first 'lithology' column and overwrites the scheme:code with the human-readable name. Dang.