<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
Step1:  Write a Jython function for IDV and export as IDV Formula in GUI
Define a function  to calculate Moist Static Energy from Temperature, Specific Humidity and Geopotential Height.
Step2:  Above function was created for use in this session, it will not be available for IDV in next session so let us save it to the IDV Jython library.
Step3:  Create a IDV formula, once created it will be in the list of formulas in IDV. The arguments to saveFormula are  (formulaid,description,functionastring,formula categories). formula categories can be a list of categories or just a single category specified by a string.
Step4:  Check if the formula was created in IDV GUI . At anytime to show a IDV window from notebook use function showIdv(). Currently some displays cannot be made when using GUI from notebook, will be implemented in future.
<ASSISTANT_TASK:>
Python Code:
def moistStaticEnergy(T,Q,GZ):
     Calculates Moist Static Energy with Temperature, Specific Humidity and Geopotential Height. 
    from ucar.visad.quantities import SpecificHeatCapacityOfDryAirAtConstantPressure,LatentHeatOfEvaporation
    cp=SpecificHeatCapacityOfDryAirAtConstantPressure.newReal()
    L=LatentHeatOfEvaporation.newReal()
    return cp*T+L*Q+Z
Explanation: Write a Jython function for IDV and export as IDV Formula in GUI
Define a function  to calculate Moist Static Energy from Temperature, Specific Humidity and Geopotential Height.
End of explanation
saveJython(moistStaticEnergy)
Explanation: Above function was created for use in this session, it will not be available for IDV in next session so let us save it to the IDV Jython library.
End of explanation
saveFormula("Moist Static Energy","Moist Static Energy from T, Q, GZ","moistStaticEnergy(T,Q,GZ)",["Grids","Grids-MapesCollection"])
Explanation: Create a IDV formula, once created it will be in the list of formulas in IDV. The arguments to saveFormula are  (formulaid,description,functionastring,formula categories). formula categories can be a list of categories or just a single category specified by a string.
End of explanation
showIdv()
Explanation: Check if the formula was created in IDV GUI . At anytime to show a IDV window from notebook use function showIdv(). Currently some displays cannot be made when using GUI from notebook, will be implemented in future.
End of explanation
<END_TASK>