Jump to content
  • To Search the Seeq Knowledgebase:

    button_seeq-knowledgebase.png.ec0acc75c6f5b14c9e2e09a6e4fc8d12.png.4643472239090d47c54cbcd358bd485f.png

Search the Community

Showing results for tags 'histogram'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Community Technical Forums
    • Tips & Tricks
    • General Seeq Discussions
    • Seeq Data Lab
    • Seeq Developer Club
    • Seeq Admin Forum
    • Feature Requests

Categories

  • Seeq FAQs
  • Online Manual
    • General Information

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Company


Title


Level of Seeq User

Found 9 results

  1. When I select time as aggregation type, it seems that the time zone in histogram is not the same as the time zone I used in the normal trend view. It seems that time zone in the histogram has a default value. But there is no way that I can know. For example, I had some discrete signal, I want sum them by day, I use two methods, signal from condition and histogram. But I can not get them follow each other. I even filter the signal to have it only to show a value a day. And found the aggregate from the histogram offsets. I think it is time zone setting that caused this problem. But I can't change the time zone in the histogram. Is there a way to do it? For instance, as below picture shows, Nov 14th, the signal has only a sample value 9708.1s(blue bar), the signal from condition gives the right summation(yellow bar) at the correct time Nov 14. But histogram gives the right value but on the different day 13th. Even some time it can't provide the correct value.
  2. I need to accomplish following things: - Bin the x-axis - Span the y-axis for each bin (max-min) - Filter outliers based on quantiles - Finally I would want to fit some polynomial curve based on max and min values of the span (join the mid values in each bin) But I cant find appropriate way to do it
  3. Users are often interested in creating pareto charts using conditions they've created in Seeq sorted by a particular capsule property. The chart below was created using the Histogram tool in Seeq Workbench. For more information on how to create Histograms that look like this, check out this article on creating and using capsule properties. Often times users would like to see the histogram above, but with the bars sorted from largest to smallest in a traditional pareto chart. Users can easily create paretos from Seeq conditions using Seeq Data Lab. A preview of the chart that we can create is: The full Jupyter Notebook documentation of this workflow (including output) can be found in the attached pdf file. If you're unable to download the PDF, the code snippets below can be run in Seeq Data Lab to produce the chart above. #Import relevant libraries from seeq import spy import pandas as pd import numpy as np import matplotlib import matplotlib.pyplot as plt Log in to the SPY module if running locally using spy.login, or skip this step if running Seeq Data Lab. #Search for your condition that has capsule properties using spy.search #Use the 'scoped to' argument to search for items only in a particular workbook. If the item is global, no 'scoped to' argument is necessary condition = spy.search({ "Name": "Production Loss Events (with Capsule Properties)", "Scoped To": "9E50F449-A6A1-4BCB-830A-8D0878C8C925", }) condition #pull the data from the time frame of interest using spy.pull into a Pandas dataframe called 'my_data' my_data = spy.pull(condition, start='2019-01-15 12:00AM', end='2019-07-15 12:00AM', header='Name',grid=None) #remove columns from the my_data dataframe that will not be used in creation of the pareto/CDF my_data = my_data.drop(['Condition','Capsule Is Uncertain','Source Unique Id'], axis=1, inplace=False) #Calculate a new dataframe column named 'Duration' by subtracting the capsule start from the capsule end time my_data['Duration'] = my_data['Capsule End']-my_data['Capsule Start'] #Group the dataframe by reason code my_data_by_reason_code = my_data.groupby('Reason Code') #check out what the new data frame grouped by reason code looks like my_data_by_reason_code.head() #sum total time broken down by reason code and sort from greatest to least total_time_by_reason_code['Total_Time_by_Reason_Code'] = my_data_by_reason_code['Duration'].sum().sort_values(ascending=False) total_time_by_reason_code['Total_Time_by_Reason_Code'] = total_time_by_reason_code['Total_Time_by_Reason_Code'].rename('Total_Time_by_Reason_Code') total_time_by_reason_code['Total_Time_by_Reason_Code'] #plot pareto of total time by reason code total_time_by_reason_code['Total_Time_by_Reason_Code'].plot(kind='bar') #Calculate the total time from all reason codes total_time = total_time_by_reason_code['Total_Time_by_Reason_Code'].sum() total_time #calculate percentatge of total time from each individual reason code percent_time_by_reason_code['Percent_Time_by_Reason_Code'] = total_time_by_reason_code['Total_Time_by_Reason_Code'].divide(total_time) percent_time_by_reason_code['Percent_Time_by_Reason_Code'] #Calculate cumulative sum of percentage of time for each reason code cum_percent_time_by_reason_code['Cum_Percent_Time_by_Reason_Code'] = percent_time_by_reason_code['Percent_Time_by_Reason_Code'].cumsum() cum_percent_time_by_reason_code['Cum_Percent_Time_by_Reason_Code'] = cum_percent_time_by_reason_code['Cum_Percent_Time_by_Reason_Code'].rename('Cum_Percent_Time_by_Reason_Code') cum_percent_time_by_reason_code['Cum_Percent_Time_by_Reason_Code'] #plot cumulative distribution function of time spent by reason code cum_percent_time_by_reason_code['Cum_Percent_Time_by_Reason_Code'].plot(linestyle='-', linewidth=3,marker='o',markersize=15, color='b') #convert time units on total time by reason code column from default (nanoseconds) to hours total_time_by_reason_code['Total_Time_by_Reason_Code'] = total_time_by_reason_code['Total_Time_by_Reason_Code'].dt.total_seconds()/(60*60) #build dataframe for final overlaid chart df_for_chart = pd.concat([total_time_by_reason_code['Total_Time_by_Reason_Code'], cum_percent_time_by_reason_code['Cum_Percent_Time_by_Reason_Code']], axis=1) df_for_chart #create figure with overlaid Pareto + CDF plt.figure(figsize=(20,12)) ax = df_for_chart['Total_Time_by_Reason_Code'].plot(kind='bar',ylim=(0,800),style='ggplot',fontsize=12) ax.set_ylabel('Total Hours by Reason Code',fontsize=14) ax.set_title('Downtime Reason Code Pareto',fontsize=16) ax2 = df_for_chart['Cum_Percent_Time_by_Reason_Code'].plot(secondary_y=['Cum_Percent_Time_by_Reason_Code'],linestyle='-', linewidth=3,marker='o',markersize=15, color='b') ax2.set_ylabel('Cumulative Frequency',fontsize=14) plt.show()
  4. Hi, I have a strange issue when aggregating data in a histogram. I am counting the number of samples for a signal and aggregate by first using "Year" and the using "Day of the Week" as the aggregation type: This gives me the following histogram with a count of 246 samples for monday in 2012: But these data should belong to sunday. I set up another histogram using the following condition as the second aggregation type: The result now looks like this (which is correct): This is for the other days as well. Is there any way to get around this issue? Installed Seeq version is R21.0.40.01-v201812312325 Regards, Thorsten
  5. There are times when we'd like to view histograms in a monthly view ordered chronologically by the starting month in the display range. This post reviews the results of 3 different methods of utilizing Histogram vs Signal from Condition. All 3 examples show the same results but differ in how the results are displayed. Example 1: This method displays histograms by order of Month, thus, January will show first with December showing last, even though the display range is set from 7/26/2017 - 7/26/2018. As a result, we are not always looking at data in chronological order with this method. Simply goto your Histogram tool, select your signal/condition & statistic, then select Time as aggregation type --> Month of Year. Continue to Execute. Example 2: This method will ensure your Histogram is in chronological order, first ordered by year, then by month. The caveat to this is the spacing of all bars in the display window is not held constant (a gap between years will be observed). Go back to the Histogram tool, select your signal/condition & statistic, then select Time as aggregation type --> Year. After this, select Add grouping. Again, select Time as aggregation type --> Month of Year. Continue to Execute. The color gradient can be changed by changing the main color in the histogram. Individual bar colors can also be changed by clicking the respective color box in the legend (top right of histogram). Example 3: This method will produce equally spaced bars in chronological order with no color gradient. To achieve this, we will use Signal from Condition. First, we need to create our condition. Because we are interested in a Monthly view, we can navigate to our Periodic Condition tool under Identify; Duration-->Monthly (All). Timezone can be specified and any shifts to the resulting capsules can be applied under Advanced. Now that we have our condition, we can proceed to our Signal from Condition tool under Quantify. As with the other examples, select your signal/condition & statistic. The bounding condition will be the Monthly condition we just created. For this use case, we will want our timestamp to be at the start of each capsule (month), and the interpolation method to be Discrete so that bars will be the resulting output. The output may have skinny bars and non-ideal axis min/max. This can be adjusted by clicking Customize in the Details pane. For this example, I used a width of 50, and axis min/max of 0/1.25.
  6. I have several histograms set up to evaluate our process performance based on product criteria. It works great, except for two things... Is there a way I can hide histograms like I can with signals and conditions? I want 14 histograms in my analysis, but with them all displayed at once, it's impossible to see the data. Secondly, is there a way to export the histogram data to Excel (or anything Excel can manage)? Right now I am trying to mouse over each bin result and record it, but that is very time consuming.
  7. While Seeq is working towards enhancing our features in the Histogram tool, here are a simple workaround commonly used to create a histogram for multiple signals with display times in chronological order. Step 1: Start by loading all of the signals we want to include in the matrix into the display. Step 2: Create a monthly condition with a property that split the years and months (YYYY-MM) from the initial date format (YYYY-MM-DDT00:00:00Z) using the formula tool. Formula 1 - month_withProperty $monthly = months("Asia/Kuala_Lumpur") //split the years and month of the data $monthly .move(8hrs) //move based on specific timezone example the timezone used here is UTC+8 .transform($capsule -> $capsule.setProperty('month_year',$capsule.property('start').tostring().replace('/(.*)(-..T.*)/','$1'))) Step 3: Combine the aggregate calculation for the multiple signals in a formula. Formula 2 -combine the aggregate calculations, example here is based on average. //Step 1: calculate monthly average for each signals $monthlyaverageA = $t1.aggregate(average(),$month_withProperty, startKey(),0s) $monthlyaverageB = $t2.aggregate(average(),$month_withProperty, startKey(),0s) $monthlyaverageC = $t3.aggregate(average(),$month_withProperty, startKey(),0s) //Step2: combine all the discrete points and move each signal by 1,2 and 3 hours to have different time stamp. Please refer combinewith() formula documentation. combinewith( $monthlyaverageA.move(1hr), $monthlyaverageB.move(2hr), $monthlyaverageC.move(3hr)) Step 4 : Create condition for each average temperature signals and use setProperty() function to set the naming for each signal. //Step 1: calculate monthly average for each signals $monthlyaverageA = $t1.aggregate(average(), $month_withProperty, startKey(),0s) $monthlyaverageB = $t2.aggregate(average(), $month_withProperty, startKey(),0s) $monthlyaverageC = $t3.aggregate(average(), $month_withProperty, startKey(),0s) //Step2: combine all and create condition for each discrete points and set the property accordingly. combinewith( $monthlyaverageA.move(1hr).toCapsules().setProperty('Mode','Area A'), $monthlyaverageB.move(2hr).toCapsules().setProperty('Mode','Area B'), $monthlyaverageC.move(3hr).toCapsules().setProperty('Mode','Area C')) Step 5: Create the histogram as shown in the screenshot below. The colour for each signal can be changed by selecting the legend box on the top right side of the histogram. For users who would like to split the quarter_year or year_week, please refer to the formula below. Formula to split quarter_year $quarter = quarters(Month.January, 1, "Asia/Kuala_Lumpur") $quarter.move(8hrs)//move based on specific timezone, example used here is UTC+8 .transform($cap -> { $year = $cap.startKey().toString().replace('/-.*/','') $quart = $cap.property('Quarter').toString() $cap.setproperty('Quart',$year+' '+'Q'+$quart)}) Formula to split year_week //Set up formula for $week_counter = (timesince(years("UTC"),1wk)+1).round() //The aim is to add '0' in front of single digit number so that the sequence in histogram 01, 02,....10, $weekLessThan10 = $week_counter < 10 $signal1 = $week_counter.toString() $signal2 = toString('0').toSignal() + $signal1 $new_week_counter = $signal1.splice($signal2,$weekLessThan10 ) $weekly_capsule_embedded_property = $new_week_counter.toCondition() //Setting the year and week property //$year - the function here meant to extract the year //$week - the embedded Value is XX.0wk - remove the .0wk //set new property of year_week $weekly_capsule_embedded_property.removeLongerThan(8d).transform($cap -> { $year = $cap.startKey().toString().replace('/-.*/','') $week = $cap.property('Value').toString().replace('/\wk/','') $cap.setproperty('Year_Week',$year+' '+'W'+$week)}) You can also check this post to create histogram with hourly bins.
  8. FAQ: We have various conditions that are calculated from signals on a variety of different equipment and assets. We would like to view them in a histogram that is broken out by month, and for each month each asset has a separate bar in the histogram. Example Solution: 1. For three signals, we want to create a histogram that is the total time per month spent above some threshold. In this example, each signal is associated with a different cooling tower Area. 2. We have a condition for when each signal is above it's threshold value. These conditions were created using the value search tool. 3. The three conditions can be combined into a single condition (here it is called "Combined In High Mode w Area as Property"). In the formula tool, before combining the conditions, we assign each condition a property called 'Area' and set the value as that particular asset area. Once the properties are set we use the combineWith() function to combine them into one final signal. The formula syntax below will achieve this: //Create a new condition for each original condition that has a property of 'Area'. $A=$AHigh.setProperty('Area','Area A') $G=$GHigh.setProperty('Area','Area G') $I=$IHigh.setProperty('Area','Area I') //Combine the new conditions created into a new condition with all of the high power modes where each capsule //has a property of 'Area' that describes the signal that was searched to identify that original condition. combineWith($A,$G,$I) ***Note: the combineWith() function in Seeq Formula is required here because it will retain capsule properties of individual conditions when combining them. Using union() or any other composite condition type logic will NOT retain the capsule properties of the individual condition.*** 4. Use the Histogram tool and the multiple grouping functionalities to aggregate over both time, and the capsule property of 'Area'. Final Result: (remove other items from the details pane to view just the histogram)
×
×
  • Create New...