% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/get_nasapower.R
\name{get_nasapower}
\alias{get_nasapower}
\title{Fetch NASA POWER Data for Multiple Locations with a Progress Bar}
\usage{
get_nasapower(
  data,
  days_around,
  date_col,
  study_col = "study",
  pars = c("T2M", "RH2M", "PRECTOTCORR", "T2M_MAX", "T2M_MIN", "T2MDEW"),
  direction = "both"
)
}
\arguments{
\item{data}{A data frame containing the input data, including columns for latitude, longitude, and
the date column.}

\item{days_around}{An integer specifying the number of days before and after the date in the date column
to download data.}

\item{date_col}{A character string specifying the name of the date column in the data frame.}

\item{study_col}{A character string specifying the name of the column containing the study identifier
in the input data frame (default: "study").}

\item{pars}{A character vector specifying the weather variables to fetch from NASA POWER
(default: c("T2M", "RH2M", "PRECTOTCORR", "T2M_MAX", "T2M_MIN", "T2MDEW")).}

\item{direction}{Character string specifying the direction of the date range relative to the reference date.
Options are "both" (default), "back", or "forth".
"back" retrieves data from \code{date - days_around} to \code{date}.
"forth" retrieves data from \code{date} to \code{date + days_around}.
"both" retrieves data from \code{date - days_around} to \code{date + days_around}.}
}
\value{
A data frame with the downloaded weather data from NASA POWER, combined for all specified locations.
Includes a variable \code{study} indicating the study identifier from the input data.
Returns an empty data frame if no data is retrieved.
}
\description{
This function downloads daily NASA POWER data for specified weather variables over a specified number of days
around a given date column for multiple locations. It includes a progress bar to show the download progress.
}
\details{
The function uses the \code{get_power} function from the \code{nasapower} package to fetch weather data for a range of
dates around the specified date column for each location. A progress bar is shown during the data download
process, and the results are combined into a single data frame.
}
\seealso{
Other Disease modeling: 
\code{\link{get_brdwgd}()},
\code{\link{get_era5}()},
\code{\link{windowpane}()}
}
\concept{Disease modeling}
