I have a large dataset which looks like this:
The first column is datetimes and the first row is frequency bins. The data is dB values. (1,1) is irrelevant and could be 0/NA...
I then have a table of datetimes:
where the first column is the associated datetime variable from the large dataset, second is sunrise, third is end of dawn, fourth is beginning of dusk, and fifth is sunset. The first row is irrelevant and if possible I would change it to useful variable names.
I would like to subset the large dataset using these values.
For example, if the datetime (2,1) in the dataset falls between either duskdawntime(2,2:3) or duskdawntime (2,4:5), I would like to take the corresponding row of data from the large dataset and store it in a separate dusk or dawn table. Since these time windows change every day, it is important that each row of data is distinct i.e. we compare row 2 filename with row 2 sunrise time and row 2 sunset time.
(I calculated end of dawn and beginning of dusk by adding/removing 1hr from sunrise/sunset times but I may change the size of this window)
So far, I am thinking something like this:
if (filename >= sunrise) && (filename <= dawnend)
elseif (filename >= dawnend) && (filename <= sunset)
...but I am not sure if this is the most refined way.
Is this possible? Thanks in advance for any suggestions/help