A description for how visibility weights are defined and calibrated in CASA is available in this memo and as an appendix in the CASA Documents from version 4.2.2 onwards.
More information can be found in the Data Weights And Combination CASA Guide.
Note: The treatment of weights depends on which version of CASA is used.