-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathScripps_MMM_GeneratedMap_15_Dec_2020.js
121 lines (108 loc) · 3.48 KB
/
Scripps_MMM_GeneratedMap_15_Dec_2020.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// Mapping file created by Mars Map Maker on 2020-12-15
//
// **************************************************
// Mapping file created with file(s)scripscombined.csv
// This is a mapping file for the organization Scripps Institute of Oceanography (SIO)
//
// Mars Map Maker was created by Josh Gilley and Robert Niggebrugge
// of CIRDLES.org, with help from James Rundle,
// under the guidance of Principal Investigator Dr. Jim Bowring.
// in coordination with geosamples.org.
//
//
// Copyright 2020 Scripps Institute of Oceanography. Licensed under the
// Apache License, Version 2.0 (the "License"); you may not use this
// file except in compliance with the License. You may obtain a copy
// of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless
// required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
// OR CONDITIONS OF ANY KIND, either express or implied. See the License
// for the specific language governing permissions and limitations under the License.
//
// **************************************************
const forceEditID0 = () => {
let mapMakerHeader = "<METADATA_ADD>"
let mapMakerIndex = 0
return "SIO";
}
const forceEditID1 = () => {
let mapMakerHeader = "<METADATA_ADD>"
let mapMakerIndex = 1
return "Sediment";
}
const forceEditID2 = () => {
let mapMakerHeader = "<METADATA_ADD>"
let mapMakerIndex = 2
return "meters";
}
const forceEditID3 = () => {
let mapMakerHeader = "<METADATA_ADD>"
let mapMakerIndex = 3
return "Core";
}
const forceEditID4 = () => {
let mapMakerHeader = "FACILITY_CODE"
let mapMakerIndex = 4
return "Scripps Institution of Oceanography (SIO)";
}
const keyValueString = (scrippsValue, scrippsKey) => {
return scrippsKey + ' : ' + scrippsValue
}
const delimit = (valueArray) => {
return valueArray.join(';')
}
const scrippsDate = (scrippsValue) => {
const y = "" + scrippsValue.substr(0,4)
const d = scrippsValue.substr(6,2)
const m = scrippsValue.substr(4,2)
return y + '-' + m + '-' + d + 'T00:00:00Z'
}
let map = {
user_code: "<METADATA_ADD>",
material: "<METADATA_ADD>",
elevation_unit: "<METADATA_ADD>",
sample_type: "<METADATA_ADD>",
current_archive: "<METADATA>",
platform_name: "PLATFORM",
cruise_field_prgrm: "CRUISE",
name: "SAMPLE",
collection_method: "DEVICE",
collection_start_date: "BEGIN_DATE",
latitude: "LAT",
latitude_end: "END_LATMIN",
longitude: "LON",
longitude_end: "END_LON",
elevation: "WATER_DEPTH",
elevation_end: "END_WATER_DEPTH",
collector: "PI",
primary_location_type: "PROVINCE",
igsn: "IGSN",
classification: "ROCK_LITH",
geological_age: [ "AGE", "ABSOLUTE_AGE_TOP", "ABSOLUTE_AGE_BOT" ],
field_name: [ "LITH1", "TEXT1" ],
sample_comment: [ "STORAGE_METH", "SAMPLE_COMMENTS", "WEIGHT" ],
description: [ "DESCRIPTION", "ROCK_MIN", "WEATH_META", "REMARK", "EXHAUST_CODE" ],
size: [ "CORED_LENGTH", "CORED_DIAM" ]
}
let logic = {
user_code: forceEditID0,
material: forceEditID1,
elevation_unit: forceEditID2,
sample_type: forceEditID3,
current_archive: forceEditID4,
collection_start_date: scrippsDate,
collection_end_date: scrippsDate,
geological_age: keyValueString,
field_name: keyValueString,
description: keyValueString,
sample_comment: keyValueString,
size: keyValueString
}
let combinations = {
field_name: delimit,
description: delimit,
geological_age: delimit,
sample_comment: delimit,
size: delimit
}
return {map, logic, combinations}