Note: extent=(-r,r,-r,r) option in imshow.
For the "mask: want patterns like this:
0 0 0 1 1 1 0 0 0 1 1 1 0 ... 1 0 0 0 1 1 1 0 0 0 1 1 1 ... 1 1 0 0 0 1 1 1 0 0 0 1 1 ... 1 1 1 0 0 0 1 1 1 0 0 0 1 ... 0 1 1 1 0 0 0 1 1 1 0 0 0 ... 0 0 1 1 1 0 0 0 1 1 1 0 0 ... ...
You requested threadcount details from The Scottish Register of Tartans website for the Argyll Campbell tartan. The details are given below. Threadcount: B4K4B36K40G36W8G36K40B34K6 Pallet: B=2C4084BLUE;K=101010BLACK;G=005020MOD GREEN;W=E0E0E0WHITE; Threadcount given over a half sett with full count at the pivots. You may wish to refer to the threadcount guidance section for further information on threadcounts.
d = {'apple':'round crispy fruit', 'banana':'long yellow fruit'}
d['apple']
'round crispy fruit'
dictionary comprehensions
int('F8',16)
Exercise: make a color look-up table
a pattern-matching syntax
import re threadcount = 'B4K4B36K40G36W8G36K40B34K6' colors = re.findall('[A-Z]' ,threadcount) counts = re.findall('[0-9]+',threadcount)
Regular expressions are explored in more depth in MTH 448 Data-Oriented Computing for Mathematicians (Fall 2018).