On large round engines this is how they calculate horsepower at any stage of flight to include take off.
First the engine must be equipped with a BMEP gage. BMEP is the Brake Mean Effective Pressure inside the cylinder.
To calculate horsepower the flight engineer will use a formula known as PLANK.
P= Prerssure or BMEP
L=Length of the piston stroke
A=Area of the piston
N=Number of cylinders
K=A "K" factor for that particular engine type
In a chain multipication of each of the elements the flight engineer can determine engine horsepower output.
At least that is what I remember from mechanics school back in 1949