Sampling cubemap at regular angular intervals

I used the following two shaders: vertex shader,

#version 330 core
layout (location = 0) in vec3 aPos;

uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;

void main()
    gl_Position = projection * view * model * vec4(aPos, 1.0);

and fragment shader,

#version 330 core

void main(){
    gl_FragDepth = gl_FragCoord.z;

to generate a depth cubemap (see link). I want now to sample this depth cubemap at user provided (vertical and horizontal) angular intervals in order to generate a 2D depth image (where x represents horizontal angles and y vertical angles and the value of each pixels is the depth). However, I am a bit lost as to how to proceed. After I created the cubemap (after rotating my camera 6 times), how would I sample so that I cover certain vertical and horizontal angular ranges at a particular angular increment?