Jump to content

Thorsten Vogt

Super Seeqer
  • Posts

    176
  • Joined

  • Last visited

  • Days Won

    54

Thorsten Vogt last won the day on July 10

Thorsten Vogt had the most liked content!

5 Followers

Personal Information

  • Company
    Werusys GmbH & Co. KG
  • Level of Seeq User
    Seeq Advanced

Recent Profile Visitors

3,705 profile views

Thorsten Vogt's Achievements

Enthusiast

Enthusiast (6/14)

  • Very Popular Rare
  • Dedicated
  • Reacting Well
  • First Post
  • Collaborator Rare

Recent Badges

105

Reputation

9

Community Answers

  1. Hello Robert, not sure if you can use the ancestors in the "filters" parameter. I think you would need to know the ID of the asset you are looking for and use it in the "asset" parameter of the /items endpoint. Regards, Thorsten
  2. Hi Maria, as your source signal is measured in % you need to make it unitless. Otherwise the calculation will be affected by the units. 70%*70% = 49% in Seeq. So try: $signal = $e325.setunits('') //formula for 0-70 $formula1 = 0.00000095467*$signal ^4 - 0.000077805*$signal ^3 + 0.0012485*$signal ^2 + 0.078885*$signal + 0.019834 $condition1 = $signal <= 70 $result1 = $formula1.within($condition1) //formula for 70-100 $formula2 = -0.00022924*$signal ^3 + 0.0545487*$signal ^2 - 3.99555*$signal + 98.9223 $condition2 = $signal > 70 $result2 = $formula2.within($condition2) //combine formulas $combinedResult1 = $result1.splice($result2, $condition2) $combinedResult1.setUnits('') Regards, Thorsten
  3. Hi Matt, only way I know currently is using the API, which can be called from SDL. As an example I created the following Asset Group: The following script extracts the data from the Asset Group. It needs the ID of the root element, which you can get from within Workbench, and iterates over the underlying items: import seeq.sdk as sdk treesApi = sdk.TreesApi(spy.client) itemsApi = sdk.ItemsApi(spy.client) parent_id = '0EF3492F-A4CE-EE30-BBD7-361933D678D8' tree = treesApi.get_tree(id=parent_id) for child in tree.children: print(f'Items for {child.name}') print() tree = treesApi.get_tree(id=child.id) for child in tree.children: print(f'Name: {child.name}') formulaProperty = [x for x in child.properties if x.name == 'Formula'][0] print(f'Formula: {formulaProperty.value}') dependency = itemsApi.get_formula_dependencies(id=child.id) formula_params = {} for parameter in child.parameters: formula_params[parameter.item.id] = parameter.name for d in dependency.dependencies: text = d.name if d.id in formula_params.keys(): text = text + f' => ${formula_params[d.id]}' for parameter in d.parameter_of: text = text + f' ({parameter.name})' print (text) print('------------') print() print() Output looks like this: Items for First Asset Name: Cold Formula: $t < 70 Temperature => $t (Cold) Area A_Temperature (Temperature) ------------ Name: Events per Day Formula: ($hot or $cold).aggregate(count(), days('CET'), durationKey()) Hot => $hot (Events per Day) Cold => $cold (Events per Day) Temperature (Hot) (Cold) Area A_Temperature (Temperature) ------------ Name: Hot Formula: ($t > 90).merge(20min, true) Temperature => $t (Hot) Area A_Temperature (Temperature) ------------ Name: Rate of Change Formula: $t.agileFilter(20min).derivative('h') Temperature => $t (Rate of Change) Area A_Temperature (Temperature) ------------ Name: Temperature Formula: $signal Area A_Temperature => $signal (Temperature) ------------ Items for Second Asset Name: Cold Formula: $t < 70 Temperature => $t (Cold) Area B_Temperature (Temperature) ------------ Name: Events per Day Formula: ($hot or $cold).aggregate(count(), days('CET'), durationKey()) Hot => $hot (Events per Day) Cold => $cold (Events per Day) Temperature (Hot) (Cold) Area B_Temperature (Temperature) ------------ Name: Hot Formula: ($t > 90).merge(20min, true) Temperature => $t (Hot) Area B_Temperature (Temperature) ------------ Name: Rate of Change Formula: $t.agileFilter(20min).derivative('h') Temperature => $t (Rate of Change) Area B_Temperature (Temperature) ------------ Name: Temperature Formula: $signal Area B_Temperature => $signal (Temperature) ------------ Items for Third Asset Name: Cold Formula: $t < 70 Temperature => $t (Cold) Area C_Temperature (Temperature) ------------ Name: Events per Day Formula: ($hot or $cold).aggregate(count(), days('CET'), durationKey()) Hot => $hot (Events per Day) Cold => $cold (Events per Day) Temperature (Hot) (Cold) Area C_Temperature (Temperature) ------------ Name: Hot Formula: ($t > 90).merge(20min, true) Temperature => $t (Hot) Area C_Temperature (Temperature) ------------ Name: Rate of Change Formula: $t.agileFilter(20min).derivative('h') Temperature => $t (Rate of Change) Area C_Temperature (Temperature) ------------ Name: Temperature Formula: $signal Area C_Temperature => $signal (Temperature) ------------ It displays the formula for each element and the variables assigned to it. In this example Area A_Temperature is included in Temperature, which is part of "Hot" and "Cold". "Hot" and "Cold" are assigned the vairables $hot and $cold and part of the formula of "Events per Day": Name: Events per Day Formula: ($hot or $cold).aggregate(count(), days('CET'), durationKey()) Hot => $hot (Events per Day) Cold => $cold (Events per Day) Temperature (Hot) (Cold) Area A_Temperature (Temperature) Hope this helps. Regards, Thorsten
  4. Hello Chris, you could try this: signal(InterpolationMethod.Step, 1d, sample('2020-01-01T00:00:00Z', 0.002), sample('2024-01-01T00:00:00Z', 0.004)).resampleHold(10y, 1d) This will create a signal based on the two timestamps. By using resampleHold() it will resample the signal to have one value each day and holding the last value for the amount of time you specified. In my example 10years. The duration must be at least the distance between the two datapoints, otherwise you will have a gap in your signal. If you do not want to have values in the future you can extend the formula by adding .within(past()) at the end. Regards, Thorsten
  5. Hello, you might want to check the following way: As you need to specify which is the first capsule you want to start with you need to define a bounding condition. In my example I use a monthly condition to do the calculation: Next I created a signal that puts the value 1 at the start of each capsule: $condition.removeLongerThan(40h).toSamples($c -> sample($c.startKey(), 1), 0s) This signal is used to build the running sum of these values: The calculated value can be used to extend the original condition with a property containing the capsule number during each month: $condition.removeLongerThan(1d).setProperty('Capsule Number', $count, startValue()) Then two new conditions can be created to include only capsules with odd and even capsule numbers: $conditionWithCount.keep($c -> ($c.property('Capsule Number')/2)-floor($c.property('Capsule Number')/2) > 0) $conditionWithCount.keep($c -> ($c.property('Capsule Number')/2)-floor($c.property('Capsule Number')/2) == 0) A composite condition can be used to join the odd and even ones: Hope this helps. Regards, Thorsten
  6. Hi Kevin, you can use the Formula tool to calculate the value. The function setUnits sets the unit of the resulting signal to m³. Regards, Thorsten
  7. Hi, you can do this by using splice(). The following example takes 10 as the default value and changes the part of the signal to 15 or 22 based on the value of the batch id. If the lot number you mentioned is a property of the capsule you imported you might need to convert it to a signal using toSignal() and the property name that is used to store the lot number: Or filter for capsules that contain the lot number using keep() on the condition: You can check your capsules for existing properties by having a look at the Capsules Pane. When clicking the "Add Column" icon you are able to choose the properties from the dropdownlist of available properties. The name of the property can be used in the functions mentioned above. Regards, Thorsten
  8. Hello Bill, if you do not have Data Lab than you can use the REST API of Seeq. I created an example using Powershell: $baseurl = "https://myseeqinstance" $headers = @{ "accept" = "application/vnd.seeq.v1+json" "Content-Type" = "application/vnd.seeq.v1+json" } $body = @{ "authProviderClass" = "Auth" "authProviderId" = "Seeq" "code" = $null "password" = "<password>" "state" = $null "username" = "<username>" } | ConvertTo-Json $url = $baseurl + "/api/auth/login" $response = Invoke-WebRequest -Method Post -Uri $url -Headers $headers -body $body $headers = @{ "accept" = "application/vnd.seeq.v1+json" "x-sq-auth" = $response.Headers.'x-sq-auth' } $url = $baseurl + "/api/users?sortOrder=email%20asc&offset=0&limit=200" $response = Invoke-RestMethod -Method Get -Uri $url -Headers $headers $selectedAttributes = $response.users | Select-Object -Property firstname, lastname, email $selectedAttributes | Export-Csv -Path "userlist.csv" -NoTypeInformation The script uses the /auth/login endpoint to authenticate the user and retrieves the list of users (limited to 200) using the /users endpoint. You would need to replace the value in the first line with the URL of your Seeq system (eg. https://mycompany.seeq.site) and specify the credentials by replacing <password> and <username> inside the script. The list of users will be written to the file userlist.csv inside the directory from which the powershell script is run. Let me know if this works for you. Regards, Thorsten
  9. Hi Brian, you can use the timesince() function for this: years('CET').timesince(1h, $uptime.inverse()) The example above creates a signal representing the running amount of hours for each year putting a sample every 1 hour. The last parameter specifies that periods where the uptime condition is not met are excluded from the calculation. In the follwowing screenshot you can see the signal is only increasing if a capsule for my uptime condition exists, otherwise the value does not change. Furthermore the value will be reset to 0 at January 1st every year: Does this answer your question? Regards, Thorsten
  10. Hi Dayyan, instead of months() you can use the periods() function: periods(6mo, 6mo, '2023-01-01', 'CET') The code above creates a capsules with a duration of 6 months every 6 months using the CET timezone. The timestamp specifies the origin that the capsules should be aligned to. Regards, Thorsten
  11. Hi Alex, maybe one workaround you could try is creating capsules for the discrete signal using $signal.tocapsules(). The capsules do not have duration, but will contain the value of the signal in a capsule property. Then export the Condition using OData and use the OData Capsule Summary Table Endpoint. I do not have Power BI, but when loading the data to Excel I can see the start of the capsule and the corresponding value. So this might be the information you can use. Regards, Thorsten
  12. Hello Bill, one way I can think of is using a little python script inside Seeq Data Lab: import seeq.sdk as sdk import pandas as pd user_api = sdk.UsersApi(spy.client) userlist = user_api.get_users() users = list() for user in userlist.users: users.append({"Username": user.username, "First Name": user.first_name, "Last Name": user.last_name, "Directory": user.datasource_name}) pd.DataFrame(users).to_excel("userlist.xlsx") You might need to run pip install openpyxl first and restart the kernel, if you get an error message that the package could not be found. The Excel file will appear in the rootfolder of your DataLab project and can be downloaded from there. I tested the script on R61, so I am not sure if you need to modify it a bit to get it working with R58. Regards, Thorsten
  13. Hi Jason, this might be due to uncertainty. You may have a look at this post: Regards, Thorsten
  14. Hi Swapnil, you can calculate the average for these periods using the runningAggregate function. I created the 12 hour periods with the following formula: periods(12h, 12h, '2023-01-01T08:00:00', 'CET') This condition is then used inside the aggregation of the signal: $signal.runningAggregate(average(), $periods) The result will be the average value of the signal that resets at the beginning of each capsule: I am not sure what you want to display in the table? Just the last value for the current period? Regards, Thorsten
×
×
  • Create New...