A small package for sending and receiving data to and from the CTAC VizLab.
Project description
vizlab-data-transfer
This package enables easy transferring of data to and from the VizLab!
How to set up
To use this package, we need a proper connection to Carnegie's local network. You can do this in a couple ways:
- By using a Carnegie-managed device connected to the CarnegieEmployees network
- By logging in with your Carnegie VPN
You'll need to set the VizLab local IP and appropriate port number - look to internal Carnegie resources for these:
from vizlab_data_transfer import vizlab
# set network state
vizlab.set_ip(IP)
vizlab.set_port(PORT)
# get network state
print(vizlab.get_ip())
print(vizlab.get_port())
These values are stored internally by the package and persist between sessions, so set them once and you're good to go!
How to use
This package is designed to be as straightforward as possible. To send Python data to the system, use the vizlab.send() method:
from vizlab_data_transfer import vizlab
vizlab.send(data) # give a single dataset
vizlab.send([table, fig1, fig2]) # or a list of them...
You can also use optional arguments to send additional details about your data:
from vizlab_data_transfer import vizlab
vizlab.send([positions, lum], object_name = "stellarstream-results", data_names = ["xyz_pos", "luminosity"]) # provide additional data details
vizlab.send(radii, object_name = "stellarstream-results", data_names = "disk_radii") # give the same object name to append data to an existing object in the system
Currently we support a variety of Python objects:
- numpy ndarrays and recarrays
- astropy FITS Table and ImageHDU objects
- matplotlib figures
- pandas dataframes
- Pillow images
Special notice must be taken for heteregeneous data sources (FITS tables, pandas dataframes, numpy recarrays) and specifying data names and units. You give a name for the table (the column names are already included in the data itself) and units for each column individually:
# recarray names/units example
vizlab.send(three_col_recarray, data_names=["table"], data_units = ["m", "s", "J"])
Feel free to leave an issue on this repository if there's a Python object you'd like support for!
Likewise, to receive data back from the system use vizlab.receive():
from vizlab_data_transfer import vizlab
# NOTE: VizLab must be in 'receive' state before this is run so server is ready to meet this request
data = vizlab.receive()
Currently only numeric data of type np.float32 can be returned.
Please consult the examples folder for more detailed use-cases!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vizlab_data_transfer-0.2.0.tar.gz.
File metadata
- Download URL: vizlab_data_transfer-0.2.0.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b98189f3c2eb39c77f7f975760c1bcdbce6c4b92f2113929ef5137edcca56b1
|
|
| MD5 |
4fea81e4b8ffc5f47fdbf1cc4b62fb7c
|
|
| BLAKE2b-256 |
4a2a34acf7d23f51c5878035d2cf68436e7d02ea99108bf6855014ce9cde8592
|
Provenance
The following attestation bundles were made for vizlab_data_transfer-0.2.0.tar.gz:
Publisher:
publish-package.yaml on carnegie/vizlab-data-transfer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vizlab_data_transfer-0.2.0.tar.gz -
Subject digest:
4b98189f3c2eb39c77f7f975760c1bcdbce6c4b92f2113929ef5137edcca56b1 - Sigstore transparency entry: 659751652
- Sigstore integration time:
-
Permalink:
carnegie/vizlab-data-transfer@2d97c03595f30fc7a747de7221bcc29ba91f21a6 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/carnegie
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-package.yaml@2d97c03595f30fc7a747de7221bcc29ba91f21a6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file vizlab_data_transfer-0.2.0-py3-none-any.whl.
File metadata
- Download URL: vizlab_data_transfer-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7cf9d0b8a2d49f17c030ef98a369a448c12ed8c046c75a115f354e72f2d2583
|
|
| MD5 |
d81b78a13146a9d2f8b0307e6d454b3a
|
|
| BLAKE2b-256 |
9f7348f87fc6033fb959fddd4ec0ea718e3a56f2bb9ea2176b60b12be41f431f
|
Provenance
The following attestation bundles were made for vizlab_data_transfer-0.2.0-py3-none-any.whl:
Publisher:
publish-package.yaml on carnegie/vizlab-data-transfer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vizlab_data_transfer-0.2.0-py3-none-any.whl -
Subject digest:
a7cf9d0b8a2d49f17c030ef98a369a448c12ed8c046c75a115f354e72f2d2583 - Sigstore transparency entry: 659751660
- Sigstore integration time:
-
Permalink:
carnegie/vizlab-data-transfer@2d97c03595f30fc7a747de7221bcc29ba91f21a6 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/carnegie
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-package.yaml@2d97c03595f30fc7a747de7221bcc29ba91f21a6 -
Trigger Event:
push
-
Statement type: