Skip to content

Instantly share code, notes, and snippets.

@miguelmartin75
Last active May 23, 2020 07:59
Show Gist options
  • Save miguelmartin75/9826995ec572fb29f2dcef59831bba94 to your computer and use it in GitHub Desktop.
Save miguelmartin75/9826995ec572fb29f2dcef59831bba94 to your computer and use it in GitHub Desktop.
(approximate) cup change (and tablespoon + teaspoon) for developing film with US cup for Rollei Colorchem C-41 kit

Chemicals

Rollei Colorchem C-41 kit Manual

This is converted for for US measurements. I will also have my develop times on here.

Colour Developer Mixing Instructions (Converted)

Page 7 of the manual converted. This assumes you have the following US-based measurement devices:

  • US cup (1, 1/2, 1/3, 1/4, 1/8)
  • US tablespoon (1, 1/2)
  • US teaspoon (1, 1/2)

Used the script in the gist, it's basically coin change (DP). It's not perfect, but it's pretty close.

We can't make some measurements exactly, so expect for there to be a difference; but this shouldn't be a big deal because even pouring is error prone (due to human and tool inaccuracies).

I've tried to minimise the amount of cups/instruments used. Hence why I've done it via coin change.

mL what to use error (mL)
50mL 1/8 cup
tablespoon
teaspoon
-0.625mL
100mL 1/3 cup
tablespoon
teaspoon
-1.25mL
200mL 1/2 cup
1/3 cup
1/2 teaspoon
-0.03125mL
600mL 2 cups
1/2 cup
1/2 tablespoon
-0.09375mL
800mL 3 cups
1/8 cup
1/4 cup
-0.125mL
950mL 4 cups
-2.0mL

NOTES:

  • 50mL and 100mL would be more accurate if we had 1/6 and 1/12 of cup, but I don't so :p
Name Water (25-45 celcius; 77F - 104F) Part A Part B Part C
Color developer 800mL 100mL 50mL 50mL
Bleach (fixer) 600mL 200mL 200mL
Stablizer 950mL 50mL

Develop Times

TODO

# usage:
# python3 coin_change.py
import sys
from collections import defaultdict
CONVERT_TO_INTEGER = 100000
measurements = {
"1cup": 237,
"1half_cup": 118.5,
"1quarter_cup": 59.25,
"1third_cup": 79,
"1eighth_cup": 29.625,
"2tablespoon": 14.8125,
"2half_tablespoon": 7.40625,
"3teaspoon": 4.9375,
"3half_teaspoon": 2.46875,
#"quarter_teaspoon": 1.234375,
}
cup_names = {
"1cup": 'cup',
"1half_cup": '1/2 cup',
"1quarter_cup": '1/4 cup',
"1third_cup": '1/3 cup',
"1eighth_cup": '1/8 cup',
"2tablespoon": 'tablespoon',
"2half_tablespoon": '1/2 tablespoon',
"3teaspoon": 'teaspoon',
"3half_teaspoon": '1/2 teaspoon',
}
for key, value in measurements.items():
measurements[key] *= CONVERT_TO_INTEGER
measurements[key] = round(measurements[key])
# ensure we have the proper conversions
# to simplify the devices used
assert(measurements["1cup"] == 2*measurements["1half_cup"])
assert(measurements["1cup"] == 4*measurements["1quarter_cup"])
assert(measurements["1cup"] == 3*measurements["1third_cup"])
assert(measurements["1cup"] == 8*measurements["1eighth_cup"])
assert(measurements["2tablespoon"] == 2*measurements["2half_tablespoon"])
assert(measurements["3teaspoon"] == 2*measurements["3half_teaspoon"])
assert(measurements["1cup"] == 16*measurements["2tablespoon"])
assert(measurements["1cup"] == 48*measurements["3teaspoon"])
def cup_change(to_make):
to_make *= 100000
coins = [1000000000] * (to_make+1)
solution = [None] * (to_make+1)
coins[0] = 0
for x in range(1, to_make+1):
for name, c in measurements.items():
if x - c >= 0 and coins[x - c] + 1 < coins[x]:
coins[x] = coins[x - c] + 1
solution[x] = name
val = max([i for i, v in enumerate(range(to_make + 1)) if solution[v] is not None])
initial_val = val
cups = []
result = 0
while val > 0:
measurement_used = solution[val]
result += measurements[solution[val]]
val -= measurements[solution[val]]
cups.append(measurement_used)
errorML = (result - to_make) / CONVERT_TO_INTEGER
return cups, errorML
if __name__ == '__main__':
# print everything in markdown pls
print('| mL | what to use | error (mL)')
print('|:---|:------------|:------------')
for mL in [50, 100, 200, 600, 800, 950]:
coins, error = cup_change(mL)
coins = sorted(coins)
coins_counts = defaultdict(int)
for coin in coins:
coins_counts[coin] += 1
coins_as_str = ''
for coin, amount in coins_counts.items():
# only aggregate whole measurements
name = cup_names[coin]
if amount > 1 and (name == 'cup' or name == 'teaspoon' or name == 'tablespoon'):
coins_as_str += (f'{amount} {name}s')
else:
coins_as_str += (f'{name}')
coins_as_str += '<br>'
print(f'| {mL}mL | {coins_as_str} | {error}mL | ')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment