1 Introduction

The cosmological principle assumes that the universe is homogeneous and isotropic on cosmic scales. Based on this assumption as well as the standard model of particle physics and Einstein’s general relativity (GR), the Lambda cold dark matter (\(\Lambda \)CDM) model is proposed. This standard model of cosmology has proved successful on large cosmic scales according to the latest cosmic microwave background (CMB) observations, namely Planck 2018 data [1], DES [2] or eBOSS [3]. However, it faces major challenges on small scales, such as the Hubble tension [4], the \(\sigma _8\) tension [5,6,7] and the dipolar tension [8]. Besides GR, dark energy model or treatments of systematic uncertainty, the former tension also challenges the local cosmic homogeneity and the latter one challenges as well the cosmic isotropy on small scales. Therefore, further testing of the local cosmic inhomogeneity and anisotropy on small scales is necessary.

The local cosmic inhomogeneity can be modeled by the spherically symmetric Lemaitre-Tolman-Bondi (LTB) metric [9,10,11]. Considering the late-time matter and dark energy, we can use it as an inhomogeneous generalisation of a \(\Lambda \)CDM model, namely as a \(\Lambda \)LTB model. Using the combination of the latest available cosmological observations, the local radial inhomogeneity in the \(\Lambda \)LTB model has been probed [12, 13]. Even though a deeper local void can reconcile the Hubble tension [14] and a larger local void can reconcile the dipolar tension [15], a shallower and smaller local void is favored by the combination of the latest available cosmological observations [12, 13]. However, a spherically symmetric local cosmic inhomogeneity may not meet reality. Therefore, in this paper, we will probe the true profile of the local cosmic inhomogeneity as realistically as possible.

The cosmic anisotropy on small scales can be tested by type Ia supernovae (SNIa) data, such as the combined Pantheon sample [16]. One straightforward method is to divide the whole samples into several subsets according to the distribution of individual SNIa in the galactic coordinate system. In particular, the hemisphere comparison method [17, 18] divides the whole sample into two data subsets which are designated as the “up” and the “down” hemispheres, respectively [19,20,21]. Furthermore, \(\textsf{HEALPix}\) [22] can be used to divide the whole sample into more data subsets [21, 23, 24]. Another common method is the dipole fitting method [25], which assumes a priori the existence of a dipole in the cosmic anisotropy on small scales [19,20,21, 26, 27]. Until now, there is no evidence for cosmic anisotropy on small scales in the SNIa samples. However, these null signals are just obtained from overall constraints and may neglect some fine structures in the universe.

In this paper, we try to test both of the local cosmic inhomogeneity and the cosmic anisotropy on small scales at the same time using the SNIa data of Pantheon. To account for the asymmetry in the local cosmic inhomogeneity and the fine structures in the cosmic anisotropy on small scales, we will fit cosmic anisotropy on small scales with the \(\Lambda \)LTB model. We first divide the local cosmic void into several segments. Each segment with given solid angle is fitted to its own LTB metric, where the void depth and radius parameters only correspond to the local segment and ignore the data from the other segments. We then divide the 1048 SNIa of Pantheon into corresponding subsets according to their distribution in the galactic coordinate system. Obviously, each SNIa subset can only be used to reconstruct the profile of one segment. Finally, we can patch together an irregular profile for the local cosmic void with the whole Pantheon sample. The whole profile will contain all the information about both of the local cosmic inhomogeneity and the cosmic anisotropy on small scales, as shown in Fig. 1.

Fig. 1
figure 1

The diagram of an irregular local cosmic void. Each segment with the same solid angle \(\pi \) is modeled by its own LTB metric and constrained by the corresponding SNIa subset given in Table 1. Different specific solid angle LTB segments calibrated on data from that angle allow to capture anisotropic fine structures, contrary to previous isotropic studies [12, 13]. Those studies’ spherical symmetry assumption restriction might have washed away a weak signal from some fine structures. Such signal would favor the \(\Lambda \)LTB model over the \(\Lambda \)CDM model

This paper is organized as follows. In Sect. 2, we present our method modeling the local cosmic inhomogeneity and introduce our treatment of the Pantheon data. In Sect. 3, we show the constraints on the profiles of all segments of the local cosmic inhomogeneity and compare them. Finally, a brief summary and discussions are included in Sect. 4.

Fig. 2
figure 2

The distribution of 1048 SNIa of Pantheon in the galactic coordinate system (lb), where the discrete colorbar indicates the redshifts of these SNIa

2 Methodology and data

2.1 Model

A spherically symmetric void can be modeled by the LTB metric

$$\begin{aligned} ds^2=-dt^2+\frac{R'^2(r,t)}{1+2r^2k(r){\tilde{M}}^2}dr^2+R^2(r,t)d\Omega , \end{aligned}$$
(1)

where \(d\Omega = d\theta ^2+\sin ^2\theta d\phi ^2\), \({\tilde{M}}\) is an arbitrary mass scale, k(r) is an arbitrary curvature profile function, \(R(r,t)=a(t)r\) is dependent on the FLRW scale factor a(t) and a prime (or dot) denotes derivative with respect to the radial coordinate r (or the time t). As \(\Lambda \)CDM model is built on the FLRW metric, there is a \(\Lambda \)LTB model built on the LTB metric. The universe’s expansion in the \(\Lambda \)LTB model is determined by a Friedmann-like equation

$$\begin{aligned} \frac{{\dot{R}}^2(r,t)}{R^2(r,t)}=\frac{2m(r)}{R^3(r,t)}+\frac{2r^2k(r){\tilde{M}}^2}{R^2(r,t)}+\frac{\Lambda }{3}, \end{aligned}$$
(2)

where m(r) is the so-called Euclidean mass functionFootnote 1 and be set as \(m(r) = 4\pi {\tilde{M}}^2r^3/3\), the Big Bang time \(t_{\textrm{BB}}(r)\) is fixed as a constant and the curvature profile k(r) is the only free function to determine the void. More precisely, the void’s expansion can be decomposed into a transverse expansion rate and a longitudinal expansion rate. The former one depends on a transverse scale factor \(a_{\bot }(r,t)=R(r,t)/r\) as

$$\begin{aligned} H_{\bot }(r,t)&=\frac{{\dot{a}}_{\bot }(r,t)}{a_{\bot }(r,t)}; \end{aligned}$$
(3)

while the latter one is defined by a longitudinal scale factor \(a_{\parallel }(r,t)=R'(r,t)\) as

$$\begin{aligned} H_{\parallel }(r,t)&=\frac{{\dot{a}}_{\parallel }(r,t)}{a_{\parallel }(r,t)}. \end{aligned}$$
(4)

According to the above Friedmann-like equation, we can define the density parameters of matter, curvature and dark energy today as

$$\begin{aligned} \Omega _{\textrm{m}}(r)&=\frac{2m(r)}{R^3(r,t_0)H_{\bot }^2(r,t_0)}, \end{aligned}$$
(5)
$$\begin{aligned} \Omega _{\textrm{k}}(r)&=\frac{2r^2k(r){\tilde{M}}^2}{R^2(r,t_0)H_{\bot }^2(r,t_0)}, \end{aligned}$$
(6)
$$\begin{aligned} \Omega _{\mathrm{\Lambda }}(r)&=\frac{\Lambda }{3H_{\bot }^2(r,t_0)}. \end{aligned}$$
(7)
Table 1 According to the distribution of 1048 SNIa of Pantheon [16] in the galactic coordinate system (lb), the full dataset is divide into \( \mathrm P_{\textrm{N}}\)+\( \mathrm P_{\textrm{S}}\) by a division along the galactic plane, \( \mathrm P_{\textrm{E}}\)+\( \mathrm P_{\textrm{W}}\) by a division orthogonal to the galactic plane and \( \mathrm P_{\textrm{NE}}\)+\( \textrm{P}_\textrm{NW}\)+\( \mathrm P_{\textrm{SE}}\)+\( \mathrm P_{\textrm{SW}}\) by both simultaneous divisions
Table 2 The \(\Lambda \)CDM model’s six parameters given by Planck 2018 TT,TE,EE+lowE+lensing [1]

The profile of the void can be parameterized by the depth, size, and boundary width of the void [28]. In fact, the depth and size of the void are sufficient to constrain it and the width of the void boundary can be ignored [29]. We thus parameterise the void with the following curvature profile

$$\begin{aligned} k(r)&=k_{\textrm{c}}P_3(r), \end{aligned}$$
(8)
$$\begin{aligned} P_n(r)&=\left\{ \begin{array}{lcl} 1-\exp \left[ \frac{-(1-r/r_{\textrm{B}})^n}{r/r_{\textrm{B}}}\right] &{}&{} 0 \le r < r_{\textrm{B}} \\ 0 &{}&{} r_{\textrm{B}} \le r \\ \end{array} \right. , \end{aligned}$$
(9)

where we have assumed the universe is flat outside the void, \(k_\textrm{c}\) is the curvature at the center and \(r_{\textrm{B}}\) is the comoving radius of the void.

Fig. 3
figure 3

The triangular plot of void parameters (see Sect. 3) and \(M_{\textrm{B}}\) for the no cut case, where the contours shown at \(68\%\) (inner lines) and \(95\%\) (outer lines) confidence ranges

Fig. 4
figure 4

The triangular plot of void parameters (see Sect. 3) and \(M_{\textrm{B}}\) for the horizontal cut case, where the contours shown at \(68\%\) (inner lines) and \(95\%\) (outer lines) confidence ranges

Fig. 5
figure 5

The triangular plot of void parameters (see Sect. 3) and \(M_{\textrm{B}}\) for the vertical cut case, where the contours shown at \(68\%\) (inner lines) and \(95\%\) (outer lines) confidence ranges

Fig. 6
figure 6

The triangular plot of void parameters (see Sect. 3) and \(M_{\textrm{B}}\) for the two cuts case, where the contours shown at \(68\%\) (inner lines) and \(95\%\) (outer lines) confidence ranges

If the void is spherically symmetric and all the latest cosmological observations are available, the profile at r can be constrained by data from any direction or sky location. Therefore, the depth of the void and the boundary of the void in particular, where the curvature reaches 0, can be constrained relatively well [12]. If the asymmetry of the void is only probed with SNIa data, however, we find that although the depth of the void can still be constrained relatively well, this is not the case for the boundary of the void, where the curvature changes to 0. Therefore, we introduce a scale \(r_{\textrm{C}}\) where the curvature changes by \(10\%\). That is to say, we will not attempt to characterise the whole void but conservatively concentrate on the partial profile of the inner void, replacing Eq. (9) with the following function:

$$\begin{aligned} P_{ n}(r) =\left\{ \begin{array}{lcl} 1-0.1\exp \left[ \frac{-\left( 1-r/r_{\textrm{C}}\right) ^n}{r/r_{\textrm{C}}}\right] &{}&{} 0\le r<r_{\textrm{C}} \\ 0.9\left[ 1-\exp \left[ \frac{-\left( 1-\frac{r-r_{\textrm{C}}}{r_\textrm{B}-r_{\textrm{C}}}\right) ^n}{\frac{r-r_{\textrm{C}}}{r_{\textrm{B}}-r_\textrm{C}}}\right] \right] &{}&{} r_{\textrm{C}}\le r <r_{\textrm{B}} \\ 0 &{}&{} r_{\textrm{B}} \le r \\ \end{array} \right. .\nonumber \\ \end{aligned}$$
(10)

The void now is parameterized by three parameters \(\{k_\textrm{c},r_{\textrm{C}},r_{\textrm{B}}\)}. All of them are derived parameters in our code. \(k_{\textrm{c}}\) is related to \({\tilde{\delta }}_0={\tilde{\delta }}(r=0,t_0)\), where the integrated mass density contrast \({\tilde{\delta }}(r,t_0)\) [12] is defined as

$$\begin{aligned} {\tilde{\delta }}(r,t_0)= \frac{\Omega _m{H_{\bot }}^2}{\Omega _m^\textrm{out}{H_0^{\textrm{out}}}^2}-1, \end{aligned}$$
(11)

where “out” denotes the corresponding FLRW quantities. Because \(-1\le {\tilde{\delta }}_0<\infty \) is not good for the convergence of the Monte Carlo Markov Chain (MCMC), we will use a new parameter

$$\begin{aligned} \delta _0 =\left\{ \begin{array}{lcl} {\tilde{\delta }}_0 &{}&{} {\tilde{\delta }}_0 \le 0 \\ {\tilde{\delta }}_0/(1+{\tilde{\delta }}_0) &{}&{} {\tilde{\delta }}_0 >0 \\ \end{array} \right. . \end{aligned}$$
(12)

As for the two radii \(\{r_{\textrm{B}},r_{\textrm{C}}\}\), we will relate them to their corresponding redshifts by \(r_{\textrm{B}}=r(z_{\textrm{B}})\) and \(r_{\textrm{C}}=r(z_{\textrm{C}})\), where r(z) satisfies the geodesic equations

$$\begin{aligned} \frac{dt}{dz}=&-\frac{R'(r,t)}{(1+z)\dot{R'}(r,t)}, \end{aligned}$$
(13)
$$\begin{aligned} \frac{dr}{dz}=&-\frac{\sqrt{1+2r^2k(r){\tilde{M}}^2}}{(1+z)\dot{R'}(r,t)}. \end{aligned}$$
(14)

As mentioned before, the information about the whole void is out of reach of SNIa data. As we probe the central part of the void with an evaluated \(r_{\textrm{C}}\) and consider the unknown boundary to be far, but not extremely far, from that limit, we therefore further relate \(r_{\textrm{B}}\) to \(r_{\textrm{C}}\) as \(r_{\textrm{B}}=2r_{\textrm{C}}\). That is to say, we will only conservatively concentrate on the profile of the void where \(z\le z_{\textrm{C}}\), while the profile of the void where \(z_{\textrm{C}}<z\le z_{\textrm{B}}\) is set by our assumption \(r_\textrm{B}=2r_{\textrm{C}}\). Moreover, as \(z_{\textrm{B}}>0\) is meaningless when \(\delta _0\sim 0\), we relate \(z_{\textrm{B}}\) to \(|\delta _0|\) by a free parameter \(|z_{\textrm{B}}/\delta _0|\) which will proceed from a uniform prior distribution \(|z_{\textrm{B}}/\delta _0|\in [0,100]\). The remaining free parameter \(\delta _0\) will have a uniform prior distribution \(\delta _0\in [-0.99,0.99]\). We finally can use the dependence of SNIa’s luminosity distance on these two synthetic void parameters \(\{\delta _{0},z_{\textrm{B}}=|\delta _{0}|\times |z_{\textrm{B}}/\delta _0|\}\) to probe the profile of the void, where the angular diameter distance \(d_{\textrm{A}}\) and the luminosity distance \(d_{\textrm{L}}\) are obtained from

$$\begin{aligned} d_{\textrm{A}}(z;\delta _{0},z_{\textrm{B}})=&R(r(z),t(z);\delta _{0},z_{\textrm{B}}), \end{aligned}$$
(15)
$$\begin{aligned} d_{\textrm{L}}(z;\delta _{0},z_{\textrm{B}})=&(1+z)^2 d_\textrm{A}(z;\delta _{0},z_{\textrm{B}}). \end{aligned}$$
(16)

2.2 Data

In this paper, we only use the combined Pantheon sample [16] to constrain the local cosmic void. This dataset consists of 1048 SNIa in the redshift range \(0.01<z<2.3\). In Fig. 2, we show the distribution of these 1048 SNIa in the galactic coordinate system (lb). To probe the asymmetry in the local cosmic inhomogeneity, we divide the full dataset into several subsets, as listed in Table 1. Obviously, each SNIa subset can only give the local information of the universe which can be characterized by a corresponding LTB metric. That is to say, the whole profile of the local comic void should be reconstructed with the full SNIa dataset and described by several corresponding LTB metrics. In other words, our model obtains a probe of anisotropy as illustrated in Fig. 1. There, each LTB metric being spherically symmetric, the anisotropy of our model does not proceed from individual segments but from the assembly of the various solid angle segments. The model for each segment of the final assembly is indeed spherically symmetric. Such segment’s model is obtained by considering the data from that specific solid angle to virtually be duplicated in all directions into a spherically symmetric virtual data coverage. It then can be represented by an LTB metric. We virtually proceed by restricting the obtained LTB metric within its source data solid angle. The set of such solid-angle-restricted LTB metric is then able to capture anisotropy in the composite total model, despite originating from spherically symmetric models.

Therefore, for the case when the whole data set is used (hereafter, no cut case), we have

$$\begin{aligned} \chi ^2 =\chi ^2_{\textrm{P}_\textrm{All}}; \end{aligned}$$
(17)

for the division between North and South galactic plane subsets (one horizontal cut case), we have

$$\begin{aligned} \chi ^2=\chi ^2_{\textrm{P}_\textrm{N}}+\chi ^2_{\textrm{P}_\textrm{S}}; \end{aligned}$$
(18)

for the division between East and West galactic plane subsets (one vertical cut case), we have

$$\begin{aligned} \chi ^2=\chi ^2_{\textrm{P}_\textrm{E}}+\chi ^2_{\textrm{P}_\textrm{W}}; \end{aligned}$$
(19)

for the division into four quadrant using the previous subsets of the galactic plane (two cuts case), we have

$$\begin{aligned} \chi ^2 =\chi ^2_{\textrm{P}_\textrm{NE}}+\chi ^2_{\textrm{P}_\textrm{NW}}+\chi ^2_{\textrm{P}_{\textrm{SE}}}+\chi ^2_{\textrm{P}_{\textrm{SW}}}. \end{aligned}$$
(20)

The \(\chi ^2_s\) for every data subset are defined with

$$\begin{aligned} \chi ^2_s=\sum (\varvec{m}_{\textrm{B},s}^{\textrm{obs}}-\varvec{m}_{\textrm{B},s}^\textrm{mod})^T\varvec{C}^{-1}_s(\varvec{m}_{\textrm{B},s}^{\textrm{obs}}-\varvec{m}_{\textrm{B},s}^{\textrm{mod}}), \end{aligned}$$
(21)

where \(\varvec{C}_s\) is the covariance matrixFootnote 2 of the s-th subset, the apparent magnitudes \(\varvec{m}_{\textrm{B},s}^{\textrm{obs}}\) observed by Pantheon, including contributions from stretch \(x_1\), color c and host-galaxy correction \(\Delta M\). Note that the apparent magnitude \(m_{\textrm{B},s,i}^{\textrm{mod}}\) for the i-th SNIa of the s-th subset in the \(\Lambda \)LTB model depends on two void parameters \(\{\delta _{0,s},z_{\textrm{B},s}\}\) and the absolute magnitude \(M_{\textrm{B}}\) as

$$\begin{aligned}{} & {} m_{\textrm{B},s,i}^{\textrm{mod}}(z_{i};\delta _{0,s},z_{\textrm{B},s},M_{\textrm{B}}) \end{aligned}$$
(22)
$$\begin{aligned}{} & {} \quad =5\log _{10}\frac{d_{\textrm{L}}(z_{i};\delta _{0,s},z_{\textrm{B},s})}{1\textrm{Mpc}}+25+M_{\textrm{B}}. \end{aligned}$$
(23)

Since SNIa are supposed to be standard candles, we exclude the effects of variations of \(M_{\textrm{B}}\) in each SNIa subset on the asymmetry in the local cosmic inhomogeneity. Therefore, for every division case, we use the full dataset to constrain the only nuisance parameter \(M_{\textrm{B}}\).

Table 3 The constraints on void parameters (see Sect. 3) and the absolute magnitude

3 Results

The luminosity distance \(d_{\textrm{L}}(z;\delta _{0},z_{\textrm{B}})\) in the \(\Lambda \)LTB model is numerically given by \(\textsf{VoidDistances2020}\) [30] which should be fed with parameters corresponding to the largest scales of the universe. The initialization of the large scale universe parameters, outside the void, is done by \(\textsf{CLASS}\) [31], even though we don’t use the CMB data here. For \(\textsf{CLASS}\) [31], we need to provide the \(\Lambda \)CDM model’s six parameters. In Table 2, we list such parameters given by Planck 2018 for TT,TE,EE+lowE+lensing [1]. Finally, the likelihoods in Sect. 2.2 are added into \(\textsf{MontePython}\) [32] by our modified \(\textsf{monteLLTB}\) [12].

In Table 3, the constraints on \(\{\delta _{0,s},z_{\textrm{C},s},M_{\textrm{B}}\}\) with every data subset are summarized. In Figs. 3, 4, 5 and 6, the constraints on \(\{\delta _{0,s},z_{\textrm{C},s},M_{\textrm{B}}\}\) with every data subset for the no cut, horizontal cut, vertical cut and two cuts cases are also shown respectively. We choose to assume no anisotropy for \(M_B\) and treat it as a nuisance parameter. Because we need a standard probe, we used the full data set to constrain it. This is vindicated as the results shown in Table 3 turn out to be self-consistent. Although we suppose \(\delta _{0,s}\) of every LTB metric is only constrained with the corresponding data subset and there is no correlation between \(\delta _{0,s}\), for any division case, there is an obvious correlation between \(\delta _{0,s}\) in Figs. 4, 5 and 6. That correlation results from our assumption that SNIa are standard candles so all \(\delta _{0,s}\) directly correlates with \(M_{\textrm{B}}\) and thus indirectly correlates with the other \(\delta _{0,s}\). For every division case, the correlation between \(\delta _{0,s}\) just leads to a similar error on \(\delta _{0,s}\) \(0.08\sim 0.10\) but imposes no effect on the mean value of \(\delta _{0,s}\). Generally speaking, for all division cases, the constraints on \(\delta _{0,s}\) are consistent with the FLRW metric at \(95\%\) confidence level (CL): on the one hand, the constraints on \(\delta _{0,s}\) are consistent with 0, which denotes cosmic homogeneity; on the other hand, the constraints on \(\delta _{0,s}\) are consistent with each other, which indicates cosmic isotropy. However, the constraint on \(\delta _{\mathrm{0,P_{SE}}}=-0.15\pm 0.08\) deviates from 0 at almost \(2\sigma \). This deviation results either from the paucity of data in the \(\mathrm{P_{SE}}\) data subset or the real depth of the local cosmic void in this direction. Even though we have given up the determination of the profile at \(z_\textrm{C}\le z<z_{\textrm{B}}\) by setting \(r_{\textrm{B}}=2r_{\textrm{C}}\), the constraints on \(z_{\textrm{C},s}\) are still very weak. Although we found PDF peaks at \(z_{\textrm{C},s}=0\) and \(1\lesssim z_{\textrm{C},s}\lesssim 2.26\), we can’t conclude that the Pantheon data prefers a non-zero \(z_{\textrm{C},s}\) to \(z_{\textrm{C},s}=0\).

Finally, we can use the constraints on \(\{\delta _{0,s},z_{\textrm{C},s}\}\) for every division case, i.e. their best fit, to probe both of the local cosmic inhomogeneity and the cosmic anisotropy on small scales. In Figs. 7, 8 and 9, we reconstruct the profile of local cosmic void \(\delta (z,t_0)\) in different direction (solid lines) with the constraints summarized in Table 3. At \(z\lesssim z_{\textrm{C},s}\) (dashed lines), the curvature changes by \(10\%\). And we complete the rest of profile until \(z_{\textrm{B},s}\) (dotted lines) by setting \(r_{\textrm{B}}=2r_{\textrm{C}}\). We find that even a small difference between \(z_{\textrm{C},s}\) can lead to a large difference between \(z_{\textrm{B},s}\) when the void is deeper at the center. And a deeper void (or a smaller \(\delta _{0,s}\)) usually favours a wider void (or a larger \(z_{\textrm{B},s}\)). Therefore, even a smaller cosmic inhomogeneity at the center of a deeper void can lead to a larger cosmic anisotropy at the boundary of this void.

Fig. 7
figure 7

The integrated mass density contrast \(\delta (z,t_0)\) for the no cut and horizontal cut cases, where \(\delta _0=-0.05\) (black solid), \(z_{\textrm{C}}= 1.97\) (black dashed) and \(z_{\textrm{B}}= 15.1\) (black dotted) for \( \mathrm P_{\textrm{All}}\), \(\delta _0=-0.11\) (blue solid), \(z_{\textrm{C}}= 2.16\) (blue dashed) and \(z_{\textrm{B}}= 19.4\) (blue dotted) for \( \mathrm P_{\textrm{N}}\) and \(\delta _0=-0.07\) (red solid), \(z_{\textrm{C}}= 2.05\) (red dashed) and \(z_{\textrm{B}}= 16.8\) (red dotted) for \( \mathrm P_{\textrm{S}}\) respectively

Fig. 8
figure 8

The integrated mass density contrast \(\delta (z,t_0)\) for the no cut and vertical cut cases, where \(\delta _0=-0.05\) (black solid), \(z_{\textrm{C}}= 1.97\) (black dashed) and \(z_{\textrm{B}}= 15.1\) (black dotted) for \( \textrm{P}_\textrm{All}\), \(\delta _0=-0.08\) (blue solid), \(z_{\textrm{C}}= 2.02\) (blue dashed) and \(z_{\textrm{B}}= 15.9\) (blue dotted) for \( \mathrm P_{\textrm{W}}\) and \(\delta _0=-0.11\) (red solid), \(z_{\textrm{C}}= 2.28\) (red dashed) and \(z_{\textrm{B}}= 23.5\) (red dotted) for \( \mathrm P_{\textrm{E}}\) respectively

Fig. 9
figure 9

The integrated mass density contrast \(\delta (z,t_0)\) for the no cut and two cuts cases, where \(\delta _0=-0.05\) (black solid), \(z_{\textrm{C}}= 1.97\) (black dashed) and \(z_{\textrm{B}}= 15.1\) (black dotted) for \( \mathrm P_{\textrm{All}}\), \(\delta _0=-0.11\) (blue solid), \(z_{\textrm{C}}= 2.16\) (blue dashed) and \(z_{\textrm{B}}= 19.4\) (blue dotted) for \( \mathrm P_{\textrm{NW}}\), \(\delta _0=-0.09\) (red solid), \(z_{\textrm{C}}= 2.10\) (red dashed) and \(z_{\textrm{B}}= 17.9\) (red dotted) for \( \mathrm P_{\textrm{NE}}\), \(\delta _0=-0.06\) (green solid), \(z_{\textrm{C}}= 1.88\) (green dashed) and \(z_{\textrm{B}}= 13.0\) (green dotted) for \( \mathrm P_{\textrm{SW}}\) and \(\delta _0=-0.15\) (cyan solid), \(z_{\textrm{C}}= 2.34\) (cyan dashed) and \(z_{\textrm{B}}= 24.6\) (cyan dotted) for \( \mathrm P_{\textrm{SE}}\) respectively

4 Summary and discussion

In this paper, we try to test both of the local cosmic inhomogeneity and anisotropy on small scales at the same time using the SNIa data of Pantheon. Similarly to the hemisphere comparison method, however using the LTB metric instead of the FRLW metric, we first divide the full dataset into several data subsets and then use the data subsets to constrain the void parameters \(\{\delta _{0,s},z_{\textrm{C},s}\}\) in the corresponding direction. Due to the paucity of data, we concentrate on the profile of the void at \(z<z_{\textrm{C}}\) where the curvature changes by \(10\%\). Despite this maneuver, only \(\delta _{0,s}\) turns out well constrained, contrary to \(z_{\textrm{C},s}\). The constraints on \(\delta _{0,s}\) for all division cases are consistent with the FLRW metric at \(95\%\) CL. The constraints on \(z_{\textrm{C},s}\) for all division cases are almost beyond 2.26 at \(95\%\) CL. That is to say, our constraints are too weak to challenge the cosmic homogeneity and isotropy. If the local cosmic void does exist, however, even a smaller cosmic inhomogeneity at the center of a deeper void can lead to a larger cosmic anisotropy at the boundary of this void.

Although our results are consistent with the cosmic homogeneity and isotropy at \(95\%\) CL, as the \(\delta _{0,s}\) are consistent with 0 (denoting cosmic homogeneity) while the constraints on \(\delta _{0,s}\) are consistent with each other (indicating cosmic isotropy), there are some deviations from FLRW metric at \(68\%\) CL. These deviations result either from the paucity of data in the subset or real physics in the corresponding direction. Therefore, more SNIa observations or other cosmological observations are needed to alleviate the possible effect of paucity of data in certain directions.