{'fraction_non_alphanumeric': 0.03829620945681907, 'fraction_numerical': 0.01689027832052451, 'mean_word_length': 4.230865319100613, 'pattern_counts': {'":': 0, '<': 42, '<?xml version=': 0, '>': 8, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Mapping the Milky Way with LAMOST I: Method and overview

We present a statistical method to derive the stellar density profiles of the Milky Way from spectroscopic survey data, taking into account selection effects. We assume that the selection function of the spectroscopic survey is based on photometric colors and magnitudes and possibly altered during observations and data reductions. Then the underlying selection function for a line-of-sight can be well recovered by comparing the distribution of the spectroscopic stars in a color-magnitude plane with that of the photometric dataset. Subsequently, the stellar density profile along a line-of-sight can be derived from the spectroscopically measured stellar density profile multiplied by the selection function. The method is validated using Galaxia mock data with two different selection functions. We demonstrate that the derived stellar density profiles well reconstruct the true ones not only for the full targets, but also for the sub-populations selected from the full dataset. Finally, the method is applied to map the density profiles for the Galactic disk and halo, respectively, using the LAMOST RGB stars. The Galactic disk extends to about R=19 kpc, where the disk still contributes about 10% to the total stellar surface density. Beyond this radius, the disk smoothly transitions to the halo without any truncation, bending, or broken. Moreover, no over-density corresponding to the Monoceros ring is found in the Galactic anti-center direction. The disk shows moderate north-south asymmetry at radii larger than 12 kpc. On the other hand, the R-Z tomographic map directly shows that the stellar halo is substantially oblate within a Galactocentric radius of 20 kpc and gradually becomes nearly spherical beyond 30 kpc.

Ven (2012) and re-organize it in terms of Bayesian statistics. The post-observation selection function is taken into account during the determination of the stellar density. Meanwhile, we do not presume any analytic forms for the density profiles of neither the disks nor the halo. This allows us to better detect the potentially more complicated shapes of the structures, e.g., asymmetric features in the disk or the possibly radial variation of the axis ratio of the halo, in a non-parametric manner.
The paper is organized as follows. In Section 2, we propose the method to derive the stellar density profile along a given line-of-sight with the consideration of the selection function. In Section 3, we validate the method using mock data with various selection functions. In Section 4, we apply it to the LAMOST red giant branch stars and demonstrate the derived stellar density map for the disk and halo components. In section 5, we discuss the smoothing effect of the LAMOST plate due to its large fieldof-view and how to deal with the selection function slightly tuned by the observations. Finally, we draw brief conclusions in the last section.

STELLAR DENSITY PROFILE ALONG A LINE-OF-SIGHT
Given a line-of-sight with Galactic coordinates (l, b), we assume that the photometric data is always complete within the limiting magnitude 1 . We also assume that the selection of the spectroscopic targets is only associated with the color-magnitude diagram. The selection function as a function of the color(s) and magnitude(s) could be complicated. In principle, observations and data reduction may lose some data and thus the final selection function is slightly tuned. However, such a change would not induce substantial selection bias in stellar metallicity, age or kinematics, which are critical for distinguishing various stellar populations. Therefore the color-magnitude based selection function slightly tuned by the observations and data processing would not induce systematics in stellar populations. It is convenient to assume that it is a continuous function so that it is approximately constant in a sufficiently small region around color index c and magnitude m.

Generality
The probability density distribution (PDF) p ph (D|c, m, l, b) represents the probability to find a star at the distance D at given c, m, l, and b. The probability to find a star in a small volume (D, D + ∆D) is then written as On the other hand, P r([D, D + ∆D]|c, m, l, b) is also equivalent to the fraction of the stars, which can be calculated from the underlying stellar density profile, located within the small volume. Thus, it can also be written as where ν sp represents the stellar density measured from counting the spectroscopic survey stars only. Within the small region around c and m, the selection function is assumed to be flat with either the color index or magnitude. Thus, it does not change the probability to find a star in both the photometric and spectroscopic samples, i.e., p ph (D|c, m, l, b) = p sp (D|c, m, l, b).
Then, Eqs. (3) and (4) where S(c, m, l, b) = ∞ 0 ν sp (D|c, m, l, b)ΩD 2 dD ∞ 0 ν ph (D|c, m, l, b)ΩD 2 dD (7) is the selection function at c and m along (l, b). Then the stellar density profile for all photometric stars along (l, b) can be derived by integrating over c and m:

Consideration of a stellar population
Now consider a stellar sub-population C selected from spectroscopic data based on, for example, the metallicity, luminosity, or age. Following Bayes' theorem, the probability to find a star at D given C, c, m, l, and b is written as p ph (D|C, c, m, l, b) = p ph (C|D, c, m, l, b)p ph (D|c, m, l, b) p ph (C|c, m, l, b) .
If there is no special selection function for C members at given c and m along (l, b), then we would expect that p ph (C|D, c, m, l, b), i.e. the probability about C at given D, c, m, l, and b, should be same as that for the spectroscopic data, p sp (C|D, c, m, l, b). Subsequently, by integrating over D, we obtain that p ph (C|c, m, l, b) = p sp (C|c, m, l, b). Finally, applying Eq. (5) to this equation, all the terms of p ph in the right hand side of Eq. (9) can be replaced with p sp . Applying Bayes' theorem again to the right hand side, we obtain Therefore, similar to Eq. (6), we infer that where And consequently,

Estimation of ν sp
In Eqs (8) and (13), ν ph , as the density profile for the complete dataset, is the one to be determined. We can estimate it by measuring ν sp from the spectroscopic data. Usually, along a given line-of-sight, spectroscopic observations can only target a few hundreds to a few thousands of stars. This implies that ν sp has to be established from a relatively small dataset. In order to deal with such a situation, we derive ν sp by using the kernel density estimation (KDE). The KDE method can account for both the uncertainties in the distance and the relatively small number of stars in a given small region around (c, m). At (l, b), the PDF of D is contributed by all the stars around c and m in terms of where p i (D) is the PDF of the distance estimate for the ith star and n sp (c, m, l, b) is the number of the spectroscopic stars at a given c, m, l, and b. Bringing Eq. (14) into Eq. (4), we obtain Note that ν sp (c, m, l, b)ΩD 2 dD = n sp (c, m, l, b), they are then cancelled in Eq. (15). In principle, the KDE determined ν is a continuous function and thus can read value at any D. However, if there are very few stars nearby D or the given D is beyond the farthest star, the derived ν is not well constrained by observations and thus may not be reliable any more. Therefore, in practice, the stellar density value is sensible only at the positions with sufficient star samples. For convenience, we only adopt ν at the distance in which the spectroscopic stars are located.
It is worthy to note that the stellar density derived for a given (l, b) is averaged over the solid angle of the field-of-view, Ω. Therefore, the derived density at the distance in which a star is located does not equal to the stellar density for the exact 3D spatial position of the star, but only an approximation of the latter.

Estimation of S
Theoretically, S is defined by Eqs. (7) and (12). Practically, it is not possible to calculate S directly from ν ph and ν sp . Notice that the integration of ν is actually equivalent with the total number of stars at given c, m, l, b. Therefore, S can be evaluated from For the case of sub-population C, p ph (C|c, m, l, b) = p sp (C|c, m, l, b), we then have Hence, we infer that S(C, c, m, l, b) = S(c, m, l, b).
In order to improve the precision of the computation in Eqs. (8) and (13), we calculate S −1 instead of S in the rest of the paper.

VALIDATIONS WITH GALAXIA MOCK DATA
Before applying it to the real data, we validate the method using mock star catalog. We select a 20square degree area toward the north Galactic pole from Galaxia simulation (Sharma et al. 2011) and obtain 10 987 mock stars with K magnitude brighter than 15 mag. The Galaxia mock catalog contains 6 Liu et al. the distances, stellar parameters, and ages, which can be used to test whether the derived density profiles are precise for some specially selected stellar populations.
We test the method with two different selection functions, which are discussed separately in the following subsections.
3.1 Tests with the selection function T1 The black dots show the distribution in J − K vs.K for the complete sample of mock stars generated from Galaxia. The red circles indicate the mock spectroscopic stars according to the selection function T1. The right panel shows the normalized distributions of K for the complete and selected mock stars with black and red lines, respectively. The bottom panel indicates the normalized distributions of J − K for the two populations with same colors as in the right panel.
Before the tests, we construct the selection function to mimic the real spectroscopic survey. The selection of the mock spectroscopic stars is based on the infrared band J and K. First, we do not induce any selection in the color index J − K. Second, the selection function for K is divided into two parts at K = 13 mag. At K < 13 mag, we arbitrarily select stars, while at K > 13 mag, we apply a flat selection function to keep the mock spectroscopic stars evenly distributed along K. This mimics the strategy that the targeting is more bias to the bright rather than to the faint sources. We denote such selection function as T1.
We randomly draw 50 groups of the mock spectroscopic samples according to T1 and derive the density profile for each group of samples. As a sample, the mock spectroscopic stars from one of the 50 groups are highlighted with red circles in Fig. 1, in which the black dots indicate the J − K vs. K distribution for the complete dataset. The right panel shows the normalized distributions of K for the mock spectroscopic stars (red line) and the complete dataset (black line), respectively. It can be seen that the red line shows a similar trend as the black one at K < 13 and then become flat at K > 13. This reflects the definition of the selection function T1. The normalized distributions of J − K in the bottom panel display that even though we do not apply any selection function to the color index, the normalized distribution of J − K for the mock spectroscopic stars (red line) is not exactly same as that  The 4 panels show the derived density profiles along distances. The top-left, top-right, bottom-left, and bottom-right panels display the profiles derived from the mock spectroscopic stars (blue circles with error bars) and the "true" profile from the complete dataset (black lines) for the populations T1S1, T1S2, T1S3, and T1S4, respectively. The relative residual density, ∆ν/ν, for each case is displayed in the bottom of the corresponding panel.
for the full mock dataset (black line). This is a natural result of the selection function in K. There are more red stars in the regime of K > 13 than at K < 13. The selection strategy for K > 13 reduces the sampling rate of the fainter and redder stars in the mock spectroscopic stars. This leads to a slightly different distribution in J − K with the complete dataset. Fig. 2 shows how the selection function S is calculated for the same group of the mock spectroscopic stars as in Fig. 1. In the left panel, the color shows the number density of stars for the complete sample, i.e., n ph (J − K, K, l, b). The size of each bin is ∆(J − K) = 0.1 and ∆K = 0.25. It shows a high density at J − K ∼ 0.8 and K ∼ 14, which is most likely contributed by K/M dwarf stars. Applying the selection function T1, the map of the number density of mock spectroscopic stars, n sp (J − K, K, l, b), is shown in the middle panel. The right panel shows the map of S −1 (J − K, K, l, b), which is obtained by dividing the left by the middle panel of Fig. 2. It is seen that S −1 (J − K, K, l, b) is roughly separated into two platforms, one is at K < 13 with the value of about 5 and the other is at K > 13 with the value of about 10. This pattern implies that the selection function T1 does not induce selection effects in J − K at each K bin, although the overall distributions in J − K (as shown in the bottom panel of Fig. 1) are slightly different than the complete dataset.
In order to mimic a more realistic situation, i.e., study the stellar density via a selected stellar population, we select 4 different populations defined in Table 1 for tests. Table 1 also lists the median numbers and scatter of the 50 groups of the arbitrarily selected mock spectroscopic samples based on Table 1 The test populations selected from the Galaxia mock data.

Population
Criteria Number for T1 Number for T2 S1 all spectral types T1 in the 3rd column. It is noted that for the sub-population T1S2, which is selected with M K < −2, only about 40 stars are involved in the determination of the stellar density profile. This is a good sample to test the performance of the density estimates for a small dataset. Fig. 3 shows the distributions of star counts without a selection function correction for the complete set (black lines) and for one of the 50 groups of the mock spectroscopic samples (red lines), respectively. The 4 panels show the cases for the 4 different sub-populations, respectively. It displays that the selection function T1 does distort the spatial distributions of the mock spectroscopic stars from that of the complete samples.
The panels in Fig. 4 show the derived median stellar densities and their 1σ dispersions (blue circles with error bars) over the 50 groups of the mock spectroscopic stars at the spatial positions in which the mock spectroscopic stars are located. In contrast, the corresponding stellar densities for the complete dataset, i.e., the "true" profiles, are superposed as black solid lines in the panels. In the bottom of each panel, the relative ∆ν/ν is also displayed. It is seen that the derived stellar density profiles from the mock spectroscopic data are perfectly consistent with the "true" profiles. This confirms that when the selection function is very simple, the stellar density can be well reconstructed. In particular for the case T1S2, the accuracy of the derived stellar density is still very high even though the sample contains only about 40 stars (see the top-right panel of Fig. 4).

Tests with selection function T2
We then change to a more complicated selection function. Because the LAMOST survey selects its targets using optical-band photometry, the bright/faint limiting magnitude cuts in an optical band lead to a sloped cut in K magnitude. Thus a rectangle region selected in optical color-magnitude diagram turns out to be a wedge region in IR-bands. Fig. 5 shows the selection function of a sample plate 2 of the LAMOST survey. The middle panel shows that the spectroscopic stars are distributed in a wedge region in the J − K vs. K diagram. Thus the selection function S −1 in the right panel also shows the similar shape. To mimic such a selection function, we randomly select the stars satisfying the following criterion: We denote this selection function as T2. Fig. 6 shows a randomly drawn sample based on T2 in the J −K vs. K diagram, in which the selected spectroscopic stars (red circles) are distributed in a wedge area. The median numbers of the stars and their scatters over the 50 groups of arbitrarily drawn mock spectroscopic stars based on T2 are separately listed in the last column of Table 1 for the 4 sub-populations. Fig. 7 shows the density of stars in the color-magnitude diagram for the same sample group of mock spectroscopic data as in Fig. 6. It is seen that the selected stars show a tilted distribution in the J − K vs. K plane, and so does the map of S −1 according to the definition of T2. Fig. 8 shows the spatial distributions of the star counts without selection function correction for the 4 sub-populations from one of the 50 groups of mock spectroscopic stars (red lines). In contrast, the black lines indicate the distributions of the stars for the corresponding complete datasets. It can be seen that for T2S1, T2S2, and T2S3, distances further than 30 kpc are significantly under-sampled. Fig. 9 shows the derived median stellar density profiles and their 1σ dispersions over the 50 randomly drawn groups (blue circles with error bars). In general, the derived profiles are quite consistent with their corresponding "true" values within uncertainty of ∆ν/ν < 1. However, a few systematic biases of about ∆ν/ν ∼ 0.5-1 appear in the derived density profile: one occurs at the distance of ∼ 20 − 30 kpc for T2S1, T2S2, and T2S3, the other is at D ∼ 2.5 kpc for T2S4.
Considering that properties of the Galactic spatial structures, such as the scale height/length of the disks and the power-law index of the stellar halo, are mostly measured in logarithmic density, such systematic biases may not bring severe effects. For instance, a simple exponential fit within 0.3-2.5 kpc gives a scale height of 219 pc with the true density profile of T2S4 (black line in the bottom-right panel of Fig. 9), while it decreases to 191 pc obtained from the corresponding derived stellar density profile (blue circles in the same panel). This means that the derived density based on T2 may induce a systematically smaller exponential scale height by only ∼ 13%.
For a realistic survey such as LAMOST, many plates are overlapped with each other. And the selection function for different plates varies. Then the possible systematic bias of the stellar density measurement in one plate, as shown in Fig. 9, may be compensated by other overlapped plates. Consequently, the cummulation of the systematic bias from each individual plate may not induce the overall systematic bias to the final density profiles, but may increase the random uncertainty in the resulting density profiles.

The selection function of the LAMOST survey
In general, the targeting strategy of the LAMOST survey is rather simple. Carlin et al. (2012) has designed an elegant targeting algorithm, which tries to make the distribution of the target stars flat in color-magnitude planes. However, in practice, this technique has not been fully used for a few reasons. First, the dynamical range of magnitudes observed in a single LAMOST plate is limited to only about 3 magnitudes so that bright spectra will not saturate or cross-talk between fibers. Second, the actual limiting magnitude of r ∼ 18 mag is brighter than the designed goal by at least 2 mag. Both situations lead to insufficient source stars for targeting. For instance, the bright plates for LAMOST survey cover 14 < r < 16.8 mag, which may only contain less than 200 stars per square degree at high Galactic latitudes. Such a sparse stellar sampling is not sufficient to apply the selection function designed by Carlin et al. (2012) for targeting, because the targeting algorithm needs far more source stars than available fibers to achieve a flat distribution of targets in color-magnitude plane.
Finally, the LAMOST survey separated the targets into different plates with different ranges of magnitudes at each line-of-sight. The VB plates cover 9 < r < 14, the B plates cover 14 < r < 16.8, the M plates cover r < 17.8, and the F plates cover r < 18.5. For the VB and B plates, no specific selection function was applied, i.e., the stars are randomly selected. For the M and F plates, we only applied the selection function in r magnitude, and leave the selection in color index to be arbitrary. This simplified selection function was applied to all of the sky area observed by LAMOST except for the Galactic anti-center region, which covers 150 • < l < 210 • and |b| < 30 • . For the main survey regions, the UCAC4 catalog (Zacharias et al. 2013) with r < 14 mag and PanSTARRS-1 catalog (Schlafly et al. 2012) with r > 14 were adopted as the source catalogs for targeting. For the Galactic anti-center region, the selection strategy follows Yuan et al. (2015), and uses 2MASS, UCAC4, and Xuyi survey catalogs (Liu X.-W. et al. 2014) as the sources for targeting.
Because the different source catalogs are based on different photometric systems, they can not be unified unless they are cross-calibrated with each other. To avoid the complicated calibrations between at least 4 different systems, we finally adopt the 2MASS catalog, which covers most of the LAMOST observed stars, as the photometric dataset. Indeed, for the LAMOST K giant stars, about 96% of them are within K < 14.3 mag, which is the limiting magnitude of the 2MASS catalog. Subsequently, we use J −K vs. K map to derive the selection function S for each observed plate of the LAMOST survey. The selection function S −1 for all LAMOST DR3 plates and the python codes used for the measurement of the stellar density profiles can be found at https://github.com/liuchaonaoc/LAMOST density.

LAMOST RGB stars
In order to derive the density profiles for the stellar disk and halo of the Galaxy, we select red giant branch (RGB) stars. Although RGB stars are not the standard candles as the red clump stars, the accuracy of the distance for the former ones is still around 20-30%  is sufficient for mapping Galactic structure in the outer regions. Moreover, RGB stars are intrinsically brighter and occur in stellar populations with a broader range of metallicity than red clump stars. Therefore, they are suitable tracers for the outer disk and the halo, which are dominated by the metal-poor stars.
For LAMOST survey data, we adopt the stellar parameters, i.e., the effective temperature, surface gravity, and metallicity, provided by the LAMOST pipeline (Wu et al. 2011, Luo et al. 2015. The K giant stars, including the RGB and red clump stars, are selected based on the criteria proposed by . Red clump stars are identified by Wan et al. (2015) and Tian et al. (2016). The RGB stars are then selected from the K giant stars by excluding the red clump stars.
The absolute magnitudes at K s band, M Ks , for the RGB stars are estimated following the method suggested by Carlin et al. (2015). Interstellar extinction for the individual RGB stars is estimated using the Rayleigh-Jeans color excess (RJCE) approach introduced by Majewski et al. (2011) and later revised to incorporate WISE bandpasses by Zasowski et al. (2013). Subsequently, the distances to the RGB stars are estimated by combining the apparent K s magnitude, the absolute magnitude M Ks , and the RJCE extinction A Ks .
The RJCE extinction is compared with the 3-D extinction map provided by Green et al. (2014Green et al. ( , 2015, who derived the 3-D dust map from the PanSTARRS-1 data. Fig. 10 shows the RJCE extinction vs. distance for the RGB stars located at (150 • < l < 160 • , |b| < 2 • ), (170 • < l < 190 • , |b| < 2 • ), and (200 • < l < 210 • , |b| < 2 • ) using blue circles, red crosses, and black pluses, respectively. The Green et al. mean extinction-distance relations at the similar lines-of-sight are superposed in the same figure. We see that the RJCE extinctions for individual RGB stars are roughly consistent with Green's 3-D extinction map within about 0.2 mag, which may lead to only about 10% uncertainty in distance. Therefore, the distances for the RGB stars should not be substantially affected by extinction, even in the Galactic mid-plane.
In the following subsections we demonstrate two samples: 1) RGB stars with all ranges of metallicity as the tracers for the Milky Way structures, especially for the Galactic disk, and 2) metal-poor RGB stars as tracers for the stellar halo. Fig. 10 The blue circles, red crosses, and black plus symbols indicate the RGB stars with |b| < 2 • along the lines-of-sight 150 • < l < 160 • , 170 • < l < 190 • , and 200 • < l < 210 • , respectively. Three extinction-distance relations at l = 150 • (blue line), l = 180 • (red line), and l = 210 • (black line) queried from the 3-D extinction map of Green et al. (2014Green et al. ( , 2015 are superposed on the observed data.

The stellar disk
We select 21,954 RGB stars with M Ks < −3.5 mag and distances larger than 0.5 kpc as probes to map the Galaxy. Because these samples are dominated by the metal-rich stars, they mostly trace the Galactic disk. The volume completeness for these RGB stars are within 40 kpc. The volume completeness in this paper is defined such that the range of the luminosity of the stars does not significantly change within the volume. Plate by plate, we apply the method to derive the stellar density and finally obtain density values at the distances at which sample stars are located. Table 3 lists the first three rows of  Table 2. The full RGB data can be found at https://github.com/liuchaonaoc/LAMOST density. Note that the samples contain about 20% of stars that have been observed more than twice. Because the duplicated stars were observed in different plates and the selection effects for each observation can be considered separately, the duplication would not affect the stellar density estimation. In fact, these data can be used to test the internal uncertainty, or the precision, of the distance and stellar density estimations, respectively. The top panel of Fig. 11 shows the distribution of the relative scatter of the distance estimates (black line) for the stars observed multiple times. The scatter is defined by the standard deviation of the distance. The relative scatter is the scatter divided by the mean distance estimate. The distribution of the relative scatter of distance is fitted with a Gaussian (red dashed line) with the best fit parameter of σ = 0.038, while the median value of the distribution is 0.028. This means that the internal uncertainty of the distance estimates for the RGB stars is around 3 − 4%.
The bottom panel of Fig. 11 shows the distribution of the relative scatter of stellar density (black line) for the duplicated stars. The definitions of the scatter and relative scatter are similar to those for the distance estimates. The red dashed line stands for the best fit Gaussian with σ = 0.37. The median value for the distribution is 0.25. This is better than the performance of the mock data test shown in Sect. 3.1 and 3.2, which may reach ∆ν/ν > 0.5 in the worst cases. The difference in the derived stellar densities for the multiple-observed stars is originated from two possible channels: 1) the different selection corrections from the different plates observing the same star and 2) the different averaging sky areas since the plates observing the same star may not be completely overlapped with each other. The small dispersion of the relative scatter implies that these differences are very small for most of the stars. Fig. 12 demonstrates the averaged stellar density map in R-Z plane 3 . The bin size is 0.5×0.5 kpc. Because this population is dominated by metal-rich stars, it displays a remarkable tomographic map of the Galactic disk from R ∼ 4 to ∼ 20 kpc. Two prominent features are seen in this figure. First, the Monoceros ring, unveiled by Newberg et al. (2002) and later highlighted in SDSS star counting ) and metallicity distribution mapping (Ivezić et al.2008), does not show up in our map of the whole Galactic outer disk with LAMOST RGB stars. Second, the iso-density contours (black lines) show moderate north-south asymmetry in the outer part of the disk starting from R ∼ 12 kpc. The stellar density above the mid-plane is larger than that below at given radii. This is essentially consistent with Xu et al. (2015). The asymmetry about the mid-plane may also be the result of the warp. If that is the case, the stellar disk may bend up to some extent in the Galactic anti-center region between 150 • < l < 210 • , in which the LAMOST disk data are mostly concentrated. Both features are very interesting and will be further discussed in an upcoming paper (Wang et al. in preparation).
In Fig. 13, the black circles show the stellar surface density derived by integrating the volume density over Z in each R slice. In order to avoid issues due to the lack of data in the southern Galactic hemisphere, we use |Z| instead of Z. That is, the mean stellar density at given |Z| is averaged over the values at both +Z and −Z. Only |Z| < 40 kpc are included in the integration. The width of each R slice is 1 kpc. For some bins without stellar density estimates, interpolated values are used. The red and blue dashed lines are best-fit exponential disk and power-law halo profiles, respectively, and the green dot-dashed line is the sum of the two profiles. We find that the surface density profile can be well fitted Fig. 11 In the top panel, the black line shows the distribution of the relative scatter of the distance for the repeatedly observed RGB stars. The red dashed line is the best fit Gaussian of the distribution of the scatter. The σ of the Gaussian is 0.038 and the median of the scatter is 0.028. In the bottom panel, the black line displays the relative scatter of the ν for the repeatedly observed RGB stars. The red dashed line is the best fit Gaussian with σ = 0.37. The median of the scatter of ν is 0.25.
with an exponential disk with scale length of 1.6 ± 0.1 kpc and a power law halo with index of 2.4 ± 0.3 Note that this power-law index is not equivalent to that derived from spherical coordinates, since it is derived from the surface density as a function of the cylindrical radius R.
The fraction of stars contributed by the halo, as derived from our models of the surface density, is indicated as the black line aligned with the right y-axis in the figure. It shows that, at R = 14 kpc, about half of the surface density is contributed by the disk. Therefore, no evidence is found to support that there is a truncation at around 14 kpc. Moreover, at R = 19 kpc, the disk still contributes ∼ 10% to the total stellar surface density, which cannot be negligible because the data points (black circles) are clearly larger than the halo model (blue lines) around the radius. In other words, the disk extends to as far as 19 kpc. Beyond this radius, the observed surface density smoothly transitions to a pure halo profile. The perfect fitting with an exponential disk model implies that the disk displays neither truncation, nor break, nor up-bending feature. Fig. 12 The figure shows the averaged stellar density map for the RGB stars with all range of metallicity, M Ks < −3.5, and D > 0.5 kpc. The color codes the mean ln ν for each R-Z bin. The black contours indicate the iso-surface lines at ln ν = −12, −11, −10, −9, −8, and −7 from outside to inside, respectively. The dotted circles indicate the Galactocentric radii of 2, 4, ..., 24 kpc from left to right, respectively. The black horizontal dashed line indicates the plane of Z = 0.
The extended larger size of the disk is not likely to be an artificial effect due to the incorrect interstellar extinction, according to the discussion in sub-section 4.2. On the other hand, Carlin et al. (2015) pointed out that the distances may be systematically overestimated for α-enhanced giant stars by about 15%. However, Hayden et al. (2015) shows that it is the α-low giant stars who dominate the outer disk. Consequently, the systematic bias in distance due to the α abundance may not significantly affect the distance for the outer disk RGB stars. Therefore, we suggest that the largely extended disk without truncation should be real.
The Galactic disk measured in this work is significantly larger than some other works, which claimed that the Milky Way stellar disk truncates at around 14-15 kpc (e.g. Robin et al. 1992, Minniti et al. 2011). Carraro (2015 pointed out that the lines-of-sight investigated by these works are very close to b ∼ 0 and may not be aligned with the disk plane in the outskirts due to the existence of the warp. In this case, at some radius the in-plane lines-of-sight no longer probes the disk, leading to a false truncation at that radius. It is worth to note that Carraro et al. (2010) and Feast et al. (2014) found some young stars at around 20 kpc from the Galactic center, which is in agreement with our suggestion that the disk extends to such radii. We also point out that Xu et al. (2015) has suggested that the disk may extend all the way to large radii. More quantitative analysis will appear in upcoming work by Wang et al. (in preparation).

The stellar halo
In this section we select 5,171 halo-like RGB stars with [Fe/H]< −1 and M Ks < −4 from the LAMOST DR3 catalog to map the stellar density profile for the stellar halo. The cut in K s -band absolute magnitude ensures that the data is roughly complete within 50 kpc from the Galactic center. The  Fig. 13 The black circles display the radial stellar surface density profile integrated over Z for the RGB stars. The bin size of R is 1 kpc. The red and blue dashed lines stand for the best fit exponential disk and power-law halo profiles, respectively. The scale length for the disk is 1.6 ± 0.1 kpc and the power-law index for the halo is 2.4 ± 0.3. The green dashed line is the sum of the two model profiles for the halo and disk. The black line aligned with the right y-axis shows the fraction of the halo relative to the total surface density as a function of R.  The red line is the best fit broken power-law profile with a break radius of 40.4 ± 2.8 kpc. Within the break radius, the power-law index is −2.9 ± 0.1, while beyond this radius the index becomes −5.0 ± 1.2. The bottom panel shows the data with q = 0.75. In this case the broken power-law does not work quite well in the sense that the break radius has a large uncertainty of 10.0 kpc and the inner and outer power-law indices, which are −3.2 ± 0.5 and −2.9 ± 0.1 respectively, are quite similar. Therefore, it seems that a single power-law may be more suitable for this case. first three rows of the sample are listed in Table 4. The columns in the table are explained in Table 2. The full catalog can be found at https://github.com/liuchaonaoc/LAMOST density. We then derive the stellar densities at the spatial positions at which the halo-like RGB stars are located. Fig. 14 shows the averaged stellar density map in the R-Z plane for the halo population. The metalpoor RGB stars well probe the shape of the halo within a Galactiocentric radius of 50 kpc. The contours of ln ν = −12.5 and −13.5 in the figure show clear oblate shapes within 20 kpc. The iso-density contour at −14.5 displays a slightly larger axis ratio, although it is still oblate. Beyond 30 kpc, the contours of −15.5 and −16.5 are roughly spherical. Although Xue et al. (2015) claimed that a single power-law halo with variable axis ratio can better fit their data than the broken power-law, it is probably for the first time, to our knowledge, that the variable axis ratio from inner to outer halo is directly illustrated in the tomographic map.
We further demonstrate how the broken power-law comes out with the assumption of a constant axis ratio. Fig. 15 shows ln ν as a function of r for the points shown in Fig. 14 with different fixed values of the axis ratio. The top panel presumes the axis ratio q = 1.0. Thus r is the same as the Galactocentric radius in spherical coordinates. The ln ν profile is fitted with a broken power-law. Within ∼ 40±2.8 kpc, the best fit power-law index is −2.9 ± 0.1, while beyond this it is down to −5.0 ± 1.2. In the bottom panel, q is set to be 0.75. In this case, the broken power-law profile shown in the top panel almost disappears. Instead, it shows that the two power-law indices in the inner and outer halo are similar, i.e., a single power-law may be better to fit the data. This means that the presumption of the axis ratio can significantly change the radial profile of ln ν. More quantitative study about the structure of the stellar halo with the LAMOST RGB samples can be found in Xu et al. (in preparation).

DISCUSIONS
5.1 The plate-wide smoothing density profile In this work, we derive the density profile along a line-of-sight for each LAMOST plate. This implies that the stellar density estimate is smoothed over the solid angle of 20 square degrees, since the field-of-view of the LAMOST telescope is 5 degrees in diameter. Note that the stellar density profile may dramatically change from one end to another in such a large sky area, especially when the distance is large. As a consequence, the plate-wide smoothing density profile may smear out or blur the structure of the Milky Way to some extent. In this section we investigate the influence of the plate-wide smoothing to the density profile with toy models.
We adopt a toy model of the vertical stellar density profile with two exponential components: the thin disk component has the scale height of 0.3 kpc and the thick disk has the scale height of 0.9 kpc. At Z = 0, the thick disk component is 15% of the thin one. The normalizer, i.e. the stellar density at Z = 0 is set to 0.05 pc −3 . Such a configuration is similar to the Milky Way disk in the solar neighborhood.
Considering that the LAMOST plates usually overlap with each other in most of the sky areas, we draw mock stars from the toy model in the partly superposed LAMOST-like plates, i.e. circles with 5degree-field-of-view, centered at b = 0 • , 1 • , 2 • , . . . , 12 • , 22 • , . . . , 82 • with l = 180 • . Obviously, these plates correspond to different vertical height above the Galactic mid-plane. The larger the distance, the larger the vertical height.
For each plate, at a given Galactocentric radius, we randomly draw 50 mock stars evenly distributed within the circle area of the plate. Note that, even though the mock stars have same radius, their Z values are different because they are distributed at various Galactic latitudes within the plate. According to Section 2, the stellar densities at the positions of the mock stars are derived by averaging over the model density covering the area of the plate at the given radius. Thus, although the Z values are different for the mock stars drawn from the same plate at the given radius, the stellar densities assigned to them are same. This is the similar but simplifed way to determine the stellar density as for the real observed data applied in Section 4. In spite that the uncertainties of the distance estimates and the selection function corrections are ignored, the simplied method to the stellar density determination is sufficient for investigating the effect induced by the plate-wide smoothing.

The smoothing effect in the vertical disk profile
We first investigate the effect in the vertical density profile. Fig. 16 (a) shows the result of the vertical density profile test at R = 12 kpc. The black solid line indicates the "true" profile from the toy model. The red filled circles represent the averaged density values over the mock stars at different Z bins. The red dashed line displays the best-fit double-exponential profile with the red symbols. It is seen that the derived stellar densities perfectly follow the "true" stellar density profile and the best-fit parameters are quite consistent with the "true" values with uncertainties less than 20%.
We then move to larger distance at R = 20 kpc, where the effect of the plate-wide smoothing should be more substaential. The result in Fig. 16 (b) shows that the shape of the best-fit density profile (red dashed line) derived from the "observed" data (red filled circles) is in agreement with the "true" profile (black solid line). Similar to the test at R = 12 kpc, the uncertainty of the derived model parameters is less than 20% without substential systematic bias. In both cases at R = 12 and 20 kpc, the plate-wide smoothing due to the large field-of-view does not significantly change the result.

The smoothing effect in Monoceros ring-like substructure
In section 4.3, the well known Monoceros ring is not substentially exhibited in the outer Galactic disk, according to the stellar density profile estimates. Could it be possible that the smoothing in the large field-of-view of the LAMOST plate smears out such kind of substructure? We superpose an additional Gaussian-like substructure with the peak located at 1.5 kpc and σ of 0.3 kpc to the toy model with a double-exponential vertical profile. The peak density of the Gaussian-like substructure is 20% of the disk density at Z = 0. The analytic form of the Gaussian-like substructure is indicated in the second text line in Fig. 16 (c). The "true" vertical density profile with the Gaussian-like substructue located at R = 20 kpc is shown as the black solid line in Fig. 16 (c). The red filled circles in the figure are the approximated density values obtained from the mock data. Compared with the derived best-fit stellar density in the panel (b) (red dashed line), it is seen that the approximated stellar density values do show a broader bump between Z = 1 and 2 kpc, which corresponds to the Gaussian-like substructure. This means that even the substructure has a relatively smaller typical scale of 0.3 kpc it can still be identified after the spatial smoothing induced by the large field-of-view, although the resulting substructure may be broadened to some extent. If the substructure is very weak, however, its signal may also be weakend by the broadening effect.

Summary
To summarize, the stellar density profile derived from the spatial averaging over the 5-degree-field-ofview may not significantly distort the derived Galactic structure. Meanwhile, although the smoothing with relatively large sky area may broaden the existing substructures, small-scale substructure with typcal scale of 0.3 kpc can still be identified from the resulting stellartdensity profile. Therefore, the disappearing of the Monoceros ring in our result may not be due to the spatial smoothing induced by the applied technique.

The post-observation selection function
The selection function used in this work is determined by comparison between the color-magnitude diagram from the photometric data and that from the final spectroscopic catalog. The selection function in the latter one is not only composed of the targeting selection, but also consider the selection effects induced during obserations and data reductions.The original selection function is always altered during the observations and data processing. For instance, one line-of-sight is designed to be observed multiple times with different ranges of magnitudes so that a larger range of magnitude can be covered. But due to the weather, some designed plates may never be observed. Then the post-observation selection function for the line-of-sight would never be identical to the designed one. Another instance is that the data reduction may lose the spectra with very low signal-to-noise ratio, which may more frequently occur for fainter sources. Therefore, only using the originally designed targeting selectuion for the correction cannot take into account the effects from observations and data reductions.

CONCLUSIONS
In this paper, we introduce a statistical method to measure the stellar density profile along a given lineof-sight using spectroscopic survey data. This technique can flexiblly deal with the stellar density for different stellar populations.
Our validation tests based on Galaxia mock data demonstrate that we can well reconstruct the stellar density profile for a sub-population. Moreover, even if the sub-population contains quite few stars, we can still obtain reasonable density values at the spatial positions at which the stars are located.
The tests show that in the worst cases, the derived stellar density may have a systematic bias of about ∆ν/ν ∼ 1. However, large surveys like LAMOST can observe many plates covering a wide area of the sky. Thus, statistically, the final averaged stellar density in the small discrepant regions can reduce or cancel the different systematic biases occurring in different lines-of-sight, and finally achieve relatively high precision when averaged over large areas.
Finally, we apply the method to the LAMOST DR3 RGB stars. For the Galactic outer disk, we find that 1) the disk component still contributes to the total stellar surface density by about 10% at R = 19 kpc, implying that our Galaxy has a quite large stellar disk; 2) we do not observe any significant truncation of the disk, but only see a smooth transition from the disk to the halo at around 20 kpc; 3) the Monoceros ring is not seen in our density map of the outer disk; and 4) the disk seems vertically asymmetric beyond R ∼ 12 kpc.
We confirm that the stellar halo is oblate in the inner halo (within r ∼ 30 kpc) and becomes spherical in the outer part. If we presume a constant axis ratio of 1.0, the stellar density profile shows a clear broken power-low similar to some previous works (e.g., Deason et al. 2011). However, if we change the constant axis ratio to 0.75, the broken power-law disappears. This means that whether the halo profile is broken or not depends on the axis ratio. The tomographic map of the stellar halo displayed in this work shows evidence that the halo has a radially varying axis ratio. Therefore, either using a single or broken double power-law with constant axis ratio does not properly reflect the real structure of the stellar halo.