Skip to main content

Python based database for CARMA EDGE

Project description

edge_pydb

Python-based database for CARMA EDGE. This package requires Python 3.

The EDGE database has several components (see index_csv.md and index_hdf.txt for details):

  • Zero-dimensional CSV tables (one value per galaxy), found in dat_glob.

  • One-dimensional CSV tables (e.g. radial profiles or spectra), found in dat_prof and dat_spec.

  • Downsampled 2D or 3D images, saved as HDF5 binary tables in the img_ directories.

Installation

Install the package directly from PyPI (https://pypi.org/project/edge-pydb/) using

pip install --user edge_pydb

or, if you prefer to keep the latest source code handy, by cloning this Github repository and running

pip install --user .

in the directory containing setup.py.

The --user flag ensures the package is not installed in your system-wide Python directories, which you probably don't have write access to. The package tries to save and update a configuration file _config.json, so installation in your user area is recommended.

If you have access to the protected archive (not on Github), you should also obtain the team_files.py script from Tony which will download and install the additional tables into the appropriate locations. You can run this script in a shell or iPython environment (but should avoid doing so in the same directory as setup.py). Currently the Github repository only includes HDF5 files for one galaxy, for demonstration and testing purposes.

A demo_notebk folder provides examples of accessing database values from a Jupyter notebook.

Basic Usage

from edge_pydb import EdgeTable

EdgeTable('list')

  • makes a listing of the available files

ctrpos = EdgeTable('edge_coflux_smo7.csv')

  • loads a CSV file. ctrpos can now be treated like an astropy table.

ctrpos = EdgeTable('edge_coflux_smo7.csv', cols=['Name', 'coRactr_smo7', 'coDectr_smo7'])

  • loads the three specified columns only from the CSV file

leda = EdgeTable('edge_leda.csv', cols=['Name', 'ledaD25', 'ledaPA', 'ledaIncl'])
ctrpos.join(leda)

  • will merge a sub-table from edge_leda.csv into ctrpos. We must select the Name column for the join to work.

comom = EdgeTable('NGC4047.comom_smo7.hdf5', path='smo')

  • loads an HDF5 file. The path must be given, otherwise a listing of available paths is provided.

Team Usage

For additional database files not in this Github repository, it’s better to keep these in a separate, more visible directory in your file system, and not inside your Python libraries (site-packages area). Here is the suggested way to do this:

  • Leave the git directory in which this README is located. Open an iPython shell and type:

import edge_pydb.util as edgeutil

edgeutil.listfiles(values=True)

  • should show only the public data. Now suppose the additional data files are in a folder called pybase.

edgeutil.add_from_dir('/path/to/pybase/', copy=False)

  • will add these to your environment. This only needs to be done once after package installation.

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

edge_pydb-1.2.0.tar.gz (9.5 MB view details)

Uploaded Source

Built Distribution

edge_pydb-1.2.0-py3-none-any.whl (5.4 MB view details)

Uploaded Python 3

File details

Details for the file edge_pydb-1.2.0.tar.gz.

File metadata

  • Download URL: edge_pydb-1.2.0.tar.gz
  • Upload date:
  • Size: 9.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.10

File hashes

Hashes for edge_pydb-1.2.0.tar.gz
Algorithm Hash digest
SHA256 7f97e8e9eb26d22dcfa8039352fed9b3dae2d868a88946fe25903c9b4f9cb165
MD5 6e40d7fccd93ca72d090cfbd89e70609
BLAKE2b-256 3d1455e5622603b6a1ca988ad96cb6f4c63c57a8f95af352f9371096d4183ab6

See more details on using hashes here.

File details

Details for the file edge_pydb-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: edge_pydb-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.10

File hashes

Hashes for edge_pydb-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4c71157a16e3441ac9f32d4b1971718a905baa7beef26c2e6ccf7c02fe74b0ad
MD5 bcb8702b11d2d84f2df75baf774afe3b
BLAKE2b-256 4dbc5543ffd35d7ffdb24013a80d55ac643c3a065ea7d5fa0c135ed09a5ba774

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page