Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
icdp-osg
mdis-datagen
Commits
a0cab22a
Commit
a0cab22a
authored
Jul 27, 2020
by
Knut Behrends
Browse files
finetune display of depth-values in fake-sample generation
parent
49fae30e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/classes/fake-samples.js
View file @
a0cab22a
...
...
@@ -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
i
nt
=
util
.
round
((
minlen
+
len
)
,
1
)
this
.
_props
.
interval
=
i
nt
return
i
nt
}
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
(
...
...
src/sample-inserter.js
View file @
a0cab22a
...
...
@@ -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
)
}),
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment