Support for Tensorflow Hub modules in GalSim
Project description
GalSim Hub
GalSim Hub provides a collection of TensorFlow modules for GalSim.
TL;DR
GalSim Hub makes it easy to incorporate galaxy light profiles modelled by deep neural networks directly with a GalSim script:
import galsim
import galsim_hub
from astropy.table import Table
# Load a generative model from the online repository
model = galsim_hub.GenerativeGalaxyModel('hub:Lanusse2020')
# Defines the input conditions, for this model flux_radius, mag_auto, and redshift
catalog = Table([[5., 10. ,20.], [24., 24., 24.], [0.5, 0.5, 0.5] ],
names=['flux_radius', 'mag_auto', 'zphot'])
# Sample light profiles for these parameters
profiles = model.sample(catalog)
...
You can read more, and try out a live demo here:
Installation
To install:
$ pip install --user galsim-hub
Note: GalSim-Hub currently assumes TensorFlow 1.15 to be installed, and will not try to install it as a dependency.
Usage
This module can be used directly under the GalSim Yaml driver:
$ galsim examples/demo14.yaml
or from Python:
import galsim
import galsim_hub
from astropy.table import Table
# Load a generative model from the online repository
model = galsim_hub.GenerativeGalaxyModel('hub:Lanusse2020')
# Defines the input conditions, for this model flux_radius, mag_auto, and redshift
catalog = Table([[5., 10. ,20.], [24., 24., 24.], [0.5, 0.5, 0.5] ],
names=['flux_radius', 'mag_auto', 'zphot'])
# Sample light profiles for these parameters
profiles = model.sample(catalog)
...
Adding a model to the repository
This repository is intended to host a collection of deep generative models, any new contributions are welcome. Submitting your model to the Hub means that it becomes trivially accessible to any GalSim user, increasing the chances that it will be used in practice :-)
To submit a model, please open a Pull Request adding a new folder under the hub
directory. As the procedure is not currently completely documented, do not hesitate to reach out to the maintainers of the repository for guidance.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file galsim_hub-0.0.1rc4.tar.gz
.
File metadata
- Download URL: galsim_hub-0.0.1rc4.tar.gz
- Upload date:
- Size: 154.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45bcd5dbd987f2dfa9a0512a1c5f6c84ff42b7823a6b778b494ce984c13b0940 |
|
MD5 | c6f998394a76cc31e3935f7ce12e0ad2 |
|
BLAKE2b-256 | 55ef63d7fa1199b1d04889b5776951e393d29a8e991e58a0e73003d15cb99111 |