Rafnuss / GeoPressureR

Global positioning by atmospheric pressure
https://raphaelnussbaumer.com/GeoPressureR
GNU General Public License v3.0
7 stars 1 forks source link

Renaming function and variables #55

Closed Rafnuss closed 1 year ago

Rafnuss commented 1 year ago

See https://github.com/Rafnuss/GeoPressureR/wiki/Migration-v2-%E2%80%90--v3 πŸŽ‰ Indicates import new exiting feature to check out! ⚠️ Might be confusing at first coming from the v2. ❌ Removed

GeoPressureR object

Old New Comment
pam tag ⚠️ Generic term see this
sta stap Better suited for STAtionary Period.
grl graph More explicit name.
map ⚠️ New likelihood map are stored inside tag. marginal is the only map not stored in tag
path New created by graph_simulation(), graph_most_likely() or tag2path(). Data.frame
pressurepath New Data.frame
param ⚠️ New named list stored inside tag and graph keeping track of all parameters used in all functions. Do not edit manually, but useful to export at the end as json file.

Functions

Tag

Old New Comment
pam_read tag_create
pam_read_check ❌
pam_read_delim_dto tag_create_dto Not exported
tag_label πŸŽ‰ New This new single function group all the tag_label_* functions for a more efficient workflow
pam_classify tag_label_auto
trainset_read tag_label_read ⚠️ Note the new trainset_read is not the same as the previous (see Utility section)
trainset_write tag_label_write ⚠️ Note the new trainset_read is not the same as the previous
pam_sta tag_label_stap
tag_set_map πŸŽ‰ New Define parameters for the map and stap
tag_update πŸŽ‰ New Update a tag with a new label file. Allows to recompute pressure maps only for stap that have change.
tag_assert New Check status of a tag object. Not exported
print.tag New
plot.tag New
plot_tag_pressure New
plot_tag_light New
plot_tag_twilight New
plot_tag_acceleration New
geopressure_map2path tag2path
tag2map New return a GeoPressureR map from a tag

GeoPressure

Old New Comment
geopressure_map πŸŽ‰ Run both geopressure_mismatch and geopressure_likelihood together to make the workflow more efficient. Also doesn't store mse and mask by default to save space.
geopressure_map geopressure_map_mismatch make more explicit and consider mismatch to incorporate both mse and mask
geopressure_prob_map geopressure_map_likelihood replace probability by likelihood
geopressure_map_preprocess New Convert the pressure timeseries into an optimal pressure for geopressureapi
geopressure_ts geopressure_timseries ⚠️ Make name more explicit despite long.

GeoLight

Old New Comment
find_twilights twilight_create
twilight_label_write New
twilight_label_read New
geolight_map πŸŽ‰ New function that create the light likelihood map in tag, similar to geopressure_map.
solar geolight_solar
zenith geolight_zenith
refracted geolight_refracted
ligh2mat New Convert a timeserie of light into a matrix of day of year, time of day

Graph

Old New Comment
graph_create
graph_trim graph_create_prune Not exported
graph_download_wind tag_download_wind ⚠️ Use tag object and not graph
graph_add_wind
graph_set_movement πŸŽ‰ New Defining all parameters for the movement model without actually computin anything.
graph_transition New Allow to compute the transition matrix on the fly, thus saving memory
flight_bird create_bird
print.bird New Check a bird object
flight_power speed2power Not exported
flight_prob speed2prob More descriptive of what the function does
graph_marginal
graph_simulation
graph_most_likely πŸŽ‰ New more efficient implementation than using the igraph package.
graph_assert New Check status of a graph object
print.graph New

Map

Old New Comment
map_create πŸŽ‰ New GeoPreussreR map are now S3 objects
print.map New
plot.map New
rast.map New convert a map to a terra::rast
map_expend New map are defined by only extend and scale, this function allows to compute lat, lon and dim

Path

Old New Comment
path2df ind2path
graph_path2edge path2edge
plot.path New

Pressurepath

Old New Comment
geopressure_ts_path pressurepath_create ⚠️ Focus on the main outcome (pressurepath)
pressurepath_update πŸŽ‰ New Update a pressurepath with a new label file. similar to tag_update.
plot.pressurepath New
pressurepath2altitude New

Param

Old New Comment
param_create New
print.param New

Flight

❌ Avoid flight which can be computed "on the fly" from stap using stap2flight()

Utility

Old New Comment
trainset_read New more generic function taking any df as input as to work with tag_label and twilight_label. Not exported
trainset_write New more generic function taking any df as input as to work with tag_label and twilight_label. Not exported
stap2flight New
stap2duration New
graph_path2lonlat ❌
geopressureviz

Variables

Tag

Old New Comment
pam tag
id
min_duration
pathname directory see this
file basename would be better but less user friendly see this
pressure_file
light_file
acceleration_file
path sensor_path dirname+basename
crop_start
crop_end
skip
col
date_format

Set map

Old New Comment
extent
scale
known New data.frame defining the knwon position (e.g., equipement and retrieval). Use to avoid computing the likelihood map for nothing and calibration of light
include_stap_id New
include_min_duration New

GeoPressure

Old New Comment
pressure
max_sample
margin
timeout
workers
presssure_maps ❌ ⚠️ Remove and integreated within geostap
s sd Match classic R base function name for standard deviation.
thr thr_mask Make more explicit
fun_w log_linear_pooling_weight Aligned with geolight aggregation
keep_mse_mask
lon
lat
start_time
end_time
verbose quiet
path
include_flight

Geolight

Old New Comment
light
threshold twl_thr
shift_k twl_offset Align with TwGeos but adds twl in front
twl twilight ⚠️ more explicit
adjust_calib twl_calib_adjust
w_llp twl_llp ⚠️ Not to confuse with llp in geopressure
zenith
sun
tm date Align with the format

Graph

Old New Comment
grl graph
static_prob ❌ ⚠️ Remove and integreated within tag_set_map
field Define which field in geostap should be use as likelihood
thr_prob_percentile thr_likelihood
thr_gs
thr_as
area extent
cds_key
cds_user
type
nj

Field of graph

Old New Comment
s
t
as ❌ avoid storing unnecessary (computable from gs and ws)
gs
ws
ps obs Stored as 3D matrix rather than edge level for memory efficiency.
p transition ⚠️ Now optional. When possible, use movement which can compute trans on the flight with graph_trans and save memory
movement Parameter to be used in graph_trans
Parameter to be used in graph_trans
sz
equipment
retrieval
flight_duration ❌ Computable with stap2flight
lat ❌ Computable with extent_scale2grid
lon ❌ Computable with extent_scale2grid
extent
resolution ❌
temporal_extent ❌
stap
scale
mask_water

Utility

Old New Comment
species_name
mass
wing_span
wing_aspect
wing_area
body_frontal_area
bird not super specific
speed slightly different than as,gs, ws
method
shape
scale ⚠️ Not to confuse with scale in geostap
location
fun_power power2prob
low_speed_fix
Rafnuss commented 1 year ago

Brainstorm

pam

sta

Need to think of the elevation/alitutde/local period.

GeoLight

Utilisation: solar, refracted, find_twilights, light2mat

geopressure_*

geopressure_map()

geopressure_prob_map()

geopressure_ts_*()

prob

graph

Rafnuss commented 1 year ago

Script to get all arguements

tmp <- do.call(rbind, lapply(ls("package:GeoPressureR"), function(fn_name){
  fn <- tryCatch(get(fn_name, mode = "function", envir = asNamespace('GeoPressureR')), error = function(e) NULL)
  tmp <- data.frame(
    arg = names(formals(fn))
  )
  tmp$fun <- fn_name
  return(tmp)
}))
write.csv(tmp, file = "~/Downloads/arg.csv")