Published
Edited
Dec 6, 2020
2 forks
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
curves_to_skip = [{
///// Curves included as an array of strings are onlythat will be plotted. If empty, will plot everything.
"only_curves_to_include_if_present":[], // @lperozzi "BS","GR","RHOB","CALI","RS"
///// If the array above is empty, all curves will be plotted except for the ones below.["Depth","Dep","UWI"]
"curves_to_skip_if_present":["DEPT","DEP","DEPTH","CAL_Y","CAL_Y","CAL_X"],
}]
Insert cell
Insert cell
prebuilt_minimal_styles_by_curvename = [{
//// Add your own curvenames and map them to a style, then define the style in second part of JSON.
"mapping_curvename_to_stylename":{
"GR":"GammaRay",
"GR1":"GammaRay",
"GAM(NAT)":"GammaRay",
"Gamma-ray":"GammaRay",
"Caliper":"Caliper",
"Cal":"Caliper",
"CALI":"Caliper",
"ILD":"Resititivity_1",
"ild":"Resititivity_1",
"RESD":"Resititivity_1",
"RES":"Resititivity_1",
"Res":"Resititivity_1",
"RHOB":"Caliper",
"BS":"BS"
},
"styles":{
"GammaRay":{
"line_color":"green",
"fill":"yes",
"fill_direction":"right",
"cutoffs":[0,ShaleSiltCutOff,SiltSandCutOff],
"fill_colors":["yellow","orange","gray"]
},
"Resititivity_1":{
"line_color":"red",
"fill":"yes",
"fill_direction":"left",
"cutoffs":[5,10,25],
"fill_colors":["#ffe6e6","#ffb3b3","red"]
},
"Caliper":{
"line_color":"purple",
"fill":"yes",
"fill_direction":caliper_fill_direction,
"cutoffs":[0],
"fill_colors":["#dbdbdb"]
},
"BS":{
"line_color":"purple",
"fill":"yes",
"fill_direction":caliper_fill_direction,
"cutoffs":[9],
"fill_colors":["purple"]
},
"all_others":{
"line_color":"black",
"fill":"yes",
"fill_direction":"left",
"cutoffs":[0],
"fill_colors":["gray"]
}
}
}]
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
string_of_well_uploaded_from_local_computer = "YOU NEED TO SWITCH OUT WHICH LINE IS COMMENTED OUT, BELOW UNDER LOAD OPTION 2, BEFORE THIS WILL WORK"
// string_of_well_uploaded_from_local_computer = await string_of_well_uploaded_from_local_computer_file.text()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
well_in_json_format_0 = checkIfString(selected_well_as_string)
Insert cell
function handleNullsForD3(well_in_json_format_01,null_str){
var well_in_json_format_new = JSON.parse(JSON.stringify( well_in_json_format_01 ));
var curve_names = Object.keys(well_in_json_format_new["CURVES"])
for (var i = 0; i < curve_names.length; i++) {
var curve_data = well_in_json_format_new["CURVES"][curve_names[i]]
function replaceNulls(data_str){
return data_str.replace(null_str,0)
}
well_in_json_format_new["CURVES"][curve_names[i]] = curve_data.map(replaceNulls)
}
return well_in_json_format_new
}
Insert cell
well_in_json_format = handleNullsForD3(well_in_json_format_0,value_for_nulls)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function findDepthName(well_log_in_json){
var curve_names_array = Object.keys(well_log_in_json.CURVES)
var dep = curve_names_array.find(a =>a.includes("dep"));
var Dep = curve_names_array.find(a =>a.includes("Dep"));
var DEP = curve_names_array.find(a =>a.includes("DEP"));
if(dep){return dep}
if(Dep){return Dep}
if(DEP){return DEP}
else{return "couldn't find depth curve name"}
}
Insert cell
depth_curve_name = findDepthName(well_in_json_format)
Insert cell
three_things_2 = wellioviz.fromJSONofWEllGetThingsForPlotting(well_in_json_format,depth_curve_name)
Insert cell
Insert cell
Insert cell
Insert cell
well_log_curves_reformatted_for_d3_2 = three_things_2["well_log_curves_reformatted_for_d3"]
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
height_multiplier_components
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more