Skip to content

Commit 74f6883

Browse files
author
JLJu
committed
Added GPS Logger track support to SCilab script
Added GPS Logger track support to SCilab script
1 parent a22599c commit 74f6883

5 files changed

Lines changed: 701 additions & 2 deletions

File tree

Software/Script/Scilab/ADCAsgard/CSVLoader.sce

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ exec('viscosityair.sci')
66
exec('ISAaltitude.sci')
77
clc
88
//Q = csvRead("LG3-50HZ.CSV") //Field data <- Buono
9-
Q = csvRead("LG57600.CSV") //Field data
9+
Q = csvRead("PIPPO01.CSV") //Air Data
10+
GPS = csvRead("PIPPO01GPS.CSV") //GPS data
1011
[r c]=size(Q);
1112
ngroups=20;//Number of data sets
1213
fsample=0; //Averaged value of fsample
@@ -32,9 +33,17 @@ rhoairmcol=22;
3233
vair=23;
3334
Re=24;
3435
cfactor=25;
36+
//Define GPS data columns
37+
lat=3
38+
lon=4
39+
GPSaltitude=6
40+
geoidaltitude=7
41+
GPSspeed=8
42+
bearing=9; //Deg
43+
//Define tollerance band
3544
//Define tollerance band
3645
airdensityeband=0.5; //Air Density Percent of rho
37-
viscosityeband=2;//Viscosity %
46+
viscosityeband=3;//Viscosity %
3847
altitudeeband=0.5;//Altitude %
3948
fsamplev=zeros(1,ngroups);
4049

@@ -190,3 +199,31 @@ if debug==1 then
190199
mprintf('\nWarning: ADC calculated altitude value is outside the tollerance band of %f %% of viscosity',altitudeeband)
191200
end
192201
end
202+
figGPS=scf(4);
203+
clf(4);
204+
//GPS track
205+
//scatter3(GPS(:,lat),GPS(:,lon),GPS(:,GPSaltitude),"*")
206+
scatter3(GPS(:,lat),GPS(:,lon),GPS(:,GPSspeed),"red","*")
207+
//scatter3(GPS(:,lat),GPS(:,lon),Q(:,TASmcol),"blue","x")
208+
azz=gca()
209+
// [xmin,ymin,zmin; xmax,ymax,zmax]
210+
xmin=min(GPS(:,lat))
211+
ymin=min(GPS(:,lon))
212+
zmin=0
213+
xmax=max(GPS(:,lat))
214+
ymax=min(GPS(:,lon))
215+
zmax=30
216+
azz.data_bounds=[xmin,ymin,zmin; xmax,ymax,zmax];
217+
//Get the total air data log time in seconds
218+
//fsample is the calcualted real sample rate
219+
[r1 c1]=size(GPS);
220+
[r c]=size(Q);
221+
timereal=min([r/fsample r1])
222+
//Append a column with the airdata to the GPS data
223+
//PIPPO2GPS 25 offset
224+
[r1 c1]=size(GPS);
225+
for mm=1:timereal
226+
GPS(mm,c1+1)=Q(floor(50*0+ mm*fsample),IASmcol)
227+
end
228+
scatter3(GPS(:,lat),GPS(:,lon),GPS(:,c1+1),"blue","x")
229+
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
//ADC Asgard CSV Loader. JLJ . Basicairdata
2+
//1 debug mode
3+
clc
4+
GPS = csvRead("PIPPO01GPS.CSV") //GPS data
5+
6+
ngroups=20;//Number of data sets
7+
fsample=0; //Averaged value of fsample
8+
9+
RH=0; //Relative humidity
10+
//Define columns -> data correspondence
11+
//Raw sensor data
12+
deltapcol=3; //Deltap column is #3;
13+
abscol=4; //Abspressure column is #4;
14+
exttempcol=5; //External temp is #5;
15+
tempdeltapcol=6; //Temp from deltap sensor #6;
16+
tempabscol=7; //Temp from Abs pressure sensor #7;
17+
//Measurements
18+
absmcol=9;
19+
IASmcol=13;
20+
TASmcol=14;
21+
ExtTempmcol=10;
22+
tempdeltapmcol=11;
23+
tempabsmcol=12;
24+
altitude=15;
25+
OAT=16;
26+
rhoairmcol=22;
27+
vair=23;
28+
Re=24;
29+
cfactor=25;
30+
//Define GPS data columns
31+
lat=3
32+
lon=4
33+
GPSaltitude=6
34+
geoidaltitude=7
35+
GPSspeed=8
36+
bearing=9; //Deg
37+
//Define tollerance band
38+
//Define tollerance band
39+
airdensityeband=0.5; //Air Density Percent of rho
40+
viscosityeband=3;//Viscosity %
41+
altitudeeband=0.5;//Altitude %
42+
fsamplev=zeros(1,ngroups);
43+
figGPS=scf(1);
44+
//clf(1);
45+
//GPS track
46+
scatter3(GPS(:,lat),GPS(:,lon),GPS(:,GPSaltitude),"*")
47+
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
type,time,latitude,longitude,accuracy (m),altitude (m),geoid_height (m),speed (m/s),bearing (deg),sat_used,sat_inview,name,desc
2+
T,2018-01-13 14:22:24,45.19671306,27.96613565,3,56.953,40.047,6.750,152,17,21,20180113-152224,GPS Logger: 20180113-152224
3+
T,2018-01-13 14:22:25,45.19666376,27.96617874,3,56.953,40.047,7.250,149,17,21,,
4+
T,2018-01-13 14:22:26,45.19660849,27.96622268,3,57.954,40.046,8.000,147,18,22,,
5+
T,2018-01-13 14:22:27,45.19653640,27.96628657,3,57.954,40.046,27.000,147,18,22,,
6+
T,2018-01-13 14:22:28,45.19646352,27.96635660,3,56.954,40.046,27.750,147,18,22,,
7+
T,2018-01-13 14:22:29,45.19637794,27.96642967,3,56.955,40.045,11.000,147,18,22,,
8+
T,2018-01-13 14:22:30,45.19628002,27.96652421,3,56.955,40.045,12.000,147,18,22,,
9+
T,2018-01-13 14:22:31,45.19618344,27.96660666,4,57.956,40.044,13.000,147,18,22,,
10+
T,2018-01-13 14:22:32,45.19607642,27.96670521,3,56.956,40.044,13.750,147,19,22,,
11+
T,2018-01-13 14:22:33,45.19598116,27.96680019,3,56.957,40.043,14.000,147,19,22,,
12+
T,2018-01-13 14:22:34,45.19586953,27.96690000,4,56.957,40.043,14.750,147,19,22,,
13+
T,2018-01-13 14:22:35,45.19574152,27.96701403,3,56.958,40.042,15.750,147,19,22,,
14+
T,2018-01-13 14:22:36,45.19562360,27.96712106,3,57.959,40.041,16.750,147,19,22,,
15+
T,2018-01-13 14:22:37,45.19549325,27.96723784,3,57.960,40.040,17.750,147,19,22,,
16+
T,2018-01-13 14:22:38,45.19534420,27.96737416,3,57.960,40.040,18.500,147,19,21,,
17+
T,2018-01-13 14:22:39,45.19521012,27.96749734,4,57.961,40.039,127.250,147,19,21,,
18+
T,2018-01-13 14:22:40,45.19504911,27.96764370,3,57.962,40.038,20.000,148,19,21,,
19+
T,2018-01-13 14:22:41,45.19490310,27.96777002,4,56.963,40.037,127.750,148,19,21,,
20+
T,2018-01-13 14:22:42,45.19474519,27.96790090,4,56.964,40.036,20.000,148,19,21,,
21+
T,2018-01-13 14:22:43,45.19458656,27.96804712,4,57.964,40.036,20.000,147,19,21,,
22+
T,2018-01-13 14:22:44,45.19444343,27.96818159,4,57.965,40.035,20.000,146,19,22,,
23+
T,2018-01-13 14:22:45,45.19429052,27.96832285,4,57.966,40.034,20.000,147,19,22,,
24+
T,2018-01-13 14:22:46,45.19411888,27.96847837,3,57.967,40.033,20.000,147,19,22,,
25+
T,2018-01-13 14:22:47,45.19396632,27.96860911,4,57.968,40.032,20.000,147,19,22,,
26+
T,2018-01-13 14:22:48,45.19380658,27.96874962,3,58.969,40.031,20.000,147,19,22,,
27+
T,2018-01-13 14:22:49,45.19367005,27.96888040,4,58.969,40.031,127.750,147,19,22,,
28+
T,2018-01-13 14:22:50,45.19352249,27.96901501,4,57.970,40.030,20.000,147,19,22,,
29+
T,2018-01-13 14:22:51,45.19336163,27.96916551,4,58.971,40.029,20.000,147,19,22,,
30+
T,2018-01-13 14:22:52,45.19322627,27.96929383,3,58.972,40.028,20.000,147,19,22,,
31+
T,2018-01-13 14:22:53,45.19307906,27.96942850,3,58.973,40.027,20.000,147,19,22,,
32+
T,2018-01-13 14:22:54,45.19291850,27.96957894,4,58.973,40.027,127.750,147,19,22,,
33+
T,2018-01-13 14:22:55,45.19277925,27.96971158,3,57.974,40.026,20.000,147,19,22,,
34+
T,2018-01-13 14:22:56,45.19261559,27.96985315,4,57.975,40.025,20.000,147,19,22,,
35+
T,2018-01-13 14:22:57,45.19247643,27.96997538,4,58.976,40.024,20.000,147,19,22,,
36+
T,2018-01-13 14:22:58,45.19232571,27.97010984,3,58.977,40.023,20.000,148,19,22,,
37+
T,2018-01-13 14:22:59,45.19216321,27.97025232,3,57.978,40.022,20.000,148,19,22,,
38+
T,2018-01-13 14:23:00,45.19202249,27.97037990,3,57.978,40.022,20.000,148,19,22,,
39+
T,2018-01-13 14:23:01,45.19186745,27.97050993,3,57.979,40.021,127.750,148,19,22,,
40+
T,2018-01-13 14:23:02,45.19170950,27.97065824,4,56.980,40.020,127.750,148,19,22,,
41+
T,2018-01-13 14:23:03,45.19157204,27.97078901,3,56.981,40.019,127.750,148,19,22,,
42+
T,2018-01-13 14:23:04,45.19140396,27.97093691,3,56.982,40.018,127.750,148,19,22,,
43+
T,2018-01-13 14:23:05,45.19126722,27.97106010,3,57.983,40.017,20.000,148,19,21,,
44+
T,2018-01-13 14:23:06,45.19112230,27.97119515,3,56.983,40.017,127.750,147,19,21,,
45+
T,2018-01-13 14:23:07,45.19095743,27.97133833,3,57.984,40.016,20.000,147,19,21,,
46+
T,2018-01-13 14:23:08,45.19081527,27.97146505,3,57.985,40.015,127.750,147,19,22,,
47+
T,2018-01-13 14:23:09,45.19066784,27.97160103,3,57.986,40.014,127.750,147,20,22,,
48+
T,2018-01-13 14:23:10,45.19050435,27.97174962,3,57.987,40.013,20.000,148,20,22,,
49+
T,2018-01-13 14:23:11,45.19036273,27.97187804,3,57.987,40.013,20.000,148,20,22,,

0 commit comments

Comments
 (0)