Commit a0cab22a authored by Knut Behrends's avatar Knut Behrends
Browse files

finetune display of depth-values in fake-sample generation

parent 49fae30e
......@@ -42,14 +42,14 @@ module.exports = class CurationSample {
find_top() {
const t = util.round((
this._section.top_depth +
util.frac_below(0.3) * (this._section.section_length * 100) //cm
util.frac_below(0.3) * (this._props.section_length_cm ) //cm
), 1)
this._props.top = t
return t
}
find_interval() {
const sl = this._section.section_length * 100
const sl = this._props.section_length_cm
const minlen = 0.03 * (sl + 1)
let len = 0
......@@ -59,9 +59,9 @@ module.exports = class CurationSample {
} else {
len = sl * util.frac_below(0.2)
}
const i = util.round((minlen + len) ) * 100
this._props.interval= i
return i
const int = util.round((minlen + len), 1)
this._props.interval= int
return int
}
find_analyst() {
return util.shuffle(CoreDefaults.curator).pop()
......@@ -71,7 +71,7 @@ module.exports = class CurationSample {
//return this._props.sample_type
}
find_section_top_mbsf() {
const t = this._section.top_depth + 1000 //faker.fake("{{random.number}}") % 200
const t = util.round(this._section.top_depth/100,0) + 1000 //faker.fake("{{random.number}}") % 200
this._props.section_top_mbsf = t
return t
}
......@@ -101,7 +101,7 @@ module.exports = class CurationSample {
return "AWI"
}
find_volume() {
return this._section.sample_volume
return this._section.sample_volume || 0
}
find_sample_top_mbsf() {
let t = util.round(this.section_top_mbsf + this.top, 1)
......@@ -109,7 +109,7 @@ module.exports = class CurationSample {
return t
}
find_sample_bottom_mbsf() {
return util.round(this.section_top_mbsf + this.top + this.interval, 1)
return util.round(this.section_top_mbsf + this.top + this.interval/100, 1)
}
find_scientist() {
return Array.of(
......
......@@ -222,6 +222,7 @@ Promise.all(queries_map.values())
let request_ids_per_city = util.shuffle(s.requests).slice(-n_picked)
// ~ 5 requests for this split
for (let r of request_ids_per_city) {
let sec_len = sp.section_length ? sp.section_length : util.round(util.frac_above(0.5), 2)
let fake_sample = new CurationSample(
Object.assign({}, curation_sample, {
request_id: r.request_id,
......@@ -230,7 +231,8 @@ Promise.all(queries_map.values())
scientist_2: r.scientist_2,
scientist_3: r.scientist_3,
section_split_id: sp.id,
remarks: `SecId:${sp.section_id}, secLen ${sp.section_length}`,
section_length_cm: util.round(((util.frac_below(0.1) * sec_len * 100) + 1),0),
remarks: `SecId:${sp.section_id}, secLen ${util.round(sp.section_length,1)}m`,
sample_date : Array.of(r.completion_date, r.approval_date,
r.request_date, util.date_between()).find(d => d != null)
}),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment