# Any pixel of the Sinop cube, as a time series

The recorded sits_get_data() output for every pixel of the sits book's Sinop MODIS window, a separate dataset from this journey's Cerrado point: any pixel's series, the values the record marks as filled, and the row sits makes of it.

[From step 2 of From a cube to labelled samples](/time-series.md).

In the sits book: [Basic operations on image time series](https://e-sensing.github.io/sitsbook/ts_basics.html).

Choose a pixel with a click, a tap or the arrow keys, switch the band, and read its series and the row sits returns for it.

## The figure

Recorded Sinop MODIS values from the sits book's example, imported into this site's pipeline; separate from the journey's Cerrado point. Hollow marks are values the record marks as filled.

Recorded Sinop MOD13Q1-6.1 window, tile 012010, a separate dataset from the journey's Cerrado point: the values sits_get_data() returned for each of its 27,550 pixels (190 × 145) over 23 dates from 14 Sep 2013, imported into this site's pipeline. The figure shows the window as one band in grey; a click, a tap or the arrow keys choose a pixel (Shift moves by 8, Home and End to the ends of its row). Beside it, that pixel's series, with hollow dots where the record marks a value as filled, and the row sits makes of it. Buttons choose the band (EVI, NDVI). Away from the book's pixel, the place given to sits is the centre of the pixel; no label is given.

It opens on the book's point, in col 72 · row 5:

| longitude | latitude  | start_date | end_date   | label   | cube        |
| --------- | --------- | ---------- | ---------- | ------- | ----------- |
| -55.5732  | -11.50566 | 2013-09-14 | 2014-08-29 | NoClass | MOD13Q1-6.1 |

| Date       | EVI            | NDVI           |
| ---------- | -------------- | -------------- |
| 2013-09-14 | 0.210          | 0.378          |
| 2013-09-30 | 0.555          | 0.721          |
| 2013-10-16 | 0.471          | 0.773          |
| 2013-11-01 | 0.234          | 0.413          |
| 2013-11-17 | 0.435 (filled) | 0.565 (filled) |
| 2013-12-03 | 0.637 (filled) | 0.716 (filled) |
| 2013-12-19 | 0.838          | 0.868          |
| 2014-01-01 | 0.838          | 0.868          |
| 2014-01-17 | 0.918          | 0.828          |
| 2014-02-02 | 0.734          | 0.892          |
| 2014-02-18 | 0.463 (filled) | 0.602 (filled) |
| 2014-03-06 | 0.192          | 0.312          |
| 2014-03-22 | 0.245 (filled) | 0.387 (filled) |
| 2014-04-07 | 0.298          | 0.462          |
| 2014-04-23 | 0.491          | 0.699          |
| 2014-05-09 | 0.417          | 0.643          |
| 2014-05-25 | 0.332          | 0.582          |
| 2014-06-10 | 0.259          | 0.487          |
| 2014-06-26 | 0.224          | 0.429          |
| 2014-07-12 | 0.202          | 0.385          |
| 2014-07-28 | 0.202          | 0.354          |
| 2014-08-13 | 0.153          | 0.268          |
| 2014-08-29 | 0.158          | 0.275          |

### How it was made

1. Read the Sinop run record: The pipeline verifies the recorded Sinop MODIS run. Its original settings and historical checks stay recorded; exporting it does not repeat the upstream queries.
2. Write the files: The pipeline writes the files the website reads, each with a record of its sources and of how closely a rerun repeats it.

### Reproducibility details

- A rerun on aarch64-apple-darwin23 gave the same files, byte for byte.

Every step of the pipeline:

1. Identifies the frozen Sinop run record. `"records/sinop/54e558b03b21c63b19975fe6ba57499e6cd9056edc1d0c4b17066521c32355f9.rds"`
2. Validates the recorded Sinop bytes, settings and axes. `samples_sinop_read(sinop_record_file, list(kind = "recorded", path = "records/sinop/54e558b03b21c63b19975fe6ba57499e6cd9056edc1d0c4b17066521c32355f9.rds", bytes = 3902468, sha256 = "54e558b03b21c63b19975fe6ba57499e6cd9056edc1d0c4b17066521c32355f9"))`
3. Writes the recorded Sinop metadata and historical checks. `site_write_json(samples_sinop_json(sinop_record), "../web/src/data/series-years.json")`
4. Writes the recorded Sinop band/date/row/column values. `samples_sinop_write(samples_sinop_arrays(sinop_record)[["cube"]], "../web/public/data/series-years-cube.bin", "int16")`
5. Writes the original Sinop missing-band bits. `samples_sinop_write(samples_sinop_arrays(sinop_record)[["mask"]], "../web/public/data/series-years-mask.bin", "uint8")`

The files:

- `series-years.json`: SHA-256 `3d7c36679bc522ee19086c2d83c8457d3ce2bfff32dfbbb925f0ca6b39a32a21`. A rerun on aarch64-apple-darwin23 gave the same file, byte for byte.
- `series-years-cube.bin`: SHA-256 `0f859282719a5c54311a8b765c97b8bad523051b867ba9eab984f80d194a7fa4`. A rerun on aarch64-apple-darwin23 gave the same file, byte for byte.
- `series-years-mask.bin`: SHA-256 `a0f239af87fe5062284f20bb68b879f2bc93331c364e05fb2c261659b6426805`. A rerun on aarch64-apple-darwin23 gave the same file, byte for byte.

To make them again: `cd pipeline && Rscript make.R`.

## What to try

1. **Leave the book's point.** Click a light pixel, then a dark one, or move with the arrow keys: Shift moves 8 pixels, Home and End go to the ends of the row. The series changes shape, and the row keeps the place given to sits and the label sits writes when it is given none. *The book's point* brings you back.
2. **Find the filled values.** A hollow dot on the line is a value the record marks as filled. The line over the figure counts them for the pixel and the band.
3. **Switch the band.** The image and the line change; the row stays the same, because it holds every band.
