Find higher value with respect to time from a table?
Show older comments
With repect to time, i need higher value from the attached table.
Accepted Answer
More Answers (2)
Convert data into an easier to read format
!unzip 139.zip
!head 139.txt
!sed -i 's/ */,/g' 139.txt
!sed -i 's/EL(deg) SNR(dBHz)/EL(deg),SNR(dBHz)/g' 139.txt
!head 139.txt
Read data into a timetable
opts = detectImportOptions("139.txt",ReadVariableNames=true,NumHeaderLines=0,VariableNamingRule="preserve",TextType="string");
opts = setvaropts(opts,"% TIME (GPST)",Type="datetime",InputFormat="uuuu/MM/dd HH:mm:ss.S");
tt = readtimetable("139.txt",opts)
Find the maximum elevation angle for each row time using groupsummary
groupsummary(tt,"% TIME (GPST)","max","EL(deg)")
William Rose
on 31 Aug 2023
Please explain exactly what you want to do in more detail. Provide an example of code you have tried that did not work.
Your file has 104,002 rows of data, which are observations of about 113 satellites.* The data is sorted by satellite and then by time. I have attached a shorter file with data from 10 satellites, to demonstrate code. Column 1=date, column 2=time of day. The observation times vary for different satelites. Some times are repeated many times through the table. All observations are on the same date.
Combine the date and time columns, to make a datetime array.
T=readtable('data139a.txt');
dt1=datetime(T.(1),'InputFormat','yyyy/MM/dd')+T.(2); % make a datetime vector
Combine the datetime array with the other columns to make a timetable.
TT=timetable(dt1,T.(3),T.(4),T.(5),T.(6),T.(7)); % make a timetable
Extract all rows that have a time greater than a specified time:
dtref=datetime('19-May-2022 11:59:59'); % dtref=reference datetime
TTpm=TT(dt1>dtref,:); % timetable with all times greater than dtref
To make a timetable containing the data for just one satellite (satellite G01, in this example), do this:
TTg01=TT(strcmp(TT.(1),'G01'),:); % timetable for satellite G01
*Satellites in file 139.txt: G01-G32, R01-R15, R17-R18, R20-R24, E01-E05, E07-E15, E18-E21, E24-E27, E30-E31, E33-E34, E36, J02-J04, J07, C19-C46.
4 Comments
SOMNATH MAHATO
on 3 Sep 2023
William Rose
on 3 Sep 2023
Do you want to find the max azimiuth and max elevation for each satellite?
Why do you want to find max azimuth? I am asking that quesiton because it seems to me that max azimuth is an unusual quantity to seek to know. The max azimuth probably occurs as the satellite is crossing a threshold of visibility or signal strength.
Some of the satellites in the record make multiple passes, and some do not. If you wan thte max for each pass you will have to add some code to identify separate passes.
SOMNATH MAHATO
on 3 Sep 2023
SOMNATH MAHATO
on 3 Sep 2023
Categories
Find more on Reference Applications in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!