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 { ...@@ -42,14 +42,14 @@ module.exports = class CurationSample {
find_top() { find_top() {
const t = util.round(( const t = util.round((
this._section.top_depth + 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) ), 1)
this._props.top = t this._props.top = t
return t return t
} }
find_interval() { find_interval() {
const sl = this._section.section_length * 100 const sl = this._props.section_length_cm
const minlen = 0.03 * (sl + 1) const minlen = 0.03 * (sl + 1)
let len = 0 let len = 0
...@@ -59,9 +59,9 @@ module.exports = class CurationSample { ...@@ -59,9 +59,9 @@ module.exports = class CurationSample {
} else { } else {
len = sl * util.frac_below(0.2) len = sl * util.frac_below(0.2)
} }
const i = util.round((minlen + len) ) * 100 const int = util.round((minlen + len), 1)
this._props.interval= i this._props.interval= int
return i return int
} }
find_analyst() { find_analyst() {
return util.shuffle(CoreDefaults.curator).pop() return util.shuffle(CoreDefaults.curator).pop()
...@@ -71,7 +71,7 @@ module.exports = class CurationSample { ...@@ -71,7 +71,7 @@ module.exports = class CurationSample {
//return this._props.sample_type //return this._props.sample_type
} }
find_section_top_mbsf() { 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 this._props.section_top_mbsf = t
return t return t
} }
...@@ -101,7 +101,7 @@ module.exports = class CurationSample { ...@@ -101,7 +101,7 @@ module.exports = class CurationSample {
return "AWI" return "AWI"
} }
find_volume() { find_volume() {
return this._section.sample_volume return this._section.sample_volume || 0
} }
find_sample_top_mbsf() { find_sample_top_mbsf() {
let t = util.round(this.section_top_mbsf + this.top, 1) let t = util.round(this.section_top_mbsf + this.top, 1)
...@@ -109,7 +109,7 @@ module.exports = class CurationSample { ...@@ -109,7 +109,7 @@ module.exports = class CurationSample {
return t return t
} }
find_sample_bottom_mbsf() { 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() { find_scientist() {
return Array.of( return Array.of(
......
...@@ -222,6 +222,7 @@ Promise.all(queries_map.values()) ...@@ -222,6 +222,7 @@ Promise.all(queries_map.values())
let request_ids_per_city = util.shuffle(s.requests).slice(-n_picked) let request_ids_per_city = util.shuffle(s.requests).slice(-n_picked)
// ~ 5 requests for this split // ~ 5 requests for this split
for (let r of request_ids_per_city) { 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( let fake_sample = new CurationSample(
Object.assign({}, curation_sample, { Object.assign({}, curation_sample, {
request_id: r.request_id, request_id: r.request_id,
...@@ -230,7 +231,8 @@ Promise.all(queries_map.values()) ...@@ -230,7 +231,8 @@ Promise.all(queries_map.values())
scientist_2: r.scientist_2, scientist_2: r.scientist_2,
scientist_3: r.scientist_3, scientist_3: r.scientist_3,
section_split_id: sp.id, 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, sample_date : Array.of(r.completion_date, r.approval_date,
r.request_date, util.date_between()).find(d => d != null) r.request_date, util.date_between()).find(d => d != null)
}), }),
......
Supports Markdown
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