-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #102 from nathangeology/development
Development
- Loading branch information
Showing
42 changed files
with
9,502 additions
and
1,524 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
class BaseTemplate { | ||
constructor(params={}) { | ||
this.handle_params(params) | ||
} | ||
|
||
handle_params(params) { | ||
for (const [key, value] in Object.entries(params)){ | ||
this[key] = value | ||
} | ||
return this | ||
} | ||
|
||
start_draw(div_id){ | ||
let d3 = module.exports.d3; | ||
let noDIV = d3.select("#" + div_id).selectAll("div").remove(); | ||
let noSVG = d3.select("#" + div_id).selectAll("svg").remove(); | ||
return d3 | ||
} | ||
} | ||
module.exports = BaseTemplate |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const BaseTemplate = require("../base_template") | ||
|
||
class CurveFillTemplate extends BaseTemplate{ | ||
constructor(params={}) { | ||
super(); | ||
this.curve_name = "default" | ||
this.fill = "no" | ||
this.fill_direction = "left" | ||
this.cutoffs = Array(0) // TODO should take values OR curve names | ||
this.fill_colors = Array(0) | ||
//Update template based on passed params | ||
this.handle_params(params) | ||
} | ||
} | ||
module.exports = CurveFillTemplate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const LogCurveTemplate = require("./log_curve_template") | ||
|
||
class CAL extends LogCurveTemplate { | ||
constructor(params={}) { | ||
super(params); | ||
this.curve_name = "CAL" | ||
this.units = "cm" | ||
this.stroke_type = "dash" // TODO Warning! This might not be a thing haha | ||
this.handle_params(params) | ||
} | ||
} | ||
module.exports = CAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const LogCurveTemplate = require("./log_curve_template") | ||
|
||
class GR extends LogCurveTemplate { | ||
constructor(params={}) { | ||
super(params); | ||
this.curve_name = "GR" | ||
// this.fill = null // TODO: GR Fill | ||
this.units = "API" | ||
this.handle_params(params) | ||
} | ||
} | ||
module.exports = GR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Base sort of abstract template, specialized templates can override pieces of this | ||
const fill_template = require('../fill_templates/curve_fill_template'); | ||
const BaseTemplate = require("../base_template") | ||
|
||
class LogCurveTemplate extends BaseTemplate { | ||
// const obj = {} | ||
// Define Default Settings Values | ||
constructor(params={}) { | ||
super(); | ||
this.curve_name = "default" | ||
this.color = "black" | ||
this.stroke_type = "solid" | ||
this.stroke_linecap = "butt" | ||
this.stroke_width = 1.0 | ||
this.stroke_transparency = 1.0 | ||
this.fill = new fill_template() | ||
this.units = "unkn" | ||
this.depth_limits = {"min": "autocalculate", "max": "autocalculate"} | ||
this.curve_limits = {"min": -100000, "max":3} // TODO: This needs to be looked at more | ||
this.data = Array(0) | ||
this.data_id = "" | ||
this.well_name = "default" | ||
this.uwi14 = "00000000000000" | ||
this.isLinear = true // false sets to a log scale | ||
this.depth_type = "MD" | ||
this.depth_units = "meter" | ||
// Define Template Functions | ||
// TODO: decide if null are handled here or at load validation | ||
//Update template based on passed params | ||
this.handle_params(params) | ||
} | ||
// Simple function to set the data that is associated with this curve | ||
define_data(data) { | ||
// Add data to a template | ||
// TODO: Validation step here?? | ||
this.data = data | ||
return this | ||
} | ||
// Function change the target curve name and data for the instance of curve template | ||
set_curve_and_data(curve_name, data, params={}){ | ||
this.define_data(data) | ||
this.curve_name = curve_name | ||
//Update template based on passed params | ||
this.handle_params(params) | ||
return this | ||
} | ||
|
||
} | ||
|
||
module.exports = LogCurveTemplate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// let wellio = require('wellio') | ||
// let TripleCombo = require("./well_log_templates/triple_combo_template") | ||
|
||
async function plot_triple_combo_log(div_id, url="./static/00-01-11-082-23W4-0.LAS") { | ||
let ShaleSiltCutOff = 80 | ||
let SiltSandCutOff = 55 | ||
// var fileUrltoWellLog = "https://gist.githubusercontent.com/JustinGOSSES/2685e588d5c2f2a0ba1591ec7b9c9421/raw/415fe8a2f27dc7621f06f60ffd40a62c0d55a0f0/00-01-01-095-19W4-0.las" | ||
var fetched = await fetch(url) | ||
var well_as_string = await fetched.text() | ||
var well = las2json(well_as_string) | ||
// let depth_curve_name = well['CURVE INFORMATION BLOCK'] | ||
var test = new TrackTemplate() | ||
var log = new TripleCombo() | ||
log.load_log(well) | ||
console.log('here') | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const fill_template = require('../fill_templates/curve_fill_template'); | ||
|
||
test('default fill curve template curve_name is a property', () => { | ||
expect(new fill_template()).toHaveProperty("curve_name") | ||
}) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const log_curve_template = require('../log_style_templates/log_curve_template'); | ||
let test_curve_data_1 = [ | ||
{'Depth': 0.0, 'Default': 1.0}, | ||
{'Depth': 1.0, 'Default': 0.0}, | ||
{'Depth': 2.0, 'Default': 1.0}, | ||
{'Depth': 4.0, 'Default': 2.0}, | ||
] | ||
|
||
let test_curve_data_2 = [ | ||
{'Depth': 1.0, 'RHOB': 1.0}, | ||
{'Depth': 2.0, 'RHOB': 0.0}, | ||
{'Depth': 3.0, 'RHOB': 1.0}, | ||
{'Depth': 4.0, 'RHOB': 2.0}, | ||
] | ||
|
||
test('default log curve template name is a property', () => { | ||
expect(new log_curve_template()).toHaveProperty("curve_name") | ||
}) | ||
|
||
|
||
test('test define data function', () => { | ||
expect(new log_curve_template().define_data(test_curve_data_1).data[0]['Depth']).toBeLessThan(0.5) | ||
}) | ||
|
||
test('test define curve and data function', () => { | ||
expect(new log_curve_template().set_curve_and_data( | ||
'RHOB', test_curve_data_2).data[0]['Depth']).toBeGreaterThan(0.5) | ||
}) |
Oops, something went wrong.