SAEON / somisana

SOMISANA-related tooling
MIT License
2 stars 2 forks source link

Contouring function sometimes errors for False Bay Forecast #25

Open zachsa opened 1 year ago

zachsa commented 1 year ago

Sometimes the False Bay Forecast contours don't generate with correct values

Sometimes the page draws this (broken) image

But a couple time steps on and things start working again - and looking like this image

Comparing the data between a page that renders and a page that doesn't, it isn't immediately obvious what the difference is. To debug this the broken data must be compared to the working data

Broken example

dataName = 'data-that-breaks-things.json'
resultName = 'contours-from-data-that-breaks-things.json'

const width = 89
const height = 77
const polys = contours().thresholds(50).size([width, height])(data)

Working example

dataName = 'data-that-works.json'
resultName = 'contours-from-data-that-works.json'

const width = 89
const height = 77
const polys = contours().thresholds(50).size([width, height])(data)

Here are the data files (Google Drive)

There are also usually frames where there are holes in the contours:

image

zachsa commented 1 year ago

This looks like it may be related (TBC). https://github.com/d3/d3-contour/issues/49