Finding Atlas regions for top X% of sources

I want to do the above operation using scripting.