This question asks whether we can define the temperature in terms of the Gibbs entropy in the case of the canonical ensemble. In this question I want to ask whether we can define temperature in terms of Gibbs entropy in general, by choosing the maximum entropy ensemble consistent with a set of macro-variables.
First, Let $p$ be a ensemble, or distribution over micro-states $S$ of a system. Define the Gibbs entropy of the ensemble as $H(p)= -\sum_ip_i \log(p_i)$. Now assume we have a set of macro-variables $\mathcal V$, such as energy, i.e. $E \in \mathcal V$. For a given value $V=(E,...)$ of the variables, let $H(V)= \max_{p\in P_V}H(p)$, where $P_V$ is the set of distributions $p$ such that $\sum_ip_i E_i=E$, where $E_i$ is the energy in microstate $i$, and similarly for the other variables in $\mathcal V$.
Then define temperature as the derivative of "maximum entropy" w.r.t. energy:
$$\frac 1 T = \frac {\partial H(V)}{\partial E}$$
Is this a correct general way to define temperature?