ItsLive.jl

Documentation for ItsLive.jl

ItsLive.catalogFunction
catalog([catalog_geojson::String])

return a DataFrame (catalogdf) of the catalog for all of the ITSLIVE zarr datacubes. User can optionally provide the path to `cataloggeojson`

using ArchGDAL, DataFrames

Example no inputs

julia> catalog()
julia> catalog(catalog_geojson = "path/to/catalog.json")

Arguments

  • catalog_geojson::String: path to geojson catalog of ITS_LIVE datacubes

Author

Alex S. Gardner, JPL, Caltech.

source
ItsLive.getvarFunction
C = getvar(lat,lon, varnames, catalogdf])

return a named m x n matrix of vectors (C) with m = length(lat) rows and n = length(varnames)+2(for lat and lon) columns for the points nearest the lat/lon location from ITS_LIVE Zarr datacubes

use catalog.jl to generate the DataFrame catalog (catalogdf) of the ITS_LIVE zarr datacubes

using DataFrames Dates NamedArrays

Example

julia> getvar(69.1,-49.4, ["mid_date", "v"], catalogdf)

Arguments

  • lat::Union{Vector,Number}: latitude between -90 and 90 degrees
  • lon::Union{Vector,Number}: latitude between -180 and 180 degrees
  • varnames::Unions{String, Vector{String}}: name of variables to extract from Zarr DataFrame
  • catalogdf::DataFrame: DataFrame catalog of the ITS_LIVE zarr datacubes

Author

Alex S. Gardner, JPL, Caltech.

source
ItsLive.plotvarFunction
p = plotvar(C::Named Matrix{Any}, varname::String)

plot its_live data (`C`) variable (`varname`) for multiple points

Example no inputs

julia> p = plotvar(C, varname)

Arguments

  • C::Named Matrix{Any}: ITS_LIVE named matrix
  • varname::String: variable name to plot

Keyword Arguments

- `dtmax::Number`: maximum time seperation between image pairs [days] to plot

Author

Alex S. Gardner, JPL, Caltech.

source
ItsLive.plotbysensorFunction
p = plotbysensor(C, varname; dtmax::Number = Inf))

plot its_live data (`C`) variable (`varname`) by sensor type

Example no inputs

julia> p = plotbysensor(x,y,sensor)

Arguments

  • C::Named Matrix{Any}: ITS_LIVE named matrix [size(C,2) must = 1]
  • varname::String: variable name to plot

Keyword Arguments

- `dtmax::Number`: maximum time seperation between image pairs [days] to plot

Author

Alex S. Gardner, JPL, Caltech.

source
ItsLive.sensorfilterFunction
id_exclude = sensorfilter(vx, vy, mid_date, dt, sensor; binedges, mincount, dtmax, id_refsensor, plotflag)

identify sensors that produce velocities that are sginificanlty slower

Example no inputs

julia> id_exclude = sensorfilter(C[1,"vx"], C[1,"vy"], C[1,"mid_date"], C[1,"date_dt"], C[1,"satellite_img1"])

Arguments

- `vx::Vector{Any}`: x component velocity
- `vy::Vector{Any}`: y component velocity
- `mid_date::Vector{DateTime}`: center date of image-pair [] 
- `dt::Vector{Any}`: time seperation between image pairs [days]
- `sensor::Vector{Any}`: list of image sensors for image-pairs... used to group results

- `id_exclude`: sesnor ids that should be excluded [none should be excluded if empty]

Author

Alex S. Gardner, JPL, Caltech.

source
ItsLive.vxvyfilterFunction
outlier, dtmax, sensorgroups = vxvyfilter(vx,vy,dt; sensor)

identify 'outlier's for which the vx or vy distibution changes for longer dt. 'dtmax' identified for each 'sensorgroups'

This filter is needed to identify longer dts that exhibit "skipping" or "locking" behavior in feature tracking estimates of surface flow. This happens when the surface texture provides a lesser match than to stationary features, due to long time separation between repeat images, such as ice falls and curved medial moraines.

using Statistics

Example

julia> outlier, dtmax, sensorgroups = vxvyfilter(vx,vy,dt,sensor)

Arguments

  • vx::Vector{Any}: x component velocity
  • vy::Vector{Any}: y component velocity
  • dt::Vector{Any}: time seperation between image pairs [days]
  • sensor::Vector{Any}: list of image sensors for image-pairs... used to group results

Author

Alex S. Gardner, JPL, Caltech.

source
ItsLive.lsqfit_annualFunction
t_fit, v_fit, amp_fit, phase_fit, v_fit_err, amp_fit_err, fit_count, image_pair_count, outlier =
    lsqfit_annual(v,v_err,mid_date,date_dt; mad_thresh[optional], iterations[optional], model[optional])

annual error wighted model fit to discrete interval data

using Statistics

Example

julia> t_fit, v_fit, amp_fit, phase_fit, v_fit_err, amp_fit_err, fit_count, image_pair_count, outlier = 
    lsqfit_annual(v, v_err, mid_date, date_dt; mad_thresh, iterations, model)

Arguments

  • v::Vector{Any}: image-pair (discrete interval) velocity

  • v_err::Vector{Any}: image-pair (discrete interval) velocity error

  • mid_date::Vector{DateTime}: center date of image-pair []

  • date_dt::Vector{Any}: time seperation between image pairs [days]

  • mad_thresh::Number: optional key word argument for MAD treshold for outlier rejection

  • iterations::Number: optional key word argument for number of iterations for lsqfit_annual outlier rejection

  • model::String: optional key word argument giving name of lsq model. Valid options are "sinusoidal_interannual", "sinusoidal", "interannual".

  • t_fit: DateTime center of annual fit

  • v_fit: annual values determined from lsq fit

  • amp_fit: seasonal amplitude

  • phase_fit: seasonal amplitude [DateTime of maximum flow]

  • v_fit_err: error of v_fit

  • amp_fit_err: error of amp_fit

  • fit_count: data count for each year, after any outlier rejection

  • image_pair_count: total number of image pairs included in lsq fit

  • outlier: BitVector of length of v indicating identified outliers

Author

Alex S. Gardner and Chad A. Greene, JPL, Caltech.

source
ItsLive.lsqfit_interpFunction

vi, vierr = lsqfitinterp(tfit, vfit, ampfit, phasefit, vfiterr, ampfiterr, t_i)

create a continuous time series of velocity from the outputs of ItsLive.lsqfit.

Example

julia> v_i, v_i_err = lsqfit_interp(t_fit, v_fit, amp_fit, phase_fit, v_fit_err, amp_fit_err, t_i)

Arguments

  • t_fit:::Vector{DateTime}: date of v_fit
  • v_fit::Vector{Any}: mean annual v
  • amp_fit::Vector{Any}: amplitude of seasonal cycle
  • phase_fit::Vector{Any}: phase of seasonal cycle
  • v_fit_err::Vector{Any}: error in mean annual v
  • amp_fit_err::Vector{Any}: error in amplitude of seasonal cycle
  • t_i:::Vector{DateTime}: dates to interpolate to

Author

Alex S. Gardner and Chad A. Greene, JPL, Caltech.

source
ItsLive.binstatsFunction
yb, ybstd, countb, bincenters = binstats(x, y; binedges = [0.0], dx = 0, method = "mean")

return the central value (`yb`) and spread (`ybstd`) in `x` according to `method` ["mean" = default]
argument on values binned by `y`.

Example no inputs

julia> yb, ybstd, countb, bincenters = binstats(x, y; dx = 1)

Arguments

  • x::Vector{Float64}: x data [typically DateTime]
  • y::Vector{Float64}: data to be binned
  • dt::Number: width of x bins [dt or binedges must be provided]
  • binedges::Vector{Float64}: x bin edges [dt or binedges must be provided]
  • method::String: method for deter
  • skipspread::Bool: flag for skipping spread calculations

Author

Alex S. Gardner, JPL, Caltech.

source
ItsLive.decimalyearFunction
decyear = decimalyear(datetime)

return the decimal year (decyear) of a DateTime type vector

Example

    julia> decyear = ItsLive.decimalyear(Dates.DateTime(1970,1,1))
    1970.0

Arguments

  • datetime::Union{DateTime, Vector{DateTime}}: date and time of type DateTime

Author

Alex S. Gardner, JPL, Caltech.

source
ItsLive.intersectFunction
rownumber = intersect(lat,lon, catalogdf])

return the rownumber of the the DataFrame catalog (catalogdf) of the ITS_LIVE zarr datacubes that intersects the provided latitude and longituded [decimal degrees].

use catalog.jl to generate the DataFrame catalog of the ITS_LIVE zarr datacubes

using ArchGDAL, DataFrames

Example

julia> intersect(69.1,-49.4, catalogdf)

Arguments

  • lat::Number: latitude between -90 and 90 degrees
  • lon::Number: latitude between -180 and 180 degrees
  • catalogdf::DataFrame: DataFrame catalog of the ITS_LIVE zarr datacubes

Author

Alex S. Gardner, JPL, Caltech.

source
ItsLive.nearestxyFunction

xind, yind = nearestxy(lat,lon,dc)

return the xind/yind indices into a ZarrGroup (dc) for the points nearest the provided lat, lon locations

using Proj

Example

julia> nearestxy(lat,lon,dc)

Arguments

  • lat::::Union{Vector,Number}: latitude between -90 and 90 degrees
  • lon::::Union{Vector,Number}: latitude between -180 and 180 degrees
  • dc:::ZGroup{Zarr.ConsolidatedStore{Zarr.HTTPStore}}: ITS_LIVE data cube:: Zarr DataArray

Author

Alex S. Gardner, JPL, Caltech.

source
ItsLive.dtfilterFunction
dtmax = dtfilter(x,dt,binedges)

return the maximum dt (dtmax) for which the distribution of x shows no statistical difference from the distribution of x in the minimum dt bin

This filter is needed to identify longer dts that exhibit "skipping" or "locking" behavior in feature tracking estimates of surface flow. This happens when the surface texture provides a lesser match than to stationary features, due to long time separation between repeat images, such as ice falls and curved medial moraines.

using Statistics

Example

julia> dtfilter(vx,dt,binedge)

Arguments

  • x::Vector{Any}: value to be filtered as a function of dt (typically velocity)
  • dt::Vector{Any}: time seperation between image pairs [days]
  • binedges::Vector{Float64}: optional edges of dt bins into which vx and vy will be grouped and compared
  • dtbin_mad_thresh::Number: used to determine in dt means are significantly different

Author

Alex S. Gardner, JPL, Caltech.

source
ItsLive.design_matrixFunction
D, tD, M = design_matrix(t1,t2, model [optional])

create a design matrix (D) for discrete interval data

Example

julia> D, tD, M = design_matrix(t1,t2, model [optional])

Arguments

  • t1::Vector{DateTime}: start DateTime of descrete interval

  • t2::Vector{DateTime}: end DateTime of descrete interval

  • model::String = "sinusoidal_interannual":

  • D: Design matrix

  • tD: DateTime centers used in D

  • M = Annual weighting matrix`:

Author

Alex S. Gardner and Chad A. Greene, JPL, Caltech.

source
ItsLive.annual_matrixFunction
annual_matrix(t1,t2)

create an annual weighting matrix for discrete intervals

Example

julia> M, tM = annual_matrix(t1,t2)

Arguments

  • t1::Vector{DateTime}: start DateTime of descrete interval
  • t2::Vector{DateTime}: end DateTime of descrete interval

Author

Alex S. Gardner and Chad A. Greene, JPL, Caltech.

source
ItsLive.wlinearfitFunction
offset, slope, error = wliearfit(t, v, v_err, datetime0)

return the offset, slope, and error for a weighted linear fit to v with an intercept of datetime0

Example no inputs

julia> offset, slope, error = wliearfit(t, v, v_err, datetime0)

Arguments

  • t::Vector{DateTime}: date of input estimates
  • v::Vector{Float64}: estimates
  • v_err::Vector{Float64}: estimate errors
  • datetime0::DateTime): model intercept

Author

Alex S. Gardner, JPL, Caltech.

source
ItsLive.annual_magnitudeFunction
v_fit, v_fit_err, v_fit_count, v_fit_outlier_frac  = annual_magnitude(vx_fit, vy_fit, vx_fit_err, vy_fit_err, vx_fit_count, vy_fit_count, vx_fit_outlier_frac, vy_fit_outlier_frac)

return the annual mean, error, count, and outlier fraction from component values projected on the unit flow vector defined by vx0 and vy0

Example no inputs

julia>  annual_magnitude(vx_fit, vy_fit, vx_fit_err, vy_fit_err, vx_fit_count, vx_fit_count, vx_fit_outlier_frac, vy_fit_outlier_frac)

Arguments

- `vx_fit::Vector`: annual mean flow in x direction
- `vy_fit::Vector`: annual mean flow in y direction
- `vx_fit_err::Vector`: error in annual mean flow in x direction
- `vy_fit_err::Vector`: error in annual mean flow in y direction
- `vx_fit_count::Vector`: number of values used to determine annual mean flow in x direction
- `vy_fit_count::Vector`: number of values used to determine annual mean flow in y direction
- `vx_fit_outlier_frac::Vector`: fraction of data identified as outliers and removed when calculating annual mean flow in x direction
- `vy_fit_outlier_frac::Vector`: fraction of data identified as outliers and removed when calculating annual mean flow in y direction

Author

Alex S. Gardner and Chad A. Greene, JPL, Caltech.

source
ItsLive.climatology_magnitudeFunction
climatology_magnitude(vx0, vy0, vx0_err, vy0_err, dvx_dt, dvy_dt, vx_amp, vy_amp, vx_amp_err, vy_amp_err, vx_phase, vy_phase)

return the mean, trend, seasonal amplitude, error in seasonal amplitude, and seasonal phase from component values projected on the unit flow vector defined by vx0 and vy0

Example no inputs

julia> v, v_err, dv_dt, v_amp, v_amp_err, v_phase = climatology_magnitude(vx0, vy0, vx0_err, vy0_err, dvx_dt, dvy_dt, vx_amp, vy_amp, vx_amp_err, vy_amp_err, vx_phase, vy_phase)

Arguments

  • vx0::Number: mean flow in x direction
  • vy0::Number: mean flow in y direction
  • vx0_err::Number: error in mean flow in x direction
  • vy0_err::Number: error in mean flow in y direction
  • dvx_dt::Number: trend in flow in x direction
  • dvy_dt::Number: trend in flow in y direction
  • vx_amp::Number: seasonal amplitude in x direction
  • vy_amp::Number: seasonal amplitude in y direction
  • vx_amp_err::Number: error in seasonal amplitude in x direction
  • vy_amp_err::Number: error in seasonal amplitude in y direction
  • vx_phase::Number: seasonal phase in x direction [day of maximum flow]
  • vy_phase::Number: seasonal phase in y direction [day of maximum flow]

Author

Alex S. Gardner, JPL, Caltech.

source
ItsLive.sensorgroupFunction
id, sensorgroups= sensorgroup(sensor)

return the sensor group id and the corresponding sensorgroups

using Statistics

Example

julia> id, sensorgroups = sensorgroup(sensor)

Arguments

  • sensor::Vector{Any}: sensor list

Author

Alex S. Gardner, JPL, Caltech.

source