gpt4 init

This commit is contained in:
baiobelfer 2024-11-16 12:47:00 +01:00
commit af5ae2d079
12 changed files with 911 additions and 0 deletions

BIN
doc/figs/histogram_PM10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
doc/figs/histogram_WWA.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

BIN
doc/main.pdf Normal file

Binary file not shown.

126
doc/main.tex Normal file
View File

@ -0,0 +1,126 @@
\documentclass[a4paper,11pt]{article}
% Pakiety
\usepackage[utf8]{inputenc} % Obsługa znaków UTF-8
\usepackage[T1]{fontenc} % Poprawna obsługa czcionek
\usepackage[english]{babel} % Ustawienia języka
\usepackage{amsmath} % Pakiet matematyczny
\usepackage{graphicx} % Obsługa grafik
\usepackage{hyperref} % Hiperłącza
\usepackage{booktabs} % Estetyczne tabele
\usepackage{geometry} % Marginesy
\geometry{margin=1in} % Ustawienia marginesów
\usepackage[
sortcites,
backend=biber,
hyperref=true,
firstinits=true,
maxbibnames=99,
]{biblatex}
\addbibresource{references.bib}
% Tytuł i autorzy
\title{\textbf{Template for Scientific Paper in LaTeX}}
\author{Author Name$^1$, Co-author Name$^2$ \\
$^1$Affiliation 1, Email: author1@example.com \\
$^2$Affiliation 2, Email: author2@example.com}
\date{\today} % Data automatyczna
% Początek dokumentu
\begin{document}
\maketitle
\begin{abstract}
This is a template for writing scientific papers in LaTeX. The abstract provides a concise summary of the research objectives, methods, results, and conclusions. It should not exceed 250 words.
\end{abstract}
\section{Introduction}
Polycyclic aromatic hydrocarbons (PAHs) are a group of organic compounds consisting of two or more fused aromatic rings. These compounds are primarily formed as byproducts of incomplete combustion processes, including fossil fuel combustion, industrial operations, vehicle emissions, and biomass burning \cite{yang2002sources}. PAHs are persistent in the environment due to their stable chemical structure and hydrophobic nature, making them highly prone to accumulation in atmospheric particulate matter, such as PM10 and PM2.5 \cite{li2006urban}.
The presence of PAHs in the atmosphere is of significant environmental and public health concern. Many PAHs are recognized for their mutagenic, teratogenic, and carcinogenic properties \cite{haritash2009polycyclic}. Benzo[a]pyrene, one of the most well-studied PAHs, has been classified as a Group 1 carcinogen by the International Agency for Research on Cancer (IARC) \cite{iarc2010iarc}. Chronic exposure to airborne PAHs is linked to an increased risk of respiratory diseases, cardiovascular disorders, and cancer, particularly in urban and industrial areas with high levels of particulate pollution \cite{kim2013polycyclic}.
PAHs undergo various atmospheric processes, including photochemical reactions, volatilization, and deposition. Their distribution and fate are influenced by meteorological factors such as temperature, wind patterns, and humidity, as well as by proximity to emission sources \cite{chen2007polycyclic}. Understanding the spatial and temporal variability of PAHs in atmospheric particulate matter is critical for assessing their potential health impacts and for developing effective air quality management strategies.
This study aims to analyze the spatiotemporal distribution of PAHs in suspended particulate matter (PM10 and PM2.5) over a defined region and time frame. By integrating data on atmospheric PAH concentrations with meteorological parameters and source characteristics, the research seeks to provide insights into the dynamics of PAHs in the atmosphere and their implications for environmental health.
\section{Materials and Methods}
Provide a detailed description of the methods and materials used in the study. Include enough information to allow replication of the experiments.
\subsection{Data Collection}
Explain the data sources, sampling methods, and duration of data collection.
\subsection{Data Analysis}
Describe the statistical methods, tools, or software used to analyze the data.
\section{Results}
In this study, we analyzed the spatiotemporal distribution of polycyclic aromatic hydrocarbons (PAHs) in particulate matter. Below, we present the key findings through visual representations.
\subsection{Histogram of Concentrations}
The histograms in Figures~\ref{fig:histogram_pm10} and~\ref{fig:histogram_wwa} show the distribution of concentrations for PM10 and PAHs (WWA), respectively. These plots highlight the variability in pollutant concentrations across different measurements.
\begin{figure}[h]
\centering
\includegraphics[width=0.8\textwidth]{figs/histogram_PM10.png}
\caption{Histogram of PM10 concentrations.}
\label{fig:histogram_pm10}
\end{figure}
\begin{figure}[h]
\centering
\includegraphics[width=0.8\textwidth]{figs/histogram_WWA.png}
\caption{Histogram of PAH (WWA) concentrations.}
\label{fig:histogram_wwa}
\end{figure}
\subsection{Temporal Trends}
Figure~\ref{fig:mean_concentration_over_time} presents the mean concentrations of pollutants over time. This time-series analysis reveals seasonal patterns and potential temporal variability in pollutant levels.
\begin{figure}[h]
\centering
\includegraphics[width=0.8\textwidth]{figs/mean_concentration_over_time.png}
\caption{Mean concentrations of pollutants (PM10 and PAHs) over time.}
\label{fig:mean_concentration_over_time}
\end{figure}
\subsection{Summary}
The visualizations indicate that the concentrations of pollutants exhibit significant variability, influenced by environmental conditions and sources of emissions. PM10 concentrations showed a wider range of distribution compared to PAHs, while temporal trends suggest a potential seasonal effect.
\subsection{Statistical Analysis}
Provide detailed results of the statistical tests conducted.
\section{Discussion}
Discuss the significance of the results in the context of the objectives and previous research. Highlight the implications, limitations, and potential future work.
\section{Conclusion}
Summarize the key findings and their relevance. Provide a concluding statement.
\section*{Acknowledgements}
Acknowledge funding sources, collaborators, and other contributions.
\section*{References}
\bibliographystyle{plain}
\bibliography{references} % Bibliografia powinna być w pliku references.bib
% Przykład wpisu w references.bib:
% @article{example,
% author = {Author Name},
% title = {Title of the Paper},
% journal = {Journal Name},
% year = {2023},
% volume = {10},
% number = {2},
% pages = {123--134},
% doi = {10.1234/example}
% }
\newpage
\printbibliography
\end{document}

62
doc/references.bib Normal file
View File

@ -0,0 +1,62 @@
@article{yang2002sources,
title={Sources and sinks of polycyclic aromatic hydrocarbons in the atmosphere},
author={Yang, HH and Lee, WJ},
journal={Atmospheric Environment},
volume={36},
number={6},
pages={1041--1054},
year={2002},
publisher={Elsevier}
}
@article{li2006urban,
title={Urban and regional distribution of polycyclic aromatic hydrocarbons in road dust in Beijing, China},
author={Li, Yi and Ma, Wei-Lian and others},
journal={Environmental Monitoring and Assessment},
volume={119},
number={1},
pages={71--81},
year={2006},
publisher={Springer}
}
@article{haritash2009polycyclic,
title={Polycyclic aromatic hydrocarbons as hazardous pollutants in the environment: A review},
author={Haritash, AK and Kaushik, CP},
journal={Journal of Hazardous Materials},
volume={169},
number={1},
pages={1--15},
year={2009},
publisher={Elsevier}
}
@book{iarc2010iarc,
title={IARC Monographs on the Evaluation of Carcinogenic Risks to Humans: Volume 92},
author={IARC Working Group},
year={2010},
publisher={International Agency for Research on Cancer}
}
@article{kim2013polycyclic,
title={Polycyclic aromatic hydrocarbons in the air and their health effects},
author={Kim, Ki-Hyun and Jahan, Shamin Ara and others},
journal={Journal of Environmental Science and Health, Part C},
volume={31},
number={1},
pages={1--26},
year={2013},
publisher={Taylor \& Francis}
}
@article{chen2007polycyclic,
title={Polycyclic aromatic hydrocarbons in the atmosphere of Beijing},
author={Chen, Y and Feng, Y},
journal={Science of the Total Environment},
volume={382},
number={1},
pages={122--127},
year={2007},
publisher={Elsevier}
}

60
py/1.py Normal file
View File

@ -0,0 +1,60 @@
import requests
import pandas as pd
import os
# Funkcja do pobierania danych z API GIOŚ i eksportu do CSV
def fetch_gios_data_to_csv(start_date, end_date, pollutants, output_file):
"""
Pobiera dane z API GIOŚ i zapisuje je do pliku CSV.
:param start_date: Data początkowa w formacie 'YYYY-MM-DD'.
:param end_date: Data końcowa w formacie 'YYYY-MM-DD'.
:param pollutants: Lista identyfikatorów zanieczyszczeń (np. ["PM10", "WWA"]).
:param output_file: Nazwa pliku wynikowego CSV.
"""
base_url = "https://powietrze.gios.gov.pl/pjp-api/rest/data/getData"
# Lista przykładowych ID stacji w Polsce (dostępne w API GIOŚ)
station_ids = [101, 102, 103, 104] # Zastąp ID rzeczywistymi z API
all_data = []
for station_id in station_ids:
for pollutant in pollutants:
try:
print(f"Pobieranie danych dla stacji {station_id} i zanieczyszczenia {pollutant}...")
url = f"{base_url}/{station_id}/{pollutant}/{start_date}/{end_date}"
response = requests.get(url)
response.raise_for_status() # Wyjątek, jeśli status != 200
data = response.json()
if "values" in data:
for measurement in data["values"]:
if measurement["value"] is not None:
all_data.append({
"station_id": station_id,
"pollutant": pollutant,
"date": measurement["date"],
"value": measurement["value"]
})
except Exception as e:
print(f"Błąd podczas pobierania danych dla stacji {station_id}: {e}")
# Eksport danych do CSV
if all_data:
df = pd.DataFrame(all_data)
df.to_csv(output_file, index=False)
print(f"Dane zapisane w pliku: {output_file}")
else:
print("Brak danych do zapisania.")
# Parametry wejściowe
start_date = "2023-01-01" # Początek okresu pomiarów
end_date = "2023-12-31" # Koniec okresu pomiarów
pollutants = ["PM10", "WWA"] # Lista zanieczyszczeń
output_file = "gios_data.csv" # Plik wynikowy
# Wywołanie funkcji
fetch_gios_data_to_csv(start_date, end_date, pollutants, output_file)

61
py/2.py Normal file
View File

@ -0,0 +1,61 @@
import matplotlib.pyplot as plt
import pandas as pd
import os
# Generowanie przykładowych danych
def generate_sample_data(num_records=100):
import random
from datetime import datetime, timedelta
station_ids = [101, 102, 103, 104]
pollutants = ["PM10", "WWA"]
start_date = datetime(2023, 1, 1)
end_date = datetime(2023, 12, 31)
data = []
for _ in range(num_records):
record = {
"station_id": random.choice(station_ids),
"pollutant": random.choice(pollutants),
"date": (start_date + timedelta(days=random.randint(0, (end_date - start_date).days))).strftime("%Y-%m-%d"),
"value": round(random.uniform(5, 50), 2), # Example values
}
data.append(record)
return pd.DataFrame(data)
# Generowanie danych
data = generate_sample_data(100)
# Tworzenie katalogu na wykresy
output_dir = "figs"
os.makedirs(output_dir, exist_ok=True)
# Generowanie wykresów
# Histogramy stężeń dla każdego zanieczyszczenia
pollutants = data["pollutant"].unique()
for pollutant in pollutants:
subset = data[data["pollutant"] == pollutant]
plt.figure(figsize=(8, 6))
plt.hist(subset["value"], bins=10, edgecolor="black", alpha=0.7)
plt.title(f"Histogram of {pollutant} concentrations")
plt.xlabel("Concentration")
plt.ylabel("Frequency")
plt.grid(True)
plt.savefig(os.path.join(output_dir, f"histogram_{pollutant}.png"))
plt.close()
# Średnie stężenia w czasie
data["date"] = pd.to_datetime(data["date"])
mean_over_time = data.groupby(["date", "pollutant"])["value"].mean().unstack()
mean_over_time.plot(figsize=(10, 6), marker="o")
plt.title("Mean Concentrations Over Time")
plt.xlabel("Date")
plt.ylabel("Mean Concentration")
plt.legend(title="Pollutant")
plt.grid(True)
plt.savefig(os.path.join(output_dir, "mean_concentration_over_time.png"))
plt.close()
print(f"Figures have been saved to the '{output_dir}' directory.")

602
py/data.json Normal file
View File

@ -0,0 +1,602 @@
[
{
"station_id":104,
"pollutant":"PM10",
"date":"2023-08-01",
"value":37.98
},
{
"station_id":103,
"pollutant":"WWA",
"date":"2023-07-28",
"value":24.79
},
{
"station_id":101,
"pollutant":"PM10",
"date":"2023-12-31",
"value":11.59
},
{
"station_id":104,
"pollutant":"WWA",
"date":"2023-09-19",
"value":24.94
},
{
"station_id":101,
"pollutant":"WWA",
"date":"2023-12-15",
"value":9.52
},
{
"station_id":102,
"pollutant":"WWA",
"date":"2023-03-31",
"value":7.35
},
{
"station_id":102,
"pollutant":"WWA",
"date":"2023-06-18",
"value":8.4
},
{
"station_id":103,
"pollutant":"WWA",
"date":"2023-08-16",
"value":46.38
},
{
"station_id":104,
"pollutant":"WWA",
"date":"2023-09-29",
"value":48.91
},
{
"station_id":103,
"pollutant":"PM10",
"date":"2023-07-23",
"value":25.16
},
{
"station_id":103,
"pollutant":"PM10",
"date":"2023-01-23",
"value":12.46
},
{
"station_id":104,
"pollutant":"PM10",
"date":"2023-10-30",
"value":16.99
},
{
"station_id":102,
"pollutant":"WWA",
"date":"2023-03-02",
"value":31.16
},
{
"station_id":101,
"pollutant":"WWA",
"date":"2023-01-17",
"value":14.19
},
{
"station_id":104,
"pollutant":"PM10",
"date":"2023-09-05",
"value":39.94
},
{
"station_id":101,
"pollutant":"PM10",
"date":"2023-08-23",
"value":38.16
},
{
"station_id":101,
"pollutant":"PM10",
"date":"2023-03-05",
"value":31.86
},
{
"station_id":102,
"pollutant":"WWA",
"date":"2023-03-15",
"value":21.08
},
{
"station_id":101,
"pollutant":"PM10",
"date":"2023-06-11",
"value":22.06
},
{
"station_id":103,
"pollutant":"WWA",
"date":"2023-03-15",
"value":12.6
},
{
"station_id":101,
"pollutant":"WWA",
"date":"2023-04-13",
"value":42.63
},
{
"station_id":103,
"pollutant":"PM10",
"date":"2023-12-10",
"value":46.07
},
{
"station_id":103,
"pollutant":"WWA",
"date":"2023-08-16",
"value":27.47
},
{
"station_id":104,
"pollutant":"WWA",
"date":"2023-10-14",
"value":42.49
},
{
"station_id":103,
"pollutant":"PM10",
"date":"2023-07-06",
"value":19.19
},
{
"station_id":103,
"pollutant":"WWA",
"date":"2023-02-09",
"value":28.55
},
{
"station_id":103,
"pollutant":"PM10",
"date":"2023-09-19",
"value":16.71
},
{
"station_id":104,
"pollutant":"PM10",
"date":"2023-11-03",
"value":23.58
},
{
"station_id":102,
"pollutant":"WWA",
"date":"2023-09-19",
"value":9.55
},
{
"station_id":101,
"pollutant":"PM10",
"date":"2023-05-26",
"value":30.42
},
{
"station_id":104,
"pollutant":"WWA",
"date":"2023-05-05",
"value":13.31
},
{
"station_id":102,
"pollutant":"PM10",
"date":"2023-04-30",
"value":41.78
},
{
"station_id":101,
"pollutant":"PM10",
"date":"2023-10-02",
"value":39.01
},
{
"station_id":102,
"pollutant":"PM10",
"date":"2023-09-05",
"value":44.01
},
{
"station_id":103,
"pollutant":"WWA",
"date":"2023-06-05",
"value":8.26
},
{
"station_id":102,
"pollutant":"WWA",
"date":"2023-03-24",
"value":43.9
},
{
"station_id":104,
"pollutant":"PM10",
"date":"2023-10-19",
"value":25.79
},
{
"station_id":102,
"pollutant":"PM10",
"date":"2023-12-12",
"value":39.76
},
{
"station_id":103,
"pollutant":"WWA",
"date":"2023-05-20",
"value":32.9
},
{
"station_id":101,
"pollutant":"WWA",
"date":"2023-01-25",
"value":40.94
},
{
"station_id":102,
"pollutant":"WWA",
"date":"2023-01-19",
"value":39.31
},
{
"station_id":102,
"pollutant":"PM10",
"date":"2023-05-16",
"value":43.35
},
{
"station_id":103,
"pollutant":"PM10",
"date":"2023-04-14",
"value":48.3
},
{
"station_id":101,
"pollutant":"WWA",
"date":"2023-06-16",
"value":6.25
},
{
"station_id":103,
"pollutant":"PM10",
"date":"2023-10-24",
"value":31.14
},
{
"station_id":102,
"pollutant":"PM10",
"date":"2023-03-14",
"value":8.61
},
{
"station_id":103,
"pollutant":"WWA",
"date":"2023-08-20",
"value":15.89
},
{
"station_id":104,
"pollutant":"PM10",
"date":"2023-09-02",
"value":39.41
},
{
"station_id":101,
"pollutant":"WWA",
"date":"2023-09-24",
"value":35.85
},
{
"station_id":103,
"pollutant":"PM10",
"date":"2023-06-04",
"value":16.66
},
{
"station_id":103,
"pollutant":"PM10",
"date":"2023-06-24",
"value":7.35
},
{
"station_id":104,
"pollutant":"PM10",
"date":"2023-01-07",
"value":29.16
},
{
"station_id":102,
"pollutant":"WWA",
"date":"2023-06-14",
"value":10.08
},
{
"station_id":102,
"pollutant":"WWA",
"date":"2023-09-18",
"value":6.05
},
{
"station_id":102,
"pollutant":"WWA",
"date":"2023-10-24",
"value":7.62
},
{
"station_id":104,
"pollutant":"PM10",
"date":"2023-01-27",
"value":23.68
},
{
"station_id":102,
"pollutant":"WWA",
"date":"2023-07-02",
"value":39.77
},
{
"station_id":101,
"pollutant":"WWA",
"date":"2023-03-04",
"value":31.0
},
{
"station_id":102,
"pollutant":"WWA",
"date":"2023-12-24",
"value":11.64
},
{
"station_id":101,
"pollutant":"WWA",
"date":"2023-08-24",
"value":10.53
},
{
"station_id":102,
"pollutant":"PM10",
"date":"2023-06-11",
"value":6.89
},
{
"station_id":104,
"pollutant":"WWA",
"date":"2023-05-19",
"value":29.56
},
{
"station_id":103,
"pollutant":"WWA",
"date":"2023-10-01",
"value":40.83
},
{
"station_id":102,
"pollutant":"WWA",
"date":"2023-08-15",
"value":25.87
},
{
"station_id":104,
"pollutant":"PM10",
"date":"2023-08-13",
"value":31.1
},
{
"station_id":104,
"pollutant":"PM10",
"date":"2023-08-22",
"value":6.2
},
{
"station_id":103,
"pollutant":"PM10",
"date":"2023-11-21",
"value":35.54
},
{
"station_id":101,
"pollutant":"PM10",
"date":"2023-05-10",
"value":8.35
},
{
"station_id":103,
"pollutant":"WWA",
"date":"2023-03-31",
"value":41.39
},
{
"station_id":104,
"pollutant":"WWA",
"date":"2023-06-04",
"value":21.61
},
{
"station_id":102,
"pollutant":"PM10",
"date":"2023-04-13",
"value":15.15
},
{
"station_id":103,
"pollutant":"WWA",
"date":"2023-10-10",
"value":36.26
},
{
"station_id":101,
"pollutant":"PM10",
"date":"2023-05-22",
"value":18.37
},
{
"station_id":103,
"pollutant":"PM10",
"date":"2023-08-21",
"value":49.18
},
{
"station_id":101,
"pollutant":"WWA",
"date":"2023-08-16",
"value":15.16
},
{
"station_id":104,
"pollutant":"PM10",
"date":"2023-10-23",
"value":12.41
},
{
"station_id":102,
"pollutant":"WWA",
"date":"2023-02-21",
"value":15.15
},
{
"station_id":101,
"pollutant":"WWA",
"date":"2023-11-28",
"value":18.57
},
{
"station_id":101,
"pollutant":"WWA",
"date":"2023-04-18",
"value":20.85
},
{
"station_id":101,
"pollutant":"PM10",
"date":"2023-05-01",
"value":43.77
},
{
"station_id":104,
"pollutant":"WWA",
"date":"2023-12-12",
"value":49.04
},
{
"station_id":101,
"pollutant":"PM10",
"date":"2023-06-23",
"value":5.99
},
{
"station_id":104,
"pollutant":"PM10",
"date":"2023-12-02",
"value":39.08
},
{
"station_id":102,
"pollutant":"PM10",
"date":"2023-07-06",
"value":35.11
},
{
"station_id":103,
"pollutant":"PM10",
"date":"2023-08-05",
"value":46.3
},
{
"station_id":101,
"pollutant":"PM10",
"date":"2023-08-05",
"value":19.38
},
{
"station_id":104,
"pollutant":"PM10",
"date":"2023-11-16",
"value":26.38
},
{
"station_id":101,
"pollutant":"PM10",
"date":"2023-07-22",
"value":40.9
},
{
"station_id":104,
"pollutant":"WWA",
"date":"2023-01-24",
"value":41.85
},
{
"station_id":104,
"pollutant":"PM10",
"date":"2023-04-25",
"value":25.12
},
{
"station_id":103,
"pollutant":"WWA",
"date":"2023-05-26",
"value":38.08
},
{
"station_id":104,
"pollutant":"WWA",
"date":"2023-05-15",
"value":13.9
},
{
"station_id":104,
"pollutant":"WWA",
"date":"2023-12-25",
"value":40.94
},
{
"station_id":102,
"pollutant":"PM10",
"date":"2023-06-18",
"value":20.26
},
{
"station_id":101,
"pollutant":"WWA",
"date":"2023-07-07",
"value":47.54
},
{
"station_id":101,
"pollutant":"WWA",
"date":"2023-08-15",
"value":29.09
},
{
"station_id":102,
"pollutant":"PM10",
"date":"2023-11-19",
"value":41.97
},
{
"station_id":104,
"pollutant":"PM10",
"date":"2023-12-06",
"value":39.83
},
{
"station_id":102,
"pollutant":"WWA",
"date":"2023-05-27",
"value":18.83
},
{
"station_id":101,
"pollutant":"PM10",
"date":"2023-01-10",
"value":33.45
}
]

BIN
py/figs/histogram_PM10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
py/figs/histogram_WWA.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB