Skip to content

Commit

Permalink
Merge pull request #53 from melissalinkert/well-indexing
Browse files Browse the repository at this point in the history
Use well row_index and column_index if available
  • Loading branch information
chris-allan authored Mar 24, 2021
2 parents ba224d7 + 87f7e29 commit e047019
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -379,13 +379,22 @@ private void populateMetadata() throws IOException {
int wsIndex = 0;
for (int i=0; i<wells.size(); i++) {
String well = (String) wells.get(i).get("path");
Integer rowIndex = (Integer) wells.get(i).get("row_index");
Integer colIndex = (Integer) wells.get(i).get("column_index");
String[] path = well.split("/");

if (rowIndex == null) {
LOG.warn("Well {} row_index missing; attempting to calculate", i);
rowIndex = rowLookup.get(path[path.length - 2]);
}
if (colIndex == null) {
LOG.warn("Well {} column_index missing; attempting to calculate", i);
colIndex = colLookup.get(path[path.length - 1]);
}

metadata.setWellID(MetadataTools.createLSID("Well", 0, i), 0, i);
metadata.setWellColumn(
new NonNegativeInteger(colLookup.get(path[path.length - 1])), 0, i);
metadata.setWellRow(
new NonNegativeInteger(rowLookup.get(path[path.length - 2])), 0, i);
metadata.setWellColumn(new NonNegativeInteger(colIndex), 0, i);
metadata.setWellRow(new NonNegativeInteger(rowIndex), 0, i);

ZarrGroup wellGroup = getZarrGroup(well);

Expand Down

0 comments on commit e047019

Please sign in to comment.