Introduction

The impact of environmental factors on the long-term preservation of cultural heritage and museum collections is widely recognized. Many national and international standardization organizations have provided guidelines on the environmental impact and risk management of museums and heritage buildings1,2,3,4,5,6. Scholars have conducted in-depth research on the deterioration mechanisms of murals, brick-and-stone artifacts, and historic buildings under the influence of environmental factors7,8,9,10. Methods such as monitoring and analysis, numerical simulation, and machine learning have been widely applied to assess indoor microclimate risks in cultural heritage settings11,12,13,14,15.

With the increasing impact of global climate change, research on environmental fluctuations and risk response strategies for cultural heritage has received increasing attention16,17,18,19,20,21. Additionally, the influence of human activities, such as visitor traffic, on the indoor microclimate of cultural heritage sites has emerged as a key research focus22,23,24,25,26,27,28.

The Mogao Caves, a UNESCO World Heritage site located in Dunhuang, Northwest China, are a renowned Buddhist grotto complex with a history spanning over 1600 years. Nestled in a cliff that stretches ~1700 m, the site encompasses 735 caves, with 492 featuring over 45,000 square meters of exquisite murals and more than 2000 statues. These artworks provide a vivid portrayal of ancient Chinese social life, boasting substantial historical, artistic, and cultural significance. In 1987, the Mogao Caves were recognized as a UNESCO World Heritage site, distinguished by meeting all the organization’s value criteria.

Over the centuries, the Mogao Caves have experienced inevitable deterioration. Investigations have identified the primary forms of decay, which include disruption, flaking, detachment, and cracks (Fig. 1). Disruption, particularly problematic due to the deliquescence and crystallization of hygroscopic salts on the mural surfaces, fluctuates with indoor humidity changes29. Studies, such as those by Demas et al.30, have found that when indoor relative humidity reaches 67%, these salts may deliquesce, initiating the disruption of the murals. Often described as the “cancer” of murals, this type of deterioration is markedly sensitive to environmental variations and exceedingly challenging to restore.

Fig. 1: Examples of the main types of deterioration in Mogao Caves.
figure 1

a Disruption, b Flaking, c Detachment, d Cracks.

Fortunately, located in the Gobi Desert at the westernmost end of the Hexi Corridor in Northwest China, the Mogao Caves benefit from a warm temperate arid continental climate with minimal rainfall, where the average annual precipitation is only 40.04 mm31. These dry conditions help maintain low relative humidity inside the caves, stabilizing the hygroscopic salts and thereby mitigating disruptions. This climatic advantage has been crucial in preserving the invaluable murals and statues within the caves.

Fig. 2: Location and preservation status of Cave 71 in Mogao Caves.
figure 2

a Elevation view showing the distribution of caves at the Mogao Caves, b Interior view of Cave 71 at the Mogao Caves.

However, the recent surge in tourism has significantly affected the Mogao Caves. Visitor numbers have increased dramatically, from 780,000 in 2013 to 2.56 million in 2023, marking a 228% rise over a decade. The caves, 83% of which are smaller than 25 square meters32, typically feature a single entrance that serves both for visitor access and natural ventilation, resulting in limited air exchange. Consequently, the influx of visitors substantially alters the cave’s indoor climate, posing a significant threat to the murals’ preservation.

This prompts the question: What impact do tourists have on the indoor temperature and relative humidity conditions upon entering the caves?

Maekawa et al.33 studied two structurally similar caves—one open to the public and the other closed—and monitored the indoor temperature, relative humidity, CO2 concentration, mural surface temperature, and visitor numbers over a year. They observed that visitor entry caused rapid, transient changes in the microenvironment. Demas et al.30 explored the potential risks of tourism on the Mogao Caves, including an analysis of the types of hygroscopic salts found in the murals, the mechanisms of deterioration under deliquescence and crystallization, and the monitoring of the caves’ indoor climate. They established thresholds for relative humidity and CO2 concentration and determined the maximum sustainable visitor capacity, ultimately formulating a comprehensive tourism strategy for the site. They discovered that high humidity levels in the caves primarily resulted from the intrusion of humid or rainy outside air during visitor entry. In the studied caves, visitors contribute only about 5% of moisture through breath and perspiration. Zhang et al.34 conducted experiments in two similar caves and found that while external temperatures predominantly influenced the caves’ internal temperatures, visitor entry significantly spiked the relative humidity. Chen et al.35 conducted a decade-long monitoring and comparative analysis, observing that relative humidity in open caves correlated closely with visitor frequency and surged during rainfall periods. Closing the caves effectively isolated them from external humidity fluctuations.

However, previous studies have primarily used qualitative methods to indicate that temperature and relative humidity inside the caves increase with visitor entry, based on monitoring data collected over time. To devise more effective management strategies for the caves and ensure the stability of their indoor climate, further quantitative research is imperative. This research should examine the variations in temperature and humidity within the caves under different climatic conditions when visitors are present, aiming to specify the precise impact of visitor activity on these environmental parameters. Given the implications of global climate change and the escalating visitor numbers at the Mogao Caves, this investigation is particularly urgent.

The closure of the Mogao Caves due to the COVID-19 pandemic from January 24, 2020, to May 10, 2020, presented a unique opportunity to gather valuable data on the indoor climate during an extended period without visitors. Assuming that external climate conditions remained consistent with those observed in 2019, we utilized a comparative study approach. Employing wavelet analysis, we selected representative caves at the Mogao Caves to perform a time-frequency ___domain comparative analysis of the internal and external temperature and humidity data for 2019 and 2020. This analysis helped us to ascertain the frequency ___domain response characteristics of cave temperature and humidity in response to visitor presence. Additionally, through frequency decomposition, we quantified the specific contributions of visitor activity to the changes in cave temperature and humidity. Compared to traditional time ___domain analysis and Fourier transform techniques, wavelet analysis provides the capability for localized, multiscale, detailed signal analysis in both time and frequency dimensions, making it highly suitable for processing climate signals in cultural heritage contexts36,37,38.

This paper employs wavelet analysis to compare monitoring data from periods of normal operation and COVID-19-related closures, effectively isolating the response frequencies of cave temperature and relative humidity to external environmental conditions and visitor activities in the time-frequency ___domain. This approach introduces a degree of innovation in the research methodology.

The main contributions of this paper are as follows: (1) Utilizing time ___domain analysis, the study explores the indoor climate of the Mogao Caves and its relationship with external climatic conditions, demonstrating that both rainfall events and visitor activities influence the cave’s relative humidity, with rainfall exerting a more significant effect. (2) Through wavelet analysis, by comparing data from periods of normal operation and COVID-19 closures, the study identifies the frequency bands that are impacted by visitor activities on the indoor temperature and relative humidity of the Mogao Caves. (3) Employing wavelet decomposition, the study quantitatively assesses the influence of visitor entry on the indoor temperature and the extent of relative humidity fluctuations during normal and rainy conditions. The findings of this paper aid in assessing and refining the current management strategies of the Mogao Caves and provide a theoretical foundation for further scientific preservation efforts.

The rest of the paper is organized as follows. “Methods” introduces the research subjects, data sources, and research methods. “Results” presents the research results, focusing on the statistical analysis of the indoor climate and external climatic conditions, as well as the quantitative analysis of the impact of visitor activities on the indoor climate of the caves. “Discussion” discusses the findings and concludes the paper.

Methods

Case study

The focus of this study is Cave 71 at the Mogao Caves in Dunhuang. Situated north of the renowned Cave 96, Cave 71 was excavated during the early Tang Dynasty (618–704 AD). It features a square layout with a Buddha niche located on the west wall. The combined area of the cave and the niche is ~18 m², and the volume is around 67 m³. The cave houses ~51 m² of murals and five statues. An aluminum door, measuring 3.78 m², is installed on the east wall and serves as the sole entry for visitors and the primary means of natural ventilation, given the absence of mechanical ventilation systems (Fig. 2).

Cave 71 is a tourist-accessible site, with visitors entering almost daily. On regular open days, staff unlock the cave entrance in the morning, and visitors explore the cave under the guidance of tour guides. In the afternoon, after visitation hours end, staff close the entrance. Due to the cave’s compact size, visitor activity significantly impacts its microclimate.

Additionally, a fully automatic weather station, positioned less than 3 m from the cave, facilitates comparative studies of the indoor climate and external conditions. These characteristics render Cave 71 an ideal subject for this investigation.

Data sources

To examine the impact of visitor activities on the indoor climate of Cave 71, wireless temperature and relative humidity data loggers were strategically positioned at three locations: in front of the Buddha niche, in the southeast corner, and in the northwest corner of the cave. Additionally, a wireless carbon dioxide (CO2) data logger was installed in front of the Buddha niche to track changes in CO2 concentration during visitor entries. The placement of these sensors is depicted in Fig. 3.

Fig. 3: Data logger ___location in Cave 71 of Mogao Caves.
figure 3

In the cave floor plan, the red symbols indicate the locations where sensors are installed.

Given that each visitor group spends ~3–5 min inside the cave, the data loggers were programmed to sample every minute, adhering to the Nyquist-Shannon sampling theorem. This frequency is designed to capture even the subtlest effects of visitor presence on the cave’s indoor climate. The data loggers, developed by Zhejiang University, include temperature and humidity sensors (model WEMS400-HT) with an accuracy of ±0.3 °C (from −30 °C to +75 °C) for temperature and ±2% (from 20% to 90%) for relative humidity. The CO2 data logger (model WEMS400-CO2) has an accuracy of ±3% (from 0 ppm to 5000 ppm). Data collected by these sensors are transmitted in real-time through a LoRa network to an IoT gateway located outside the cave and subsequently via WiFi to a data management platform39.

An automatic weather station situated just outside the cave gathers external data on temperature, relative humidity, wind speed, wind direction, and rainfall at 10-min intervals. These instruments have been integral to the Mogao Caves monitoring and early warning system for over a decade40. This study utilizes observational data collected from 2019 to 2021 for comparative analysis.

Data analysis methods

This study initially employs statistical analysis to compare the indoor climate characteristics of Cave 71 with the external environment, identifying the general features of the cave’s temperature and relative humidity. Subsequently, we utilize wavelet time–frequency diagrams, wavelet coherency spectra, and cross-wavelet spectra to analyze the temperature and humidity characteristics of the cave during the open visitation period in 2019 and the closure period in 2020, prompted by the COVID-19 pandemic. This approach allows us to identify the response frequency bands of the cave’s temperature and humidity to external climatic conditions and visitor activities. Finally, wavelet decomposition is applied to quantify the influence of visitor presence on the cave’s temperature and humidity levels.

It is important to note that, due to technical limitations, there is currently no visitor counting system inside the Mogao Caves. However, according to the study by Demas et al.30, CO2 concentration inside the caves is closely correlated with visitor numbers and duration of visits. Therefore, we use CO2 concentration in Cave 71 as an indirect indicator of visitor presence.

Results

Statistical analysis of climate characteristics of Cave 71 and outdoor

Mogao Cave 71 is located on the ground level. According to the study by Demas et al.30, risk factors such as groundwater evaporation have minimal impact on the cave’s internal microclimate. Instead, the temperature and humidity inside the cave are primarily influenced by fluctuations in outdoor conditions, the opening and closing of the cave door, and visitor activity.

Statistical analysis of temperature and relative humidity data from 2019 to 2021 reveals that the average annual air temperature outside the caves is 11.7 °C, with extremes ranging from a high of 39.0 °C to a low of −19.1 °C. The average annual relative humidity is 29.1%, with fluctuations between 99.3% and 0.5% over the three years. Inside Cave 71, the average annual air temperature is slightly higher at 12.0 °C, ranging from 25.8 °C to −6.7 °C. The average annual relative humidity inside the cave is 30.8%, with a range from 80.0% to 8.7%. These figures highlight the substantial temperature variations and generally dry climate experienced at the Mogao Caves, although indoor fluctuations are somewhat moderated compared to external conditions.

The monthly statistical comparison from 2019 to 2021, as illustrated in Fig. 4a–c, shows that the temperature trend inside Cave 71 closely mirrors external conditions, displaying distinct seasonal patterns. Temperatures increase during the spring and summer months (March to August) and decrease in the autumn and winter (September to February). The cave environment maintains a more stable temperature, being cooler in the summer and warmer in the winter compared to outside. Conversely, relative humidity exhibits more complex fluctuations both inside and outside the cave, as depicted in Fig. 4d–f. Although overall humidity levels are low, both environments are subject to significant monthly variations and numerous anomalies due to various influencing factors.

Fig. 4: Monthly statistical comparison of temperature and relative humidity fluctuations inside Cave 71 and outdoors from 2019 to 2021.
figure 4

a–c Box plots of monthly temperature inside Cave 71 and outdoors from 2019 to 2021, d–f Box plots of monthly relative humidity inside Cave 71 and outdoors from 2019 to 2021.

Further analysis considers the effects of temperature changes, rainfall events, and tourist visits on indoor relative humidity. Figure 5 presents a comparative analysis of the monthly average temperature, relative humidity and monthly accumulated rainfall between Cave 71 and the outdoor environment, along with the total number of visitors to the Mogao Caves from 2019 to 2021. The relative humidity inside Cave 71, like temperature, is heavily influenced by external factors and follows a trend consistent with the outside environment, displaying seasonal characteristics. During the warmer months of spring and summer, the internal temperature of the cave remains lower than outside, while the relative humidity inside is higher, continuing into September. As temperatures cool in autumn and winter, the internal and external temperatures align more closely by September, with monthly averages nearly identical. From October to February, the cave’s temperature is notably higher than outside, while the humidity is lower.

Fig. 5: Comparison of the monthly average temperature, relative humidity and monthly accumulated rainfall between Cave 71 and the outdoor environment, along with the total number of visitors to the Mogao Caves from 2019 to 2021.
figure 5

a Monitoring data inside and outside the cave on 2019, b Monitoring data inside and outside the cave on 2020, c Monitoring data inside and outside the cave on 2021.

Compared to temperature, relative humidity exhibits not only seasonal fluctuations but also significant variations due to rainfall. In July 2019, the Mogao Caves recorded 37.8 mm of rainfall, the highest in three years, corresponding with the peak monthly average relative humidity inside the cave at 48.6%. Examining rainfall from March to June 2019, varying intensities of precipitation contributed to a steady increase in relative humidity both outside and inside Cave 71. In 2020, from March to April, there was no rainfall, leading to a decline in relative humidity due to rising outdoor temperatures. In May, with 9.2 mm of rainfall, both indoor and outdoor relative humidity increased. Compared to April, the outdoor relative humidity rose by 11.37%, nearly a 90% increase, while the indoor relative humidity increased by 10%, representing a 45.33% rise. In 2021, April and May saw rainfall totals of 10 mm and 9 mm, respectively, leading to a notable rise in relative humidity both inside and outside the cave in April. However, with a slight reduction in rainfall and a notable rise in outdoor temperatures in May, the outdoor relative humidity exhibited a decreasing trend, whereas the indoor relative humidity experienced a lesser decline due to the insulating properties of the cave’s rock and door structure.

Tourist activity also significantly impacts the microclimate within the cave. In July 2020 and 2021, rainfall was nearly identical, and the internal temperature of the cave remained similar (21.59 °C in 2020 and 22.44 °C in 2021). However, in July 2020, when the number of visitors to the Mogao Caves reached 145,200, the average relative humidity inside Cave 71 stood at 38.3%. In 2021, the visitor count increased to 534,100, and the average relative humidity rose to 44.0%, an increase of 5.7%. By contrast, the outdoor relative humidity during these periods only differed by 2.3%: 25.2% in 2020 and 27.5% in 2021. Further analysis of August 2020 and 2021 shows consistent rainfall and average temperatures both inside and outside, but differing visitor numbers. In August 2020, with 250,200 visitors, the average indoor relative humidity was 36.1%. In the following year, with a reduced count of 127,300 visitors, the indoor relative humidity decreased by 2.5% to 33.6%. The outdoor relative humidity varied minimally between these two periods, indicating that fluctuations in visitor numbers lead to significant changes in indoor relative humidity.

Considering that monthly average statistics may significantly weaken the impact characteristics of rainfall and visitor activity on the cave’s relative humidity, we selected typical time periods for Cave 71 to further analyze how different weather conditions and visitor activity influence indoor humidity.

First, we analyzed three typical rainfall events under similar climatic conditions from 2019 to 2021 to examine the response characteristics of Cave 71’s relative humidity to external rainfall events. As shown in Fig. 6, the temperature and relative humidity inside and outside the cave, as well as the cave’s CO2 concentration, are presented as 10-min measured values, while rainfall amounts are shown as hourly cumulative values.

Fig. 6: Comparison of temperature and relative humidity inside and outside Cave 71 during three typical rainfall events under similar climatic conditions from 2019 to 2021.
figure 6

a Monitoring data inside and outside the cave on May 6, 2019. b Monitoring data inside and outside the cave on May 6, 2020. c Monitoring data inside and outside the cave on April 23, 2021.

From Fig. 6a, on May 6, 2019, the rainfall event consisted primarily of continuous light rain, beginning around 08:00 and accumulating 4.1 mm by midnight. During the rainfall, the outdoor temperature gradually decreased, while the cave’s internal temperature remained relatively stable. The relative humidity inside and outside the cave began to rise before the rainfall started, fluctuating in response to changes in rainfall intensity. Between 10:00 and 11:00, when rainfall reached its peak for the day, both indoor and outdoor relative humidity also reached their highest levels. Additionally, fluctuations in cave humidity during some open periods aligned with variations in CO2 concentration, indicating an influence from visitor activity. After the cave door was closed at 18:00, the indoor relative humidity stabilized, with minimal influence from external humidity.

Figure 6b presents data from May 6, 2020. Compared to the same period in 2019, the rainfall that day was characterized by short but intense showers, with a total accumulation of 2.8 mm. The primary rainfall event occurred between 10:00 and 11:00, contributing 2.4 mm. Although outdoor relative humidity increased significantly before the rain, the brief duration of the rainfall led to a rapid decline in humidity as temperatures rose afterward. Due to COVID-19 restrictions, Cave 71 was closed to visitors that day, and the cave door remained shut. Consequently, the rainfall had little effect on the temperature and humidity inside cave.

Figure 6c shows data from April 23, 2021, when rainfall mainly occurred between 13:00 and 18:00, with a total accumulation of 6.0 mm. Before the rain, the outdoor temperature showed a slight decrease, while both indoor and outdoor humidity remained relatively stable. Even when visitors entered the cave around 10:00, the indoor relative humidity exhibited only minor fluctuations. However, as the rainfall began, outdoor humidity rose sharply, followed by a rapid increase in cave humidity.

Notably, the fluctuations observed during the rise in relative humidity inside the cave closely resembled variations in CO2 concentration. Moreover, the highest relative humidity inside the cave did not coincide with peak rainfall but instead occurred between 16:00 and 17:00, after the rainfall had weakened and visitors re-entered the cave. This suggests that changes in cave humidity during rainfall are influenced by both precipitation and visitor activity.

From the above analysis, it is evident that during rainfall, the relative humidity inside the cave is primarily influenced by precipitation, while visitor activity further contributes to increased humidity levels. When the cave door remains closed, the internal temperature and humidity remain more stable.

This raises another question: under normal weather conditions, is the variation in cave humidity primarily driven by the opening and closing of the cave door or by visitor activity?

To explore this, we selected several sets of monitoring data with varying differences in relative humidity between the cave interior and exterior. As shown in Fig. 5, the relative humidity differences between the inside and outside of Cave 71 are relatively small in February, March, and October, while the differences are more pronounced in other months. Since precipitation in Dunhuang during February and March mainly comes from snowmelt, which has a weak correlation with fluctuations in external humidity, we excluded these months from further analysis. Taking into account factors such as temperature differences and visitor activity, we selected monitoring data from October 21, October 16, and July 15, 2019, for comparative analysis. As shown in Fig. 7, the temperature and humidity inside and outside the cave, along with CO₂ concentration, are presented as 10-min measured values.

Fig. 7: Comparison of the impact of visitor access on cave temperature and relative humidity under different indoor-outdoor climate differences in Cave 71.
figure 7

a Monitoring data inside and outside the cave on October 21, 2019. b Monitoring data inside and outside the cave on October 16, 2019. c Monitoring data inside and outside the cave on July 15, 2019.

Figure 7a illustrates the response characteristics of cave relative humidity to visitor access under conditions where the humidity difference between the cave interior and exterior is minimal. Specifically, on October 21, 2019, during the closed periods from 00:00 to 09:00 and 18:00 to 24:00, the average humidity difference between the inside and outside of the cave was only 2.62%. However, when the cave door was open for visitors from 09:00 to 18:00, this difference increased to an average of 7.20%.

Analysis of the monitoring data during open hours shows that as the external temperature rose throughout the day. Between 11:00 and 17:00, it is almost identical to the temperature inside the cave. In contrast, the external relative humidity exhibited a significant decline during the daytime. When the cave door opened at 09:00, the relative humidity reached a brief equilibrium. As visitors entered, the CO₂ concentration fluctuated noticeably, and the cave’s relative humidity showed similar fluctuations. This indicates that visitor activity contributed to a slight increase in relative humidity inside the cave.

Figure 7b presents the response of cave relative humidity under conditions where external humidity was significantly higher than internal humidity, and light rainfall occurred during open hours. On October 16, 2019, from 00:00 to 09:00, the relative humidity fluctuations inside and outside the cave remained stable, with an average difference of 10.66%. During open hours, three notable temperature drops were recorded outside the cave, each corresponding to distinct humidity spikes. Among these, the peak between 14:00 and 15:00 was primarily influenced by light rainfall at the Mogao Caves. Although the recorded rainfall in front of the cave was only 0.2 mm, the external relative humidity surged from approximately 40% before the rain to 70%. As the rainfall ended, the humidity gradually decreased. This resulted in a rapid 15% increase in the cave’s relative humidity, pushing it above 50%—the highest level recorded during open hours that day.

Outside the rainfall period, when the cave door opened at 09:00, an initial equilibration process of the relative humidity between the interior and exterior of the cave takes place, and then, it fluctuated slightly due to visitor entry. Around noon, external humidity increased by ~10% due to cooling, but since the cave temperature remained relatively stable, its internal humidity showed little response. Between 16:00 and 17:00, CO₂ concentration data indicated a lower visitor presence, while a 15% rise in external humidity—driven by cooling and moisture from the earlier rainfall—led to a corresponding 5% increase in cave humidity. After 18:00, influenced by the temperature decrease outside the cave, the relative humidity outdoors increased remarkably, and the difference in relative humidity between the outdoors and inside the cave reached a maximum of 29.10%. Although the cave door was closed, this substantial humidity gradient still caused an approximately 10% increase in internal humidity. These findings suggest that when a significant humidity difference is induced by rainfall, the cave’s internal humidity is largely governed by external conditions, regardless of whether the door is open or closed.

Figure 7c shows the response of cave humidity to visitor access under normal weather conditions, where internal humidity was significantly higher than external humidity. On July 15, 2019, external humidity followed a sinusoidal pattern, fluctuating with temperature changes. During the early morning hours (00:00 to 09:00), the relative humidity was at its daily peak but still lower than the cave’s, with an average difference of 12.74%. Between 09:00 and 18:00, as external temperatures increased, relative humidity steadily declined, creating a humidity difference of up to 25%. Correspondingly, the cave’s relative humidity gradually dropped from 44% before opening to 36% by the time the door was closed.

However, a comparison with the CO₂ fluctuation curve reveals a clear correlation between visitor activity and humidity changes. At around 11:30, CO₂ levels peaked for the day, indicating the highest visitor frequency. During this period, the cave’s relative humidity also reached its highest point of the day, rising by ~14% compared to pre-opening levels. After the cave was closed at 18:00, external humidity experienced another rise, leading to a slight increase in internal humidity as well. The average relative humidity difference between the inside and outside of the cave reached 7.37%. These findings indicate that, although the overall trend in cave humidity primarily follows external humidity fluctuations, it also experiences discernible fluctuations as a result of the impact of tourist visits.

In conclusion, both rainfall and tourist visits contribute to the elevation of relative humidity inside the cave, with rainfall exerting a more substantial effect. However, discerning the precise influence of these factors remains challenging, especially when tourist visits and rainfall events coincide. This situation illuminates the limitations of time ___domain data analysis in such intricate scenarios.

To address these complexities, further research utilizing monitoring data from typical periods before and after the pandemic in 2019 and 2020 is planned. This study will employ wavelet analysis to provide deeper insights into how these factors affect the cave’s relative humidity.

Wavelet analysis of the impact of tourist visits on Cave 71 indoor climate

This section examines the environmental monitoring data from inside and outside Cave 71 from May 1 to 9 in 2019, compared with the same period in 2020, to analyze the impact of visitor access on the indoor microclimate. The initial period in 2019, from May 1 to 4, coincided with the International Labor Day holiday, which typically attracts a high number of visitors to the Mogao Caves. Additionally, rainfall occurred on May 6, 2019. In contrast, the Mogao Caves were closed from May 1 to 9, 2020, due to the COVID-19 pandemic, though rainfall was also recorded on May 6 to 7, 2020. This comparison provides a unique opportunity to study the impact of visitor access under typical weather conditions and the effects of rainfall on the indoor climate when the cave is both open and closed.

Figure 8 presents the wavelet time-frequency analysis of temperature fluctuations in Cave 71 during the Labor Day periods of 2019 and 2020. Comparisons between Fig. 8a and Fig. 8b highlight that, in addition to significant daily periodic fluctuations, the year 2019 showcased a distinct high-energy region at higher frequency scales (periods of 8 h and below) predominantly during the daytime hours of 8 A.M. to 9 P.M. In contrast, such high-energy regions were absent in 2020.

Fig. 8: Wavelet time-frequency analysis of temperature fluctuations in Cave 71 during the Labor Day periods of 2019 and 2020.
figure 8

The horizontal axis represents the shift factor, indicating the directional movement of the wavelet function in the time ___domain. The vertical axis represents the scale factor, which adjusts the width of the wavelet function, thereby representing different frequency components of the signal. The color at the intersection of the shift and scale factors denotes the wavelet coefficients, indicating the energy level of the signal at that point. Areas encircled by solid black lines indicate results that have passed the 0.05 significance level test. The gray shaded areas, known as the cone of influence, are susceptible to edge effects and are therefore not analyzed in this study.

Further examination of the signals from May 1 of both years, detailed in Fig. 8c and Fig. 8d, confirms the presence of high-energy regions in 2019 during active visitor hours, while no similar activity is noted for the same period in 2020. To ensure that these observations were not influenced by external climate fluctuations, Table 1 presents a comparative statistical analysis of the temperature data inside and outside Cave 71 on May 1, 2019, and the corresponding day in 2020. The external temperature on May 1, 2020, was higher with a broader range compared to 2019. However, the indoor temperature on the same day in 2020 was lower and demonstrated greater stability. These findings align with the wavelet time-frequency analysis, indicating that the observed daily high-energy phenomena in 2019 were primarily due to the thermal impact of visitor access.

Table 1 Statistical analysis of temperature data outside and inside Cave 71 on May 1, 2019, and May 1, 2020

To dive deeper into the influence of visitors on the temperature dynamics within Cave 71, wavelet decomposition was conducted on the temperature data, with findings illustrated in Fig. 9.

Fig. 9: Raw temperature data and the results of multilevel decomposition and coefficient reconstruction through discrete wavelet transform for May 1, 2019, and the corresponding day in 2020.
figure 9

The raw outdoor air temperature signals are displayed in a and l, while the indoor air temperature signals of Cave 71 are shown in b and m. Subsequent panels (cv) illustrate the results from the 8-level wavelet decomposition of these signals: c and n show the low frequency approximation signals; d through v display the medium-high frequency detail signals, segmented into increasingly shorter periods ranging from 8–4 h to 4–2 min.

Analysis of the raw temperature signals from 2019 and 2020, shown in Fig. 9b and Fig. 9m respectively, reveals marked fluctuations in 2019 post-9 AM due to visitor activity, in contrast to the relative stability observed in 2020 with minimal daily variations. Figure 9c and n capture fluctuations over periods of 8 h or longer, reflecting the cave’s daily response to external temperature changes. Notably, in 2019, temperature within the cave initially rises and then falls post-9 AM, with a significant decline observed between 5 PM and 9 PM, a pattern absent in 2020. Post-9 PM in both years, temperatures gradually decrease, with the 2019 reduction primarily attributable to the increased temperatures during visitor hours, which normalize post-closure. Conversely, in 2020, with the cave closed all day, temperatures remained stable until 9 P.M., only decreasing with the external temperature drop. Figure 9d and o illustrate the longer-term temperature changes within the cave attributable to visitor activity, highlighting two pronounced peaks around 11 A.M. and 5 P.M., followed by a decline from 5 P.M. to 7 P.M., aligning with visitor influx patterns. The slight temperature increase post-7 PM correlates with the cave’s closure. Figure 9ek showcases strong fluctuations during operating hours, primarily due to the heat exchange between the indoor and outdoor environments and the heat emitted by visitors. However, in Fig. 9j, k, despite the cave being closed, some fluctuations persist, considered as noise due to their high frequency. Compared to 2019, the medium-high frequency signals in 2020 exhibit no significant features and only minor fluctuations, likely due to noise.

Figure 8c shows that the significant high-energy phenomena at high frequency scales in the 2019 analysis mainly occurred during periods of less than 8 h, as demonstrated by the signals in Fig. 9d–k. By filtering out these medium-high frequency signals and considering the medium-low frequency approximation signal in Fig. 9c as unaffected by visitor activity, we calculated the highest temperature of the day to be 16.6 °C, with a daily range of 2.8 °C. In contrast, the actual highest temperature recorded inside the cave that day was 18 °C, with a daily range of 4.2 °C, suggesting that visitor presence increased the maximum temperature by 1.4 °C and also heightened the temperature amplitude by 1.4 °C.

For comparison, in 2020, after excluding the medium-high frequency signals, the highest recorded temperature was 14 °C with a daily range of 0.8 °C, aligning with the unfiltered measurements, thus underscoring the influence of visitor activity on temperature variations within Cave 71.

Figure 10 presents the wavelet time-frequency analysis of relative humidity fluctuations in Cave 71 during the Labor Day periods of 2019 and 2020. A comparative analysis of Fig. 10a and Fig. 10b reveals that in 2019, there was a significant high-energy region at scales of 2 h and below, characterized by the absence of notable periodic fluctuations in the low frequency range. Upon closer examination of the signals from May 1 of both years, as depicted in Fig. 10c and Fig. 10d, it is clear that the high-energy region in 2019 predominantly occurred between 9 A.M. and 7 P.M. daily. In 2020, while some regions passed the significance test, these were confined to the high frequency region of 0.5 h and below, exhibiting lower energy and a more dispersed distribution, which likely indicates noise.

Fig. 10: Wavelet time-frequency analysis of relative humidity fluctuations in Cave 71 during the Labor Day periods of 2019 and 2020.
figure 10

a, b Wavelet time-frequency spectra of daily-scale fluctuations in relative humidity inside the cave during the Labor Day holidays in 2019 and 2020. c, d Wavelet time-frequency spectra of hourly-scale fluctuations in relative humidity inside the cave on May 1st, 2019 and 2020.

The analysis preliminarily suggests that the daily high-energy region at scales of 2 h and below in 2019 was primarily due to the cave being open to visitors. To ascertain whether the high-energy region in 2019 was significantly influenced by fluctuations in outdoor humidity, wavelet coherency and cross-wavelet transform techniques were utilized for a time-frequency ___domain correlation analysis of the relative humidity time series data inside and outside Cave 71. Considering the delayed effect of outdoor relative humidity on the cave’s environment, and the previously established impact of rainfall events and tourist visits on the cave’s air humidity, the data analysis period was extended to include April 28 to May 9, 2019, and the corresponding period in 2020. This extended analysis aimed to delineate the response characteristics of the cave’s relative humidity to both rainfall events and tourist visits.

Figure 11a and b illustrate the wavelet coherency spectra of relative humidity inside and outside Cave 71 for 2019 and 2020, respectively. These spectra reveal a significant correlation between the internal and external humidity on scales of 24 h and above, with a phase difference of π/4, suggesting that external humidity leads internal humidity by ~1/8 of a cycle. This observation corroborates findings by Zhang et al.41,42, indicating that the cave’s internal relative humidity is primarily influenced by external conditions, albeit with a degree of lag. For periods shorter than 24 h, the correlation between internal and external humidity in Cave 71 was significantly lower in 2019 compared to 2020. This discrepancy can be attributed to the cave’s closure in 2020, which resulted in more stable internal humidity, primarily affected by external atmospheric fluctuations, thus enhancing the correlation. In contrast, in 2019, the cave was open daily, and the introduction of moisture by a large influx of tourists caused fluctuations in internal humidity, diminishing the correlation with external conditions.

Fig. 11: Wavelet coherency and cross-wavelet spectrum of relative humidity inside and outside Cave 71.
figure 11

a, b Wavelet coherency (WTC) spectrum of relative humidity inside and outside Cave 71. c, d Cross-wavelet (XWT) spectrum of relative humidity inside and outside Cave 71.

Figure 11c and d display the intensity of common periods of relative humidity inside and outside Cave 71. High-intensity regions in both years predominantly occurred from May 5 to 8 on scales of 12–48 h, coinciding with the rainfall period. In the highest-intensity areas, the relative humidity fluctuations inside and outside the cave were nearly in phase, indicating a strong positive correlation with minimal lag effect. This suggests that during rainfall, external relative humidity becomes the dominant factor influencing humidity fluctuations inside the cave. Additionally, in 2020, Cave 71 exhibited a broader range of shared periodicity between indoor and outdoor humidity. This is largely due to the cave door remaining closed, resulting in fewer disturbances to the cave’s internal environment and thus a higher correlation between indoor and outdoor relative humidity conditions.

Upon comparing Fig. 11a with Fig. 10a, it is evident that the high-energy region at scales of 2 h and below, observed in Fig. 10a, does not appear in Fig. 11a. This discrepancy suggests that the high-energy region noted in Fig. 10a is not strongly correlated with external humidity, confirming that it is indeed influenced by tourist activity within the cave.

To validate this conclusion, this study conducted a coherence analysis between the cave’s relative humidity and CO₂ concentration, which is highly correlated with visitor numbers. The results are depicted in Fig. 10.

Figure 12a and b present the wavelet coherency spectra of CO2 concentration and relative humidity inside Cave 71 for 2019 and 2020. In 2019, a significant correlation was observed between CO2 levels and relative humidity, particularly for periods of 6 h and below. Notable high-energy regions were consistently present on a daily basis, except from May 6 to 8, when visitor numbers significantly decreased following the Labor Day holiday and due to rainfall. The synchronous changes in CO2 concentration and relative humidity were in phase, indicating a direct correlation without any lag. Conversely, in 2020, no significant correlation was observed due to the absence of visitors.

Fig. 12: Wavelet coherency and cross-wavelet spectrum between CO concentration and relative humidity inside Cave 71.
figure 12

a, b Wavelet coherency (WTC) spectrum between CO2 concentration and relative humidity inside Cave 71. c, d Cross-wavelet (XWT) spectrum between CO2 concentration and relative humidity inside Cave 71.

Figure 12c and d depict the intensity of common periods between CO2 concentration and relative humidity inside Cave 71. In 2019, significant high-intensity regions on scales of 2 h and below were observed daily, aligning closely with the findings shown in Fig. 10a. This consistency underscores that the high-energy characteristics of relative humidity in this frequency range were primarily driven by moisture introduced by visitors. In 2020, the observed high-intensity regions were on scales of 12 h and above, likely reflecting the influence of external environmental conditions on the cave’s internal climate due to its closure to visitors, resulting in similar dynamic characteristics in both CO2 concentration and relative humidity.

To further elucidate the impact of regular visitor access and rainfall events on the internal climate, relative humidity data inside Cave 71 on May 1 and May 6, 2019, were selected for detailed wavelet decomposition and reconstruction. This analysis aims to isolate and examine the specific contributions of visitor activity and external rainfall to the variations in relative humidity inside the cave.

From the analyses in Fig. 13a, l and Fig. 13b, m, comparing the outdoor and indoor relative humidity of Cave 71, it is clear that during open h (9 AM to 6 PM), significant fluctuations occurred in the cave’s relative humidity. On May 1, following the closure of the cave, relative humidity quickly reverted to pre-opening levels. However, on May 6, influenced by rainfall, the daily humidity range was wider, and the humidity levels remained elevated even after the cave had closed.

Fig. 13: Raw relative humidity data outside and inside Cave 71 on May 1 (left column) and May 6 (right column), 2019, along with the signals after multilevel decomposition and coefficient reconstruction using discrete wavelet transform.
figure 13

a and l display the raw outdoor relative humidity signals; b and m depict the raw indoor relative humidity signals of Cave 71. Subsequent panels cv illustrate the results from the 8-level wavelet decomposition of (b) and (m): c and n present the low frequency approximation signals; dv detail the medium-high frequency detail signals, with d and o covering the 8–4 h range; e and p the 4–2 h range; f and q the 2–1 h range; g and r the 1–0.5 h range; h and s the 30–15 min range; i and t the 15–8 min range; j and u the 8–4 min range; k and v the 4–2 min range.

Figure 13c, n illustrate the fluctuation characteristics for periods of 8 h or more. Analysis from Fig. 11 suggests that this frequency band is predominantly affected by fluctuations in outdoor relative humidity. When comparing the two days, characteristics similar to those observed in Fig. 13b, m are evident. On May 1, the fluctuation amplitude in Fig. 13c post-9 AM is ~10% lower than that in Fig. 13b, indicating that this segment of relative humidity is largely contributed by periods of less than 8 h. Conversely, on May 6, the fluctuation amplitude in Fig. 13n aligns with that in Fig. 13m, implying that the cave’s relative humidity on that day was mainly driven by external rainfall, with minimal influence from shorter periods.

Figure 13d, o depict the longer-period variations in the cave’s relative humidity within the 8–4 h range. Alongside the analysis in Fig. 12, it becomes apparent that on May 1, there is no significant correlation between this frequency band and either external relative humidity or the CO2 concentration inside the cave. As indicated in Fig. 13d, the amplitude variation in this range is minimal at ±1%, signifying a negligible impact on the cave’s relative humidity. In contrast, on May 6, the relative humidity for periods of 8 h or less exhibits a significant correlation with the CO2 concentration inside the cave. Figure 13o highlights a marked fluctuation in relative humidity following the opening of the cave doors at 9 AM, with a peak increase of nearly 10%.

Figure 13e–v display the medium-high frequency detail signals for periods shorter than 4 h on May 1 and 6, revealing significant fluctuations during the cave’s open h. According to the analysis in Fig. 12, these fluctuations are primarily driven by visitor access. Notably, Fig. 13j–v also demonstrate minor fluctuations during closed h; however, these are smaller in amplitude compared to those during open hours and, given their very high frequency, are considered noise and disregarded in further analysis.

Based on the wavelet signals from May 1 and May 6, filtering was applied to estimate the impact of normal and rainy weather conditions, combined with visitor presence, on the cave’s relative humidity. On May 1, the relative humidity signal influenced by the opening of the cave and visitor activity is primarily represented by the components in Fig. 13e–k. Thus, the signals in Fig. (c, d) serve as the baseline unaffected by external interference. The calculated highest relative humidity on this day was 34.6%, with a daily range of 7.6%. In contrast, the actual highest relative humidity recorded inside the cave was 46%, with a daily range of 20%. This discrepancy indicates that the opening of the cave and visitor presence contributed to an 11.4% increase in relative humidity and a 12.4% increase in humidity amplitude.

On May 6, components in Fig. 13o–v correlate with changes due to cave opening and visitor presence. Here, the signal in Fig. 13n acts as the baseline. The highest relative humidity on this day was calculated at 68.1%, with a daily range of 29.6%. Meanwhile, the actual highest relative humidity observed was 74%, with a daily range of 36%. This data suggests that visitor presence elevated the relative humidity inside the cave by 5.9% and the humidity amplitude by 6.4%.

Comparing conditions on May 6 (a rainy day) to May 1, it is evident that rainfall contributed to an average relative humidity increase of 23.9%. Excluding the impact of visitor presence, rainfall alone led to a 33.5% increase in the peak relative humidity and a 22% increase in the humidity amplitude. Furthermore, comparing data from the same period in 2020, the average daily relative humidity inside the cave on May 6, 2020, was 44.2%, 26% higher than on May 1, but the humidity amplitude increased by only 1%. Relative to the actual conditions on May 6, 2019, the average daily value decreased by 9.2%, and the amplitude decreased by 29%. Even after accounting for the impact of visitor presence, the peak relative humidity was still 20% lower, underscoring the significant influence of environmental conditions and visitor activity on the cave’s microclimate.

Discussion

At the Mogao Caves, hygroscopic salts on mural surfaces are a key factor contributing to mural deterioration. According to previous monitoring studies30,33, the temperature of mural surfaces inside the caves is generally lower than the ambient air temperature. A temperature difference of just 1 °C can lead to a 4–5% increase in relative humidity on the mural surface. Therefore, studying and controlling the cave’s air temperature and humidity conditions is crucial to mitigating the impact of hygroscopic salts on mural degradation. Since the cave is not equipped with air conditioning or climate control systems, its internal temperature and humidity are primarily influenced by fluctuations in outdoor conditions and visitor activity. This raises the question: how does opening the caves to visitors affect the indoor temperature and humidity environment under varying climatic conditions?

Analysis of environmental monitoring data from both inside and outside typical caves at the Mogao Caves demonstrates that internal temperature and relative humidity are mainly influenced by external weather fluctuations, exhibiting smaller amplitude variations compared to outdoors. Unlike temperature, relative humidity is additionally impacted by rainfall events and visitor presence, with rainfall exerting a more significant influence on the cave’s indoor humidity.

This sensitivity is largely attributable to the cave’s distinctive structure. Most of the main chambers in the Mogao Caves are enclosed by thick rock walls on all four sides, with the west wall adjoining the mountain and other caves carved into the north and south sides. The east wall, which does not directly face the outside, leads to a narrow stone corridor that connects to an outer brick and stone barrier wall, added in subsequent constructions. An aluminum alloy door, positioned at the junction of this corridor and the barrier wall, regulates access. Heat exchange within the caves primarily occurs through this barrier wall and the cave door. The gravel rock walls, characterized by their high thermal mass, act as thermal buffers, effectively stabilizing internal temperatures. Moreover, the substantial thickness of the east wall and the constricted corridor diminish the rate of air exchange, as outlined in reference43. Consequently, the cave is more susceptible to the effects of rainfall and visitor traffic, as moisture tends to accumulate within the cave due to restricted ventilation.

To investigate the impact of visitor entry on the internal temperature of the caves, a comparative study was conducted using wavelet time-frequency diagrams to analyze temperature fluctuations from May 2019 and the corresponding period in 2020, when the caves experienced regular visitor access and closure due to the COVID-19 pandemic, respectively. The study revealed that visitor presence influenced temperature on scales of 8 h and shorter, with significant high-energy regions identified. By applying wavelet decomposition and reconstruction techniques to filter out affected frequency bands, it was calculated that visitor entry increased the maximum indoor temperature by 1.4 °C on observed days. This suggests that while visitors contribute to indoor temperature changes, the primary influence remains the external atmospheric temperature. This finding is consistent with the temperature variation characteristics inside the caves observed in our statistical analysis of monitoring data.

Relative humidity is a crucial risk factor for the deterioration of murals. Despite the generally dry climate at the Mogao Caves, minor rainfall events and visitor activity can induce significant fluctuations in the cave’s relative humidity. To assess the impact of visitor entry on indoor relative humidity, wavelet coherency and cross-wavelet spectra were employed to analyze the correlations between outdoor relative humidity, indoor CO2 concentration, and internal relative humidity. The analysis showed that the cave’s indoor relative humidity significantly correlates with external relative humidity on scales of 24 h and longer, lagging by 1/8 of a cycle. Around rainfall events, the relative humidity inside and outside the cave exhibits strong common periodicity with a high degree of correlation. The response of indoor relative humidity to visitor activity is most pronounced on cycles of 6 h and shorter, with a particularly strong correlation at scales of 2 h and shorter. Further application of wavelet decomposition and reconstruction isolated relevant frequency bands, revealing that under normal conditions, visitor activity increases indoor relative humidity by more than 10% and causes substantial fluctuations. During rainfall, the increase in indoor relative humidity is predominantly driven by the influx of outdoor moisture when the cave door is open. Rainfall conditions elevate the amplitude of indoor relative humidity by over 20%, far exceeding the impact of visitor-induced fluctuations. When the cave door is closed, although internal relative humidity continues to rise, the door substantially impedes moisture ingress, reducing peak relative humidity inside the cave by about 20% compared to when the door is open.

The conclusions of this study align with the findings of Zhang34 and Chen35. Li et al.44 analyzed the impact of cave door openings and visitor activity on the microclimate of Mogao Cave 98 using thermal-humidity simulation methods. This study serves as a valuable complement to their findings. Compared to previous studies, the method used in this paper advance the research by quantifying the contributions of outdoor environmental factors and visitor activity to the temperature and humidity within the Mogao Caves. This analytical approach allows for a clearer understanding of the impact of visitor access on the cave microclimate, thereby supporting management in the development of more scientifically grounded strategies for regulating cave access.

Leveraging this methodology, future research could expand to encompass longer time scales to thoroughly examine the indoor climate characteristics of caves using wavelet analysis. This would further elucidate the response mechanisms of cave indoor climates to external climatic conditions and visitor activities across varying spatial dimensions and structural complexities of caves. Such studies are poised to offer theoretical support for the formulation of cave microclimate models and the implementation of intelligent environmental control systems within these sensitive cultural heritage sites.

This study employs wavelet analysis to quantitatively assess the impact of visitor access on the indoor climate of the Mogao Caves by analyzing environmental monitoring data from periods of normal operation and closure during the COVID-19 pandemic. The findings indicate:

  1. (1)

    The indoor temperature of the caves remains relatively stable, primarily influenced by external temperature fluctuations. Visitor access induces a slight increase in temperature, predominantly within an 8-hour period or less.

  2. (2)

    Relative humidity inside the caves is influenced by both external conditions and visitor presence. External humidity impacts the caves over cycles of 24 h or longer, exhibiting a lag of 1/8 of a cycle. Conversely, the impact of visitors is pronounced within cycles of 6 h or less and shows no lag.

  3. (3)

    Under normal weather conditions, visitor access results in a more than 10% increase in the cave’s indoor relative humidity. During rainfall, the amplitude of relative humidity inside the cave escalates by over 20%, surpassing the impact from visitors alone. Closing the cave entrance during such events effectively blocks external moisture, mitigating the risk of increased humidity and potential mural deterioration.

The study conclusively demonstrates that visitor access significantly affects the indoor climate of the Mogao Caves, particularly relative humidity. To protect the integrity of the murals, it is advisable to restrict visitor access and close the cave entrance during rainy conditions to prevent external moisture from infiltrating the caves. These conclusions enhance the understanding of the influence of visitor access on cave microclimates, aiding in the scientific management of the Mogao Caves and providing valuable insights for microclimate management at similar cultural heritage sites.