EarthSciData.DataFrequencyInfo
EarthSciData.DataSetInterpolator
EarthSciData.FileSet
EarthSciData.GEOSFPFileSet
EarthSciData.MetaData
EarthSciData.NEI2016MonthlyEmisFileSet
EarthSciData.NetCDFOutputter
EarthSciData.UpdateCallbackCreator
EarthSciData.GEOSFP
EarthSciData.NEI2016MonthlyEmis
EarthSciData.affect!
EarthSciData.async_loader
EarthSciData.centerpoint_index
EarthSciData.create_interp_equation
EarthSciData.create_interpolator!
EarthSciData.currenttimepoint
EarthSciData.description
EarthSciData.dimnames
EarthSciData.endpoints
EarthSciData.getnc
EarthSciData.interp!
EarthSciData.interp!
EarthSciData.interp_cache_times!
EarthSciData.interp_unsafe
EarthSciData.knots2range
EarthSciData.loadmetadata
EarthSciData.loadmetadata
EarthSciData.loadslice!
EarthSciData.loadslice!
EarthSciData.localpath
EarthSciData.maybedownload
EarthSciData.nexttimepoint
EarthSciData.partialderivatives_δPδlev_geosfp
EarthSciData.prevtimepoint
EarthSciData.relpath
EarthSciData.relpath
EarthSciData.to_unit
EarthSciData.units
EarthSciData.url
EarthSciData.varnames
EarthSciData.varnames
EarthSciMLBase.init_callback
EarthSciMLBase.init_callback
ModelingToolkit.get_unit
EarthSciData.DataFrequencyInfo
— TypeInformation about the temporal frequency of archived data.
start
: Beginning of time of the time series.frequency
: Interval between each record.centerpoints
: Time representing the temporal center of each record.
EarthSciData.DataSetInterpolator
— TypeDataSetInterpolators are used to interpolate data from a FileSet
to represent a given time and location. Data is loaded (and downloaded) lazily, so the first time you use it on a for a given dataset and time period it may take a while to load. Each time step is downloaded and loaded as it is needed during the simulation and cached on the hard drive at the path specified by the \$EARTHSCIDATADIR
environment variable, or in a scratch directory if that environment variable has not been specified. The interpolator will also cache data in memory representing the data records for the times immediately before and after the current time step.
varname
is the name of the variable to interpolate. default_time
is the time to use when initializing the interpolator. spatial_ref
is the spatial reference system that the simulation will be using. cache_size
is the number of time steps that should be held in the cache at any given time (default=3; must be >=3).
WARNING: This interpolator includes a hack so that the function deepcopy
does not copy the interpolator, it just returns the interpolator. This is necessary to allow us to update the interpolator from a callback, but it may cause unintended side effects.
EarthSciData.FileSet
— TypeAn interface for types describing a dataset, potentially comprised of multiple files.
To satisfy this interface, a type must implement the following methods:
relpath(fs::FileSet, t::DateTime)
url(fs::FileSet, t::DateTime)
localpath(fs::FileSet, t::DateTime)
DataFrequencyInfo(fs::FileSet, t::DateTime)::DataFrequencyInfo
loadmetadata(fs::FileSet, t::DateTime, varname)::MetaData
loadslice!(cache::AbstractArray, fs::FileSet, t::DateTime, varname)
varnames(fs::FileSet, t::DateTime)
EarthSciData.GEOSFPFileSet
— TypeGEOS-FP data as archived for use with GEOS-Chem classic.
Domain options (as of 2022-01-30):
- 4x5
- 0.125x0.15625_AS
- 0.125x0.15625_EU
- 0.125x0.15625_NA
- 0.25x0.3125
- 0.25x0.3125_AF
- 0.25x0.3125_AS
- 0.25x0.3125_CH
- 0.25x0.3125_EU
- 0.25x0.3125_ME
- 0.25x0.3125_NA
- 0.25x0.3125_OC
- 0.25x0.3125_RU
- 0.25x0.3125_SA
- 0.5x0.625
- 0.5x0.625_AS
- 0.5x0.625_CH
- 0.5x0.625_EU
- 0.5x0.625_NA
- 2x2.5
- 4x5
- C180
- C720
- NATIVE
- c720
Possible filetype
s are:
:A1
:A3cld
:A3dyn
:A3mstC
:A3mstE
:I3
See http://geoschemdata.wustl.edu/ExtData/ for current options.
EarthSciData.MetaData
— TypeInformation about a data array.
coords
: The locations associated with each data point in the array.units
: Physical units of the data, e.g. m s⁻¹.description
: Description of the data.dimnames
: Dimensions of the data, e.g. (lat, lon, layer).varsize
: Dimension sizes of the data, e.g. (180, 360, 30).native_sr
: The spatial reference system of the data, e.g. "+proj=longlat +datum=WGS84 +no_defs" for lat-lon data.xdim
: The index number of the x-dimension (e.g. longitude)ydim
: The index number of the y-dimension (e.g. latitude)
EarthSciData.NEI2016MonthlyEmisFileSet
— TypeArchived CMAQ emissions data.
Currently, only data for year 2016 is available.
EarthSciData.NetCDFOutputter
— TypeCreate an EarthSciMLBase.Operator
to write simulation output to a NetCDF file.
filepath::String
: The path of the NetCDF file to write tofile::Any
: The netcdf datasetvars::Any
: The netcdf variables corresponding to the state variablestvar::Any
: The netcdf variable for timeh::Int64
: Current time index for writingtime_interval::AbstractFloat
: Simulation time interval (in seconds) at which to write to diskextra_vars::AbstractVector
: Extra observed variables to write to diskextra_var_fs::AbstractVector
: Functions to get the extra varsgrid::Any
: Spatial grid specificationdtype::Any
: Data type of the output
EarthSciData.UpdateCallbackCreator
— TypeThis struct holds information that can be used to create a callback function that updates the states of the interpolators.
EarthSciData.GEOSFP
— MethodGEOSFP(
domain;
coord_defaults,
spatial_ref,
dtype,
name,
kwargs...
)
A data loader for GEOS-FP data as archived for use with GEOS-Chem classic.
Domain options (as of 2022-01-30):
- 4x5
- 0.125x0.15625_AS
- 0.125x0.15625_EU
- 0.125x0.15625_NA
- 0.25x0.3125
- 0.25x0.3125_AF
- 0.25x0.3125_AS
- 0.25x0.3125_CH
- 0.25x0.3125_EU
- 0.25x0.3125_ME
- 0.25x0.3125_NA
- 0.25x0.3125_OC
- 0.25x0.3125_RU
- 0.25x0.3125_SA
- 0.5x0.625
- 0.5x0.625_AS
- 0.5x0.625_CH
- 0.5x0.625_EU
- 0.5x0.625_NA
- 2x2.5
- 4x5
- C180
- C720
- NATIVE
- c720
coord_defaults
can be used to provide default values for the coordinates of the domain. For example if we want to perform a 2D simulation with a vertical dimension, we can set coord_defaults = Dict(:lev => 1)
.
dtype
represents the desired data type of the interpolated values. The native data type for this dataset is Float32.
See http://geoschemdata.wustl.edu/ExtData/ for current options.
EarthSciData.NEI2016MonthlyEmis
— MethodNEI2016MonthlyEmis(
sector,
x,
y,
lev;
spatial_ref,
dtype,
scale,
name,
kwargs...
)
A data loader for CMAQ-formatted monthly US National Emissions Inventory data for year 2016, available from: https://gaftp.epa.gov/Air/emismod/2016/v1/gridded/monthly_netCDF/. The emissions here are monthly averages, so there is no information about diurnal variation etc.
spatial_ref
should be the spatial reference system that the simulation will be using. x
and y
, and should be the coordinate variables and grid spacing values for the simulation that is going to be run, corresponding to the given x and y values of the given spatial_ref
, and the lev
represents the variable for the vertical grid level. x and y must be in the same units as spatial_ref
.
dtype
represents the desired data type of the interpolated values. The native data type for this dataset is Float32.
scale
is a scaling factor to apply to the emissions data. The default value is 1.0.
NOTE: This is an interpolator that returns an emissions value by interpolating between the centers of the nearest grid cells in the underlying emissions grid, so it may not exactly conserve the total emissions mass, especially if the simulation grid is coarser than the emissions grid.
EarthSciData.affect!
— MethodWrite the current state of the Simulator
to the NetCDF file.
EarthSciData.async_loader
— MethodAsynchronously load data, anticipating which time will be requested next.
EarthSciData.centerpoint_index
— MethodReturn the index of the centerpoint closest to the given time.
EarthSciData.create_interp_equation
— Methodcreate_interp_equation(
itp,
filename,
t,
sample_time,
coords;
wrapper_f
)
Create an equation that interpolates the given dataset at the given time and location. filename
is an identifier for the dataset, and t
is the time variable. wrapper_f
can specify a function to wrap the interpolated value, for example eq -> eq / 2
to divide the interpolated value by 2.
EarthSciData.create_interpolator!
— MethodCreate a new interpolator, overwriting interp_cache
.
EarthSciData.currenttimepoint
— MethodReturn the current interpolation time point for this interpolator.
EarthSciData.description
— Methoddescription(itp, t)
Return the description of the data associated with this interpolator.
EarthSciData.dimnames
— Methoddimnames(itp, t)
Return the dimension names associated with this interpolator.
EarthSciData.endpoints
— MethodReturn the time endpoints correcponding to each centerpoint
EarthSciData.getnc
— MethodGet the NCDataset for the given file path, caching the last 20 files.
EarthSciData.interp!
— Methodinterp!(itp, t, locs)
Return the value of the given variable from the given dataset at the given time and location.
EarthSciData.interp!
— MethodInterpolation with a unix timestamp.
EarthSciData.interp_cache_times!
— MethodLoad the time points that should be cached in this interpolator.
EarthSciData.interp_unsafe
— MethodInterpolate without checking if the data has been correctly loaded for the given time.
EarthSciData.knots2range
— FunctionConvert a vector of evenly spaced grid points to a range. The reltol
parameter specifies the relative tolerance for the grid spacing, which is necessary to account for different numbers of days in each month and things like that.
EarthSciData.loadmetadata
— Methodloadmetadata(fs, t, varname)
Load the data for the given variable name at the given time.
EarthSciData.loadmetadata
— Methodloadmetadata(fs, t, varname)
Load the data for the given variable name at the given time.
EarthSciData.loadslice!
— Methodloadslice!(data, fs, t, varname)
Load the data in place for the given variable name at the given time.
EarthSciData.loadslice!
— Methodloadslice!(data, fs, t, varname)
Load the data in place for the given variable name at the given time.
EarthSciData.localpath
— Methodlocalpath(fs, t)
Return the local path for the file for the given DateTime
.
EarthSciData.maybedownload
— Methodmaybedownload(fs, t)
Check if the specified file exists locally. If not, download it.
EarthSciData.nexttimepoint
— MethodReturn the next interpolation time point for this interpolator.
EarthSciData.partialderivatives_δPδlev_geosfp
— Methodpartialderivatives_δPδlev_geosfp(geosfp; default_lev)
Return a function to calculate coefficients to multiply the δ(u)/δ(lev)
partial derivative operator by to convert a variable named u
from δ(u)/δ(lev)to
δ(u)/δ(P), i.e. from vertical level number to pressure in hPa. The return format is
coordinateindex => conversionfactor`.
EarthSciData.prevtimepoint
— MethodReturn the previous interpolation time point for this interpolator.
EarthSciData.relpath
— Methodrelpath(fs, t)
File path on the server relative to the host root; also path on local disk relative to ENV["EARTHSCIDATADIR"]
(or a scratch directory if that environment variable is not set).
EarthSciData.relpath
— Methodrelpath(fs, t)
File path on the server relative to the host root; also path on local disk relative to ENV["EARTHSCIDATADIR"]
.
EarthSciData.to_unit
— MethodConvert a string to a DynamicQuantities.Quantity
object.
EarthSciData.units
— Methodunits(itp, t)
Return the units of the data associated with this interpolator.
EarthSciData.url
— Methodurl(fs, t)
Return the URL for the file for the given DateTime
.
EarthSciData.varnames
— Methodvarnames(fs, t)
Return the variable names associated with this FileSet.
EarthSciData.varnames
— Methodvarnames(fs, t)
Return the variable names associated with this FileSet.
EarthSciMLBase.init_callback
— MethodCreate a callback for this simulator. We only want to update the interpolators that are actually used in the system.
EarthSciMLBase.init_callback
— MethodSet up the output file and the callback function.
ModelingToolkit.get_unit
— MethodReturn the units of the data.