Commit 0e5b3e03 authored by Sergio Bruni's avatar Sergio Bruni
Browse files

m

parent 07db63c8
......@@ -1079,3 +1079,119 @@ OR diff_y > 10
OR diff_z > 10
```
select *
FROM (
select
station,
network network1,
prev_network network2,
count_rinex,
min_x - prev_min_x diff_min_x,
max_y - prev_min_y diff_min_y,
max_z - prev_min_z diff_min_z,
max_x - prev_max_x diff_max_x,
max_y - prev_max_y diff_max_y,
max_z - prev_max_z diff_max_z,
avg_x - prev_avg_x diff_avg_x,
avg_y - prev_avg_y diff_avg_y,
avg_z - prev_avg_z diff_avg_z
FROM (
select
station,
network,
count_rinex,
lag(network) over (partition by station order by station, network) as prev_network,
min_x, min_y, min_z,
lag(min_x) over (partition by station order by station, network) as prev_min_x,
lag(min_y) over (partition by station order by station, network) as prev_min_y,
lag(min_z) over (partition by station order by station, network) as prev_min_z,
max_x, max_y, max_z,
lag(max_x) over (partition by station order by station, network) as prev_max_x,
lag(max_y) over (partition by station order by station, network) as prev_max_y,
lag(max_z) over (partition by station order by station, network) as prev_max_z,
#### Come sopra aggiungendo min e max della differenza e calcolato su una stazione per due reti
```
select *
FROM (
select
station,
network network1,
prev_network network2,
count_rinex,
min_x - prev_min_x diff_min_x,
max_y - prev_min_y diff_min_y,
max_z - prev_min_z diff_min_z,
max_x - prev_max_x diff_max_x,
max_y - prev_max_y diff_max_y,
max_z - prev_max_z diff_max_z,
avg_x - prev_avg_x diff_avg_x,
avg_y - prev_avg_y diff_avg_y,
avg_z - prev_avg_z diff_avg_z
FROM (
select
station,
network,
count_rinex,
lag(network) over (partition by station order by station, network) as prev_network,
min_x, min_y, min_z,
lag(min_x) over (partition by station order by station, network) as prev_min_x,
lag(min_y) over (partition by station order by station, network) as prev_min_y,
lag(min_z) over (partition by station order by station, network) as prev_min_z,
max_x, max_y, max_z,
lag(max_x) over (partition by station order by station, network) as prev_max_x,
lag(max_y) over (partition by station order by station, network) as prev_max_y,
lag(max_z) over (partition by station order by station, network) as prev_max_z,
avg_x, avg_y, avg_z,
lag(avg_x) over (partition by station order by station, network) as prev_avg_x,
lag(avg_y) over (partition by station order by station, network) as prev_avg_y,
lag(avg_z) over (partition by station order by station, network) as prev_avg_z
FROM (
select
s.marker station,
n.name network,
count(*) count_rinex,
round(min(x_crd_a), 3) min_x,
round(min(y_crd_a), 3) min_y,
round(min(z_crd_a), 3) min_z,
round(max(x_crd_a), 3) max_x,
round(max(y_crd_a), 3) max_y,
round(max(z_crd_a), 3) max_z,
round(avg(x_crd_a), 3) avg_x,
round(avg(y_crd_a), 3) avg_y,
round(avg(z_crd_a), 3) avg_z
from rinex_file r
join station s on s.id=r.id_station
JOIN rinex_file_network rn ON rn.id_rinex_file=r.id
JOIN network n ON n.id=rn.id_network
where s.marker = 'JOZE'
and n.name in ('EUREF', 'IGS')
and x_crd_a <> 0 AND x_crd_a IS NOT NULL
and y_crd_a <> 0 AND y_crd_a IS NOT NULL
and z_crd_a <> 0 AND z_crd_a IS NOT NULL
GROUP BY s.marker, n.name
ORDER BY s.marker, n.name
) t
) t1
WHERE prev_avg_x IS NOT NULL
) t2
```
Markdown is supported
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