This script (astropy/coordinates/tests/accuracy/generate_ref_ast.py) is currently non-trivial to run, so in #16976, I added detailed instructions for it. However, I also noted that an upstream PR might make it much easier to run in the near future:
Starlink/starlink-pyast#45
This issue is a reminder to follow up on that and simplify the instructions from #16976 when possible.