Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

basic set of functions for ETN data access #9

Closed
stijnvanhoey opened this issue Jan 26, 2018 · 5 comments
Closed

basic set of functions for ETN data access #9

stijnvanhoey opened this issue Jan 26, 2018 · 5 comments

Comments

@stijnvanhoey
Copy link
Contributor

@jreubens @PieterjanVerhelst as we discussed:

As a replacement of the current getLWData function, we aim to go to a minimal set of functions for the data access. Each of these functions target a specific set of data-tables, comparable to the online ETN data portal.

Apart from a make_connection function, the first set of functions that we will focus on are. For each function, we define the required filters as function inputs that will be embedded to query the existing views:

get_projects()

get_deployments(
    netwerk-project,
    active)               # open deployments, default ALL  

get_animals(
    netwerk-project,   # i.e. projectlist
    animal_project,   # i.e. tagprojectlist
    species)

get_tags(
    animal_project)   # i.e. tagprojectlist

get_receivers
    netwerk-project)    # i.e. projectlist

get_detections(
    animal_project,
    netwerk-project,
    start_date,
    end_date,
    station,
    get_tags,
    ...?)

By default, we return all the available columns in the database views/tables; but maybe this will be too much. @jreubens you could maybe define a subset of columns for each output that are really out of scope for any of the ETN users?

@jreubens
Copy link
Collaborator

@stijnvanhoey
below you can find an overview of all the header I would keep included. It is still quite a lot, thus if this is still too much, let me know and I'll see whether I can do a further reduction...
From projects, detections and tags I kept all the headers.
From the other ones I removed some redundant ones

vliz.detections_view

colnames(tabel)
"receiver" "transmitter" "transmitter_name"
"transmitter_serial" "sensor_value" "sensor_unit"
"sensor2_value" "sensor2_unit" "station_name"
"datetime" "id_pk" "qc_flag"
"file" "latitude" "longitude"
"deployment_fk" "scientific_name" "location_name"
"deployment_station_name" "deploy_date_time" "animal_project_name"
"animal_project_code" "animal_moratorium" "network_project_name"
"network_project_code" "network_moratorium" "signal_to_noise_ratio"
"detection_file_id" "tag_sensor_type" "tag_intercept"
"tag_slope" "sensor_value_depth_meters"

vliz.tags

colnames(tabel)
"serial_number" "type" "model" "id_code" "tag_code_space"
"owner_pi" "owner_organization" "id_pk" "activation_date" "min_delay"
"max_delay" "power" "end_date" "file" "estimated_lifetime"
"sensor_type" "frequency" "acoustic_tag_type" "min_delay_step2" "max_delay_step2"
"power_step2" "min_delay_step3" "max_delay_step3" "power_step3" "duration_step1"
"duration_step2" "duration_step3" "manufacturer_fk" "intercept" "slope"
"owner_group_fk"

animals_view

colnames(tabel)
"projectname" "projectmember"
"tag_code_space" "person_id"
animal_id" "scientific_name"
"common_name" "length"
"length_type" "length_units"
"length2" "length2_type"
"length2_units" "weight_units"
"age" "age_units"
"sex" "life_stage"
"capture_location" "capture_depth"
"utc_release_date_time" "comments"
"est_tag_life" "wild_or_hatchery"
"stock" "dna_sample_taken"
"treatment_type" "dissolved_oxygen"
"date_of_surgery"
"id_pk" "catched_date_time"
"capture_latitude" "capture_longitude"
"release_latitude" "release_longitude"
"recapture_date" "implant_type"
"implant_method" "date_modified"
"date_created" "release_location"
"length3" "length3_type"
"length3_units" "length4"
"length4_type" "length4_units"
"weight" "end_date_tag"
"capture_method" "project_fk"
"animal_tag_release_id_pk"

vliz.deployments_view

colnames(tabel)
"receiver" "receiver_status" "projectname"
"projectcode" "projectmember" "drop_dead_date"
"download_date_time" "deploy_date_time" "recover_date_time"
"bottom_depth" "sync_date_time" "data_downloaded"
"time_drift" "comments" "id_pk"
"receiver_fk" "location_name" "location_manager"
"location_description" "deploy_lat" "deploy_long"
"recover_lat" "recover_long" "station_name"
"intended_lat" "intended_long" "date_created"
"date_modified" "battery_install_date" "ar_battery_install_date"
"distance_to_mouth" "source" "transmit_profile"
"transmit_power_output" "log_temperature_stats_period" "log_temperature_sample_period"
"log_tilt_sample_period" "log_noise_stats_period" "log_noise_sample_period"
"log_depth_stats_period" "log_depth_sample_period" "project_fk"
"mooring_type"

vliz.receivers

colnames(tabel)
"serial_number" "model_number"
"expected_battery_life" "id_pk"
"receiver" "owner_organization" "built_in_tag_fk"
"status" "receiver_type" "manufacturer_fk"
"owner_group_fk"

@PieterjanVerhelst
Copy link
Collaborator

@jreubens I think some fields in animals are redundant. Although everything can have its purpose for someone in the future, I think the listed column names below will only rarely be used. If one column appears to be more important than previously thought, it can be added to the function at a later stage.

"wild_or_hatchery"
"stock" "dna_sample_taken"
"treatment_type" "dissolved_oxygen"
"date_of_surgery"
"id_pk"
"implant_type"
"implant_method" "date_modified"
"date_created"
"capture_method"
"animal_tag_release_id_pk"

@jreubens
Copy link
Collaborator

some can indeed be removed I guess
but I want to keep the following...
"wild_or_hatchery"
"stock"
"dna_sample_taken"
"date_of_surgery"
"implant_type"
"implant_method"
"capture_method"

for some projects this might be important in the near future...

@stijnvanhoey
Copy link
Contributor Author

For the moment, I propose to keep the full table views as output to the user without any filtering. We can show in a vignette/tutorial how to quickly select columns as a user, based on the given result. OK?

@stijnvanhoey
Copy link
Contributor Author

Closing this issue here, as the basic functions are currently available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants