There is no (implementable) experimental procedure for doing this, and the main reason is that the thing you want to do isn't well-defined (but I'll try to define it sort of, with the goal of making such an experiment be useful). There is a trivial way to get F0, so in that sense you can always come up with a numeric value. But what you want is a reduction of continuous pitch to certain ranges, let's say 5 intervals (it should be 6 for purposes of linguistic contrast, but whatever). One way to do this is to divide the possible range of human voices into 5 bands. However, it is a fact that in some languages, pitch range tends to be high and in other languages it tends to be low, so you could come to the absurd conclusion that all tones are 1 in Chinese and 5 in Bari.
An alternative would be to compute an observed range for a language (90% of all F0 values in a corpus fall within that range), and then divide into 5 bands. You still get the same absurd result that speaker A has only tone 1 and speaker B has only tone 5. You can continue to narrow the subject pool, so that you only look at one speaker and determine his/her range, and then mark individual words for that speaker in terms of their absolute pitch numbers (scaled down to 5). You might (should) also use a non-linear scale to map F0 to numbers, because a 10 Hz difference at around 100 Hz is perceptually much bigger than a 10 Hz difference at around 400 Hz.
This doesn't tell you anything about tones, though – you'd need an independent determination of what the tones of the language are (tone is a phonological, contrastive concept). There are a lot of physical properties that go into tone: not just F0, but also movement of F0 and phonatory properties (especially in SE Asian languages). Still, you can set that aside, if the interest is just pitch. Mandarin is a good example of the ambiguity of tone counting: it has 4 holistic "tones", and 3 levels. This is pretty common, that you have to specify the target points (H, L, M... what the numbers are about), and the transitions (rising, falling, level). The linguistic numbering systems do that by specifying e.g. "52" meaning starts at level 5 and ends at level 2. But you have to first do a phonological analysis, to determine if there is a "52" tone in a language that contrast with a "51" or "42" and so on.
Suppose you have the analysis, and you know there is a H, L, M, and contours ML and LH. Now the goal is to turn those tone categories into something closer to physical, namely the pitch numbers that you got by dividing H0 into 5 bands. The more bands you have, the more accurate your tone-to-pitch mapping will be, but let's stick to 5. You have to parse the stream of pitch integers to tone-marked syllables so that you know for instance that the pitch of a given ML syllable is (using "5 is highest" numbering) "4 3 3 2 2 2 1 1 1 1". This comes from directly scaling F0 measurements as you get them from Praat, for instance (evenly spaced).
Now you need to compute the "first" and "last" pitch value, since the goal is to reduce the pitch trace even more, to just two specifications. There is a huge problem with figuring out a meaningful answer to the question "what is the initial pitch". Do you adjust away from consonants to avoid pitch artifacts (lowering after voiced obstruents, raising after voiceless)? Do you just take the first and last points and assume that the bulk of points in between aren't actually essential? Do you divide the points evenly and compute the mean? (If the syllable has 3 tone points, get the mean in thirds; if it is level take the mean of all points)? I'd suggest the latter: divide the pitch points evenly according to how many phonological targets there are. Round the results. Then you can say that in the aforementioned syllable, there is a 31 tone, implementing the category ML.
What this basically does is massively reduces the data which is a raw F0 trace, to something more symbolic. The next question would be, and what does this show you? It would be inferior to an actual pitch trace, in obscuring many important details of tone implementation (remedy: expand the range of tone integers to 10). It still requires you to know what the phonological tones of a language are, although it does solve the "Chinese" puzzle that a falling tone can be judged to be 53, 42, 52 and various other numbers (and: it is documented that different researchers into Chinese actually assign different numbers for the same dialect).
As an experiment related to understanding pitch perception, this could be extremely useful if done systematically and with sensitivity to the variation that exists in human languages. Or it could be used as a Chinese-specific calibration technique. AFAIK, the absolute-number approach used in Chinese studies does not exist in Meso-America, so if a language has 3 levels then only 1,2,3 are used.
When you get to languages with upstep and downstep, the aforementioned system completely collapses since there is no upper bound on the number of "categories". If you do decide to deal with upstep and downstep, you can take advantage of the fact that the range itself changes over time. Initially, the range might be between 200 and 150 Hz, but at a point (where there is a downstep), the range lowers to be between 175 and 125 (not the vast oversimplification here). If the size of the range is, say 50 Hz, and you're computing 5 pitch intervals, then the F0 to pitch-integer conversion is (f0-b)/5, where b is the baseline value at the low end of the range, and downstep means "reduce the baseline value". The problem is that you need to determine that reduction empirically (and it isn't likely to be a constant).