  We present an efficient implementation of Wiener filtering of real-space
linear field and optimal quadratic estimator of its power spectrum Band-powers.
We first recast the field reconstruction into an optimization problem, which we
solve using quasi-Newton optimization. We then recast the power spectrum
estimation into the field marginalization problem, from which we obtain an
expression that depends on the field reconstruction solution and a determinant
term. We develop a novel simulation based method for the latter. We extend the
simulations formalism to provide the covariance matrix for the power spectrum.
We develop a flexible framework that can be used on a variety of cosmological
fields and present results for a variety of test cases, using simulated
examples of projected density fields, projected shear maps from galaxy lensing,
and observed Cosmic Microwave Background (CMB) temperature anisotropies, with a
wide range of map incompleteness and variable noise. For smaller cases where
direct numerical inversion is possible, we show that our solution matches that
created by direct Wiener Filtering at a fraction of the overall computation
cost. Even more significant reduction of computational is achieved by this
implementation of optimal quadratic estimator due to the fast evaluation of the
Hessian matrix. This technique allows for accurate map and power spectrum
reconstruction with complex masks and nontrivial noise properties.
