0
$\begingroup$

I have created a graph with a daily load diagram which takes data from certain period of year and compare mean values in peak time (11:00 to 16:00) and displays this day with highest mean values (it was discussed in another topic here) and I just add future loading which is multiplication of contemporary one and also limit:

ANK240NAP = 
 Dataset@Import[
   "M:\\DataCacheScada\\IIS\\vocko01\\contemporary.csv", "Table", "FieldSeparators" -> ";",
HeaderLines -> 1 (*skip the first line*)]
    DDZgraf = 
 ANK240NAP[(*get the two relevant columns*)All, -2 ;;][
      All, {(*for the first column,*)
       1 -> ((*convert the string to a DateObject by splitting it,
         reordering the parts and converting them to numbers*)
         DateObject[FromDigits /@ {#3, #2, #, ##4}] & @@ 
           StringSplit[#, 
            "." | " " | ":"] &)}][(*group the datapoints by day*)
     GroupBy[DateObject[#, "Day"] &@*First]][All, 
    TimeSeries,(*convert the datasets for each day to a \
TimeSeries...*){1 -> 
      TimeObject} (*after converting the date to a TimeObject*)][
   MaximalBy[(*find the day with the highest value of*)(*the mean of \
the value in the window specified*)
    Mean@TimeSeriesWindow[#, 
       TimeObject /@ {{11, 00, 00}, {16, 00, 0}}] &]][
  First (*and plot it*)
  ](*get the first result*)
nasobic=(660 + 1196)/1196 // N;
DDZgraf2=DDZgraf*nasobic;
timeList=Range[TimeObject[{00, 00, 00}], TimeObject[{23, 50, 00}], 
  Quantity[10, "min"]];
    limit=Transpose[{timeList, ConstantArray[319, Length[timeList]]}];
    DateListPlot[{DDZgraf,DDZgraf2,limit},PlotLabel->"Busiest day comparison",AxesLabel->"Current",PlotLegends{"Contemporary loading","Future loading in 2043","Limit value"},PlotStyle->{Blue,Orange,Red},GridLines->Automatic]

Now my problem is that I have also some very limited data from past. These data are from 2013 and there are only 4 measured values (taken at 3:00, 11:00, 13:00, 17:00) and they are also from different date (Jan 16th). I have to combine these data in order to basically have one daily load diagram with all curves (past, contemporary, future, limit) together. I tried to plot it altogether but it is obviously plotted in different year, I tried to pick or remove date and year but I didn't succeed.

    schmidt = 
 FileNames[
  "N:\\DataCacheScada\\IIS\\past.csv"];
past = {DateObject@
   StringReplace[#1, 
    x : DigitCharacter .. ~~ "." ~~ y : DigitCharacter .. ~~ "." ~~
       z : DigitCharacter .. ~~ " " ~~ rest__ :> 
     z <> "/" <> y <> "/" <> x <> " " <> 
      rest], #2} & @@@ # & /@ (Import[#, "Table", 
   "FieldSeparators" -> ";"][[2 ;;, {-2, -1}]] & /@ schmidt)

DO you know how to pick only hour and minute in datas with past and combine this curve together with the other curves? Or is there a better way?

Here is the link for data: https://gofile.io/?c=XKH5jd

And my second question is that if I wanted to basically compare two items with different loading in one day but their maximums are be on different dates, would it be programmed in the same way? The format is same in this case.

Here is also link for another item with different loading: https://gofile.io/?c=lKMtdP Thank you for your answers! I really appreciate it!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.