You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to compare different datasets from pangaea in an automatic way using such an input list:
pangdois<-list()
if (T) {
pangdois<- c(pangdois,
list("lorius_etal_1985"=list(pdoi="10.1594/PANGAEA.860950",
vars=list("d18op"=list(inputname="δ18O H2O [‰ SMOW]",
dims=list("kyr_before_1950"="Age [ka BP]"))))))
if (T) {
pangdois<- c(pangdois,
list("masson-delmotte_etal_2011"=list(pdoi="10.1594/PANGAEA.785228",
vars=list("d18op"=list(inputname="δ18O H2O [‰ SMOW]",
dims=list("kyr_before_1950"="Age [ka BP]"))))))
}
if (length(pangdois) >0) {
for (pangiin seq_along(pangdois)) {
if (pangi==1) library(pangaear)
message("run `pangaear::pg_data(", pangdois[[pangi]]$pdoi, ")` ...")
tmp<-pangaear::pg_data(pangdois[[pangi]]$pdoi)
for (eventiin seq_along(tmp)) { # search wanted variables in every event of current doievent<-NA# default# <non-consistent event-handling; see below>for (viin seq_along(pangdois[[pangi]]$vars)) { # check if any wanted variable exists in current event of current doiif (any(names(tmp[[eventi]]$data) ==pangdois[[pangi]]$vars[[vi]]$inputname)) {
# do further stuff
} # if current variable exists in current event of current doi
} # for vi in wanted vars
} # for eventi in seq_along(tmp)
} # for pangi in pangdois
} # if length(pangdois) > 0
However, I realized that the usage of the event handler is not consistent. So far I figured out 3 different cases:
# case 1:$parent_doi:chr"10.1594/PANGAEA.785228"$metadata:Listof7..$events:Listof7....$ Dome_Fuji (DF):chrNA# --> if `metadata$events` is a list, use first entry that is NA to identify the data?# case 2:$parent_doi:chr"10.1594/PANGAEA.860950"$metadata:Listof7..$events:chr"Vostok * LATITUDE: -78.464420 * LONGITUDE: 106.837320 * DATE/TIME: 1980-01-01T00:00:00 * ELEVATION: 3488.0 m * Recovery: 2755 m * LOCATION: Antarctica * CAMPAIGN: Ice_core_diverse * BASIS: Sampling/drilling ice * METHOD/DEVICE: Drilling/drill rig (DRILL) * COMMENT: annual pressure 624 mbar; mean annual temperature -55.5°C; snow accumulation between 2.2 and; 22.5 g/cm**2/yr, about 250 ka"# --> if `metadata$events` is not a list and `data$Event` is null, find a way to reduce the long event string to identify the data?# case 3:..$parent_doi:chr"10.1594/PANGAEA.863978"..$metadata:Listof9
..$ events : chr "177-1089A * LATITUDE: -40.936400 * LONGITUDE: 9.894100 * DATE/TIME START: 1997-12-19T16:15:00 * DATE/TIME END: 1997-12-21T13:15:00 * ELEVATION: -4619.3 m * Penetration: 216.3 m * Recovery: 149.64 m * LOCATION: South Atlantic Ocean * CAMPAIGN: Leg177 (URI: https://doi.org/10.2973/odp.proc.ir.177.1999) * BASIS: Joides Resolution (URI: http://www-odp.tamu.edu/resolutn.html) * METHOD/DEVICE: Drilling/drill rig (DRILL) * COMMENT: 23 cores; 216.3 m cored; 0 m drilled; 69.2 % recovery; 177-1089B * LATITUDE: -40.936400 * LONGITUDE: 9.894100 * DATE/TIME START: 1997-12-22T13:16:00 * DATE/TIME END: 1997-12-22T22:45:00 * ELEVATION: -4623.8 m * Penetration: 264.9 m * Recovery: 246.62 m * LOCATION: South Atlantic Ocean * CAMPAIGN: Leg177 (URI: https://doi.org/10.2973/odp.proc.ir.177.1999) * BASIS: Joides Resolution (URI: http://www-odp.tamu.edu/resolutn.html) * METHOD/DEVICE: Drilling/drill rig (DRILL) * COMMENT: 29 cores; 264.9 m cored; 0 m drilled; 93.1 % recovery; 306-U1313B * LATITUDE: 41.000023 * LONGITUDE: -32.957300 * ELEVATION: -3413.5 m * Recovery: 306.54 m * CAMPAIGN: Exp306 (North Atlantic Climate 2) (URI: https://doi.org/10.2204/iodp.proc.303306.2006) * BASIS: Joides Resolution (URI: http://www-odp.tamu.edu/resolutn.html) * METHOD/DEVICE: Drilling/drill rig (DRILL) * COMMENT: 32 cores; 300.4 m cored; 102 % recovered; 2 m drilled; 302.4 m penetrated; GeoB1515-1 * LATITUDE: 4.238333 * LONGITUDE: -43.666667 * DATE/TIME: 1991-05-15T00:00:00 * ELEVATION: -3129.0 m * Recovery: 6.58 m * LOCATION: Amazon Fan * CAMPAIGN: M16/2 (URI: https://doi.org/10.2312/cr_m16) * BASIS: Meteor (1986) (URI: https://de.wikipedia.org/wiki/Meteor_(Schiff,_1986)) * METHOD/DEVICE: Gravity corer (Kiel type) (SL); GeoB1523-1 * LATITUDE: 3.831667 * LONGITUDE: -41.621667 * DATE/TIME: 1991-05-17T00:00:00 * ELEVATION: -3292.0 m * Recovery: 6.65 m * LOCATION: Amazon Fan * CAMPAIGN: M16/2 (URI: https://doi.org/10.2312/cr_m16) * BASIS: Meteor (1986) (URI: https://de.wikipedia.org/wiki/Meteor_(Schiff,_1986)) * METHOD/DEVICE: Gravity corer (Kiel type) (SL); KNR140-12JPC (KNR140-2-12JPC) * LATITUDE: 29.080000 * LONGITUDE: -72.900000 * ELEVATION: -4250.0 m * LOCATION: North Atlantic Ocean * CAMPAIGN: KNR140 * BASIS: Knorr * METHOD/DEVICE: Piston corer (PC); M35003-4 * LATITUDE: 12.090000 * LONGITUDE: -61.243333 * DATE/TIME: 1996-04-19T00:00:00 * ELEVATION: -1299.0 m * Recovery: 9.63 m * CAMPAIGN: M35/1 (URI: https://doi.org/10.2312/cr_m35) * BASIS: Meteor (1986) (URI: https://de.wikipedia.org/wiki/Meteor_(Schiff,_1986)) * METHOD/DEVICE: Gravity corer (Kiel type) (SL)"
$data:tibble [138 × 27] (S3:tbl_df/tbl/data.frame)
..$Event:chr [1:138] "177-1089A""177-1089A""177-1089A""177-1089A"...# --> if `metadata$events` is not a list and `data$Event` is not null, use maybe `unique(data$Event)` to identify the data?
Probably I do not understand the correct usage of the event handler. Is there a better way to identify each individual data set per DOI in an automatic way?
unfortunately, the files from Pangaea are semi formatted text files that are quite hard to parse, and super variable. I can try to make them more consistent.
Hi
I would like to compare different datasets from pangaea in an automatic way using such an input list:
However, I realized that the usage of the
event
handler is not consistent. So far I figured out 3 different cases:Probably I do not understand the correct usage of the
event
handler. Is there a better way to identify each individual data set per DOI in an automatic way?Thanks a lot for any help,
Chris
Session Info
The text was updated successfully, but these errors were encountered: