I updated the docstring to indicate that giving `dx`,`dy` as functions of wavelength is allowed and updated the code accordingly.  Interestingly, `dx = lambda w: dx` leads to an infinite lambda loop, so you have to assign a temporary name to the original dx value before reassigning the dx name to the lambda expression:
```
    tmpdx = dx
    dx = lambda w: tmpdx
```