A method is described to extract a complete set of sequence-dependent material parameters for rigid base and basepair models of DNA in solution from atomistic molecular dynamics simulations. The method is properly consistent with equilibrium statistical mechanics, leads to effective shape, stiffness and mass parameters, and employs special procedures for treating spontaneous torsion angle flips and H-bond breaks, both of which can have a significant effect on the results. The method is accompanied by various analytical consistency checks that can be used to assess the equilibration of statistical averages, and different modeling assumptions pertaining to the rigidity of the bases and basepairs and the locality of the quadratic internal energy. The practicability of the approach is verified by estimating complete parameter sets for the 16-basepair palindromic oligomer G(TA)(7)C simulated in explicit water and counterions. Our results indicate that the method is capable of resolving sequence-dependent variations in each of the material parameters. Moreover, they show that the assumptions of rigidity and locality hold rather well for the base model, but not for the basepair model. For the latter, it is shown that the non-local nature of the internal energy can be understood in terms of a certain compatibility relation involving Schur complements.