Working with Artisan TSV Files

2023-10-07
Follow Along

Download the file I'm using in this tutorial to follow along.

Shortly after the initial release of CRUCS I received a message letting me know about a problem importing CSV files exported from Artisan. I asked for an example file and it quickly became clear that the problem was that this wasn't CSV (Comma Separated Values), but rather TSV (Tab Separated Values). That's almost the same thing and since it's a format in use that's easy enough to add support for, I went ahead and got that feature into an update. The provider (who has asked to remain anonymous) of this file granted permission to use it in a tutorial so let's take a look at opening that file and some things we can do with that.

We start by clicking Import at the top of the page. This brings up a number of import options and the first thing we'll want to do is just take a look at the structure of the file we're working with. There's a button in the Import CSV/TSV section that can be used to select the file we want to open. This fills in the Preview section so we can see where the data we want is.

Here we can see that we have a little information from before the start of the roast and we can choose if we want to preserve that or not by setting our time column either to column 1 if we want to keep that data or column 2 if we don't. There are two temperature columns labeled ET and BT in columns 3 and 4 respectively, and the top row has a few key events. We can see from the first of these that the event times are using column 1, which means that if we want to reference these events in relation to the start of the batch, we'll need to subtract 7 seconds from those times.

Event Time Adjusted Time
CHARGE 00:07 00:00
TP 01:04 00:57
DRYe 05:55 05:48
FCs 09:13 09:06
DROP 11:28 11:21

We can also see that there's a lot of extra data after the end of the batch. If you're using CRUCS to adjust a roasting plan, we probably only want data from when coffee is in the roaster and we're likely more interested in the temperature of the coffee, so we'll set the time column to 2 and the temperature column to 4. For this first import I'm also going to go to the Import Options and set the Sampling Strategy to None. This will bring in every data point in the file, which is terrible if we want to edit the data, but it gives us a way to see exactly what's there whereas other sampling strategies will introduce a bit of error in order to reduce the number of control points on our curve. We could also say we want to start reading data from row 5, but since nothing in column 2 looks like a time until that row, it's fine to leave that as 1. Rows that don't have something that can be interpreted as a time and a temperature in the specified columns will be ignored.

After clicking the Import button we can see some data in the graph, but the rate of change looks very noisy, so let's fix that.

Clicking on Display at the top of the page shows us several options we can use to change the appearance of the graph. For now we want the Rate of Change section. Changing the Calculation Mode from Secant to Windowed Regression already tamps things down quite a bit, but since we only have one measurement every 3 seconds, I'm going to bump up the window to 24 seconds. When changing any setting that has a Set button next to it, remember to click that button to make the setting take effect.

In general, the more measurements there are in the regression window, the less wild the rate will look.

Next, we can hide the data from after the end of the batch. Remembering the events we saw at the top of the file, the last point of interest should be at 11:21, so we can click Data, put that into the Set End Time section, and click the Set button.

Taking a look at the resulting graph, this is starting to look reasonable.

Mousing around in the graph we can confirm that the temperature at the time indicated by our TP event is the minimum value on the curve. Since every measurement has been set as a control point, we can also use the Control Points section to get at measurements for our events.

Event Time Temperature
CHARGE 00:00 300
TP 00:57 150
DRYe 05:48 321
FCs 09:06 386
DROP 11:21 405

Since we're looking at a roast that uses just a bit over half of the horizontal space, we might want to go back to Display and change the Time Axis Settings and set High to 12:00. Click Set and it'll be a little easier to pull measurements from the graph.

Let's go ahead and bring in our other temperature series. Back in the Import section we can just set the temperature column to 3 and click Import again. In the Data section, the value in the Set End Time section is still present so we can click Set to apply that to our newly imported data series. Next, we can go to Layers and change a couple properties to make this a little easier to read.

Here I've unchecked Show Rate since rate of change is less useful for this series, changed the color of that series on the graph, and changed the measurement name. While we're here, we could also click Layer 1 in the bar to the left and change the measurement name there as well.

Now that we have our reference data loaded, we're just about ready to get this in a form that's easier to edit. If we want to model turnaround, it helps to have a few more points that we can read off the graph: the measurements a few seconds before and after turnaround and the point where we have the highest rate of change after turnaround.

Event Time Temperature
CHARGE 00:00 300
TP-10 00:47 152
TP 00:57 150
TP+10 01:07 152
Max Rate 02:21 195
DRYe 05:48 321
FCs 09:06 386
DROP 11:21 405

If you're interested in seeing what some of the other sampling options look like, you could go back to the Import tab, set temperature column back to 4, and change the Sampling Strategy before clicking Import again, but the extra data out past the end of the roast makes these a bit less useful, so instead we'll stick to the Layers tab. On the left there's a New Layer button that we can click to create a new empty data series and change the colors.

Next we can go to Data and use the Insert Point section to specify the time and temperature of the 8 points we've pulled out of the imported data. On most computers and browsers if you're at a keyboard, you can type the time value, press tab to move to the temperature field and type the value there, tab again to select the Insert button, and press the space bar to add that point to the Control Points section while also moving keyboard focus back to the time field, making it very quick to do this kind of data entry.

As soon as 2 points are added, you should start seeing the curve being constructed in the graph.

From here we can see that the roast followed this simplified model quite well with a slightly larger deviation during first crack. Sometimes all we're looking to do when making a plan is just cleaning it up a bit, so we could hide the original data by clicking Layers, then selecting Layer 1 on the left, and unchecking the Visible box in the Visibility section, then repeating that for Layer 2.

Click Layer 3 if you intend to make any other changes to ensure those changes are applied to a visible data series.

Now suppose we want to try doing something different? It can be useful to have our reference plan visible while editing a copy of that. Clicking the Duplicate Layer button will make a copy of the current layer and we can change the colors to make the changes more obvious.

Let's say we want to try speeding up the roast by one minute. Going back to Data and starting with the 3rd from last point in the Control Points section, we can click the Delete button. This removes the point from consideration when generating the curve so you can see what that does to the curve, but it also moves the time and temperature into the Insert Point section. This makes it convenient to edit the time value and click Insert. Repeat that for the last two points.

Taking a look at the resulting graph, we probably want to push the starting temperature a little higher. We could take a guess on temperatures for the first five points and push all of those higher until the graph looks like something achievable on your machine.

In the same way we used the Set End Time section to cut off data we didn't need from our initial import, we can also use that to extrapolate out and see where the roast might end up if we took this initially faster roast and extend it out to the same end time we started from.

Deleting the value in that field and clicking Set again will go back to ending that series at the last control point. Feel free to play around with the control points and see what happens. You can also explore some of the other Display settings. For example, you might want to change the Temperature Axis Settings to have a Low value of 100. If you're used to seeing rate of change in F°/m or F°/s you can change the Denominator in the Rate of Change section to 1:00 or 1 respectively and then adjust the Rate Axis Settings appropriately.

When you're happy with a plan for your next batch, go ahead and hide or delete data series you no longer need. If you want to try roasting with paper logging, you can use your browser's print feature to get a page that you can reference as you roast and write your measurements on.

Alternately, you can save this as a file by clicking on Export at the top of the page.

In the CSV Export section, you can change the file name to something you want and also set the amount of time between exported measurements. The default is 30 seconds, but if you wanted to match the level of detail of the original data, we can set this to 3 before clicking the Save CSV button.

The Typica XML Export section is what you'd use if you wanted to load your new plan into Typica, but this format also saves all of the layer data and control points from CRUCS, including hidden layers. If you think you may want to come back to this plan later and make further adjustments, keeping a copy in this format is recommended.

Make a Contribution

CRUCS is made possible by the generous financial support of people like you. If you found this article useful and interesting or have found that using CRUCS helps you roast coffee better, please consider making a financial contribution.