Ecosynth 0.2.4 documentation

Share (Stage 4)

«  Post-Process and Analysis (Stage 3)   ::   Contents

Share (Stage 4)

The Share module contains tools for sharing data with others

Utilities

share.utilities.create_doi(username, password, shoulder, creator, publisher, site, acq_date, acq_time)

This function works with ezid.py to create a basic DOI for a SynthSet on EcosynthData

Parameters:shoulder (string) – (e.g. doi:10.5072/FK2)
share.utilities.verify_sftp(sftp_ip, sftp_user, sftp_pw)

Checks that credential successfully connect to FTP server and fetches new post ID based on current list of sub-directories

Parameters:
  • sftp_ip (string) –
  • sftp_user (string) –
  • sftp_pw (string) –
Returns:

synth_id (returns None if cannot connect)

Return type:

int

Example

Notes

share.utilities.generate_metadata_page(synth_id, ov_author, ov_organization, ov_doi, acq_site, acq_lat, acq_lon, acq_date, acq_time, gen_cv_type, gen_cv_version, notes, img_file, ply_file, out_file, ecobrowser_ply_file)

Creates a new metadata page based on inputs

Parameters:
  • ov_author (string) –
  • ov_organization (string) –
  • ov_doi (string) –
  • acq_site (string) –
  • acq_lat (string) –
  • acq_lon (string) –
  • acq_date (string) –
  • acq_time (string) –
  • gen_cv_type (string) –
  • gen_cv_version (string) –
  • notes (string) –
  • img_file (file) –
  • ply_file (file) –
  • out_file (file) –
  • ecobrowser_ply_file (file) –
Returns:

metadata_html

Return type:

string

Example

Notes

share.utilities.upload_data(sftp_ip, sftp_user, sftp_pw, synth_id, metadata_page, image_file, ply_file, out_file)

Connects be to sftp server, creates new dataset folder, and uploads new dataset.

Parameters:
  • sftp_ip (string) –
  • sftp_user (string) –
  • sftp_pw (string) –
  • synth_id (int) –
  • metadata_page (string) –
  • image_file (file) –
  • ply_file (file) –
  • out_file (file) –
Example

Notes

share.utilities.update_gmaps_json(sftp_ip, sftp_user, sftp_pw, synth_id, acq_lat, acq_lon, acq_site, ov_author)

Appends metadata to a file that is used for Google Maps on the front page of the website

Parameters:
  • sftp_ip (string) –
  • sftp_user (string) –
  • sftp_pw (string) –
  • synth_id (int) –
  • acq_lat (string) –
  • acq_lon (string) –
  • acq_site (string) –
  • ov_author (string) –
Example

Notes

«  Post-Process and Analysis (Stage 3)   ::   Contents