# contact for the configurations of there is no source in the Tereno data
# contact for the configurations of there is no source in the Tereno data
...
@@ -39,9 +40,11 @@ tsm_endpoint_name = "FZJ"
...
@@ -39,9 +40,11 @@ tsm_endpoint_name = "FZJ"
# As given by odm.sqls.sites_clustering_sql, each configuration has exactly one project, i.e., the mapping also provides
# As given by odm.sqls.sites_clustering_sql, each configuration has exactly one project, i.e., the mapping also provides
# the one "admin" cfg_permission_group for each configuration.
# the one "admin" cfg_permission_group for each configuration.
project_to_permission_groups="""{
project_to_permission_groups="""{
"eifelrur": "Tereno : fzj-sms-eifelrur-admin",
"eifelrur": "Tereno : fzj-sms",
"soilcan": "Tereno : fzj-sms-soilcan-admin",
"soilcan": "Tereno : fzj-sms",
"eddy": "Tereno : fzj-sms-eifelrur-admin"
"cosmicray": "Tereno : fzj-sms",
"wver": "Tereno : fzj-sms",
"eddy": "Tereno : fzj-sms"
}"""
}"""
[cv]
[cv]
...
@@ -111,7 +114,7 @@ when upper(s.code) like 'SY_%' then 'Scheyern'
...
@@ -111,7 +114,7 @@ when upper(s.code) like 'SY_%' then 'Scheyern'
--when substring(s.code from '[^_]_([BKYCDR]*)_') is not NULL then substring(s.code from '([^_]*_)') || 'Y' || substring(s.code from '(_[0-9]{1})')
--when substring(s.code from '[^_]_([BKYCDR]*)_') is not NULL then substring(s.code from '([^_]*_)') || 'Y' || substring(s.code from '(_[0-9]{1})')
else NULL end as site_label_2,
else NULL end as site_label_2,
case when upper(s.code) like 'DD_K%' then substring(s.code from '([^_]*_)') || 'Y_' || substring(s.code from '([0-9]{2}$)')
case when upper(s.code) like 'DD_K%' then substring(s.code from '([^_]*_)') || 'Y_' || substring(s.code from '([0-9]{2}$)')
when substring(s.code from '[^_]_([BKYCDR]*)_') is not null then substring(s.code from '([^_]*_)') || 'Y' || substring(s.code from '(_[0-9]{2})')
when substring(s.code from '(RO|WU|SE)_(BKY|Y)_') is not null then substring(s.code from '([^_]*_)') || 'Y' || substring(s.code from '(_[0-9]{2})')
else s.code end as configuration_label,
else s.code end as configuration_label,
min(ts.schema_name) as project,
min(ts.schema_name) as project,
json_agg(s.objectid) as platform_ids,
json_agg(s.objectid) as platform_ids,
...
@@ -122,7 +125,11 @@ inner join importandpublish.logger l on l.siteid = s.objectid and l.timestampto
...
@@ -122,7 +125,11 @@ inner join importandpublish.logger l on l.siteid = s.objectid and l.timestampto
inner join importandpublish.tsm_schemas ts on ts.objectid = l.schemaid
inner join importandpublish.tsm_schemas ts on ts.objectid = l.schemaid
where s.active = true
where s.active = true
and exists (select 1 from importandpublish.sensorinstances i where i.siteid = s.objectid)
and exists (select 1 from importandpublish.sensorinstances i where i.siteid = s.objectid)
and (s.code like 'WU%Y%' or s.code like 'SE%Y%' or s.code like 'WU_AW%' or s.code like 'RO_A%' or s.code like 'RO%Y%' or s.code like 'DD%01%' or s.code like 'DM%Y%' or s.code like 'SY%Y%02%')
and (
l.code in ('SE4-V105-Data1MinI','BL1-V105-AlarmG','COMBILOG','cs125','SB-V105-Data1MinI','A80125','WU-V105-Data10MinH','C00127','SE1-V105-Data10MinH','SE1-V105-Data1MinI','DD-V105-Data1MinI','DD2-V105-Data10MinH','A80138','ST-V105-Data1MinI','ST-V105-Data10MinH','SFLX1-Probes','SFLX1-Weight','SE2-V105-Data10MinH','BL2-V105-AlarmG','A80124','D30015','SE2-V105-Data1MinI','SE2-V105-AlarmG','V2020-12-SYSTEM','SE4-V105-Data10MinH','RO-V105-Data10MinH','C00145','DM-V105-Data10MinH','RO-V105-AlarmG','WU-V105-Data1MinI','ST-V105-AlarmG','DM-V105-AlarmG','SE3-V105-Data10MinH','V2020-12-Data1MinI','SE3-V105-AlarmG','A70084','WU-V105-AlarmG','BL2-V105-Data10MinH','SE4-V105-AlarmG','RO-V105-Data1MinI','V2020-12-Data10MinH','A80105','Flowstation','A80131','SE3-V105-Data1MinI','BL1-V105-Data1MinI','BL3-V105-AlarmG','A80098','DD2-V105-AlarmG','SB-V105-AlarmG','SE1-V105-AlarmG','A80121','BL1-V105-Data10MinH','BL2-V105-Data1MinI','SB-V105-Data10MinH','DD2-V105-Data1MinI','BL3-V105-Data10MinH','DD-V105-AlarmG','SFLX1-System','DD-V105-Data10MinH','BL3-V105-Data1MinI','DM-V105-Data1MinI')
or
(s.code like 'WU%Y%' or s.code like 'SE%Y%' or s.code like 'WU_AW%' or s.code like 'RO_A%' or s.code like 'RO%Y%' or s.code like 'DM%Y%' or s.code like 'SY%Y%02%')
)
group by site_label, site_label_2, configuration_label
group by site_label, site_label_2, configuration_label
order by site_label, site_label_2, configuration_label
order by site_label, site_label_2, configuration_label