Could probably pretty much just copy from BayesHopper, which already has this here: https://github.com/bencebecsy/BayesHopper/blob/2c751c7d91381dbb7628561e492b659a14202be7/BayesHopper.py#L1168
Probably will be very helpful too, since it helps with sky location and frequency which are all shape parameters