WebPlotDigitizer icon indicating copy to clipboard operation
WebPlotDigitizer copied to clipboard

Feature Request: Support Hygrothermograph cylindrical chart digitizing.

Open DougSchmidt-AI opened this issue 4 years ago • 4 comments

Museums and environmental stations often use a cylindrical 2-axis recorder called a hygrothermograph. The cylinder slowly rotates (once a month, once a week, once every 3 months, depending upon the device model).

Two strips per chart record two time-series: The top strip records temperature and the bottom strip records relative humidity.

image

When the chart is removed from cylinder, the paper contains two time-series, both of which are distorted by the round-is-now-flat effect.

OaktronHygroThermoGraphPaper

WebPlotDigitizer cannot current accurately digitize either time-series, due to the distortion at the extremes of each axis.

It seems like WPD could do the digitizing, if some extra calibration points were added. For each strip on these 2-strip charts:

  • Select the four corners of the strip (just like the current axis calibration step)
  • Select the vertical points along one axis, to get a horizontal displacement.
  • For the temperature strip (top of chart), that would mean 13 extra calibration points, in 5 degree Celcius increments, from -10 degC to +50 degC.
  • For the humidity strip (bottom of chart), that would mean 11 extra calibration points, in 10% increments, from 0% to 100%.

With these extra horizontal-displacement calibration points, WPD would then have enough information to transform pixel coordinates to measured values.

DougSchmidt-AI avatar Jul 20 '20 16:07 DougSchmidt-AI

Commenting on this interesting suggestion to expand the scope, some of the mechanical barographs equally use paper on a cylinder with this kind of distortion along the time axis which contrasts with the mechanical seismographs:

318px-Barograph (source)

On the other hand, I speculate the number of reference points for temperature / humidity mat be lower than a dozen. For one, these smooth arcs are parallel to each other; similar to the sun's apparent path as seen on earth's ground, these could be defined e.g. with one reference at 0%, at 50%, and 100%.

To account for the present distortion, I briefly thought about the manual dewrapping offered by scantailor where the user may adjust a reference net:

intermediate_mask_2_050

However, this tinkering approach requires the definition of two reference arcs not too far away and still yielding results not always as good as hoped for:

test

As an intermediate solution outside the digitizer, maybe the separation of the traces (one for humidity, one for temperature) may be automated in a mask-like manner (e.g., ImageMagick) followed by one of the commands at hand affecting the dimension of this intermediate image (e.g., distortions, warping). These resulting files possibly would provide reliable input data for the digitizer here.

nbehrnd avatar Jul 21 '20 17:07 nbehrnd

Thanks for the pointers to ImageMagick @nbehrnd I had used that tool a decade ago in a different job, so I might able to hack something together as a pre-processing step.

DougSchmidt-AI avatar Jul 21 '20 19:07 DougSchmidt-AI

With some distance to the question, I think for now the digitization of these charts possibly may be resolved with better numerical resolution if the originals (scans, photos) only are 1) cropped to yield either one of the parameters (humidity, or temperature), 2) submitted to the digitizer as «normal» (x,y)-plots, and 3) digitizer's results in the .csv are processed further by a transformation of coordinates. In addition to the «normal» transformation between polar and cartesian coordinates, the recording paper moves, though.

Starting with the original two-trace data, the batch wise cropping of either one may performed with a predefined region, possibly in batches. This is a task for imagemagick, or wth a GUI program like IrfanView, or Xnview.

I suggest then to read the single-trace images as an (x,y)-plot in the digitizer. The reference cartesian coordinate system intentionally shall be moved such that the abscissa at half-level of the underlying plot:

alternative_detail

The image shared by you was imported into inkscape, with the resolution by the .jpg and stored as a multilayer .svg file (see attached archive SI.zip). In a first approximation, the radius of the circles on the paper equates 20 cm. Recalling the recorders seen in the museums' corners, this indeed could be the length of the lever holding the pen. To display the concept, x1 and y1 are superimposed as origin of digitizer's cartesian coordinate system, with y2 @ 100% humidity at 5 cm above, and x2 32 cm to the right in regard to this reference.

Processing digitizer's data further could be scripted, taking into account that the position of a point, e.g. the dotted in blue, then may be expressed both by (x,y)-coordinates as by the digitizer, or in polar coordinates (radius, angle phi):

example

With the centre of the large circle, its radius and digitizer's provision of ordinate y, the angle between the abscissa, the centre of the circle, and the blue dotted dot is known: y/radius rho = sin(angle phi). The relation of x/radius rho = cos(angle phi) provides a correction factor for passing from digitizer's abscissa to the polar coordinate system (for day 3, x for y = 90% is not the same as for y = 50%; but because the abscissa is set at 50%, like a plane of mirror, the correction factor to apply for 90% is the same as for 10%). What remains to do is to increment the dotted 20 cm-circle's from the left to the right to read out the humidity / temperature data in function of the the time, yet with the constant correction that its centre is ahead of the time where its circurmference intersects with the digitizer's abscissa.

SI.zip

nbehrnd avatar Jul 22 '20 12:07 nbehrnd

I do think that we could find an easy way to convert the coordinates of the picture (x,y) into Cartesian coordinates (u,v) using the following relationships:

The calibration should then determine the value of y0, R and β. It is doable with only two points B and D as shown in the picture: Approximation

Point D(x0,y0) should be placed where the two axis cross with a 90° angle i.e. on the lefter point of one ordinate axis of the chart. Point B(x1,y1) should be placed on the same ordinate axis as D, but at any other position. Preferably the furthest away from D.

From those points, we have:

Guillaume-Duc-95 avatar Nov 13 '21 11:11 Guillaume-Duc-95