Skip to content

Commit

Permalink
Merge pull request #15 from ssc-ai/r0.19.1
Browse files Browse the repository at this point in the history
v0.19.1
  • Loading branch information
mixxen authored Oct 16, 2024
2 parents e0c18ba + 1948e52 commit 28b9809
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 21 deletions.
6 changes: 6 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
History
=======

0.19.1
---------------------

* Add `TRKMODE` to fits header.


0.19.0
---------------------

Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ install: clean ## install the package to the active python3's site-packages
@echo IMPORTANT: You may need to close and restart your shell after running "make install".

docker: docs dist
docker build -t satsim:0.19.0 -t satsim:latest -f docker/ubuntu20.04_cuda11.2_py3.8.dockerfile .
docker build -t satsim:0.19.1 -t satsim:latest -f docker/ubuntu20.04_cuda11.2_py3.8.dockerfile .

dind:
docker run --rm -it -v .:/workspace/ -w /workspace python:3.8-bullseye ./build.sh
docker build -t satsim:0.19.0-cuda11.2 -f docker/ubuntu20.04_cuda11.2_py3.8.dockerfile .
docker build -t satsim:0.19.0-cuda11.8 -t satsim:0.19.0 -t satsim:latest -f docker/ubuntu22.04_cuda11.8_py3.10.dockerfile .
docker build -t satsim:0.19.1-cuda11.2 -f docker/ubuntu20.04_cuda11.2_py3.8.dockerfile .
docker build -t satsim:0.19.1-cuda11.8 -t satsim:0.19.1 -t satsim:latest -f docker/ubuntu22.04_cuda11.8_py3.10.dockerfile .

uninstall: clean
cat .install.log | xargs rm -rf
6 changes: 3 additions & 3 deletions docker/ubuntu20.04_cuda11.2_py3.8.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ RUN pip3 --no-cache-dir install --upgrade pip setuptools
RUN pip3 --no-cache-dir install tensorflow~=2.11.0

# copy wheel file
ENV SATSIM_VERSION='0.19.0'
COPY dist/satsim-0.19.0-py2.py3-none-any.whl /tmp
ENV SATSIM_VERSION='0.19.1'
COPY dist/satsim-0.19.1-py2.py3-none-any.whl /tmp

# install satsim wheel file together with jupyterlab so dependency compatibility are resolved
RUN pip3 --no-cache-dir install \
tmp/satsim-0.19.0-py2.py3-none-any.whl \
tmp/satsim-0.19.1-py2.py3-none-any.whl \
jupyterlab \
scikit-learn \
virtualenv
Expand Down
6 changes: 3 additions & 3 deletions docker/ubuntu22.04_cuda11.8_py3.10.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ RUN pip3 --no-cache-dir install --upgrade pip setuptools
RUN pip3 --no-cache-dir install tensorflow~=2.13.0

# copy wheel file
ENV SATSIM_VERSION='0.19.0'
COPY dist/satsim-0.19.0-py2.py3-none-any.whl /tmp
ENV SATSIM_VERSION='0.19.1'
COPY dist/satsim-0.19.1-py2.py3-none-any.whl /tmp

# install satsim wheel file together with jupyterlab so dependency compatibility are resolved
RUN pip3 --no-cache-dir install \
tmp/satsim-0.19.0-py2.py3-none-any.whl \
tmp/satsim-0.19.1-py2.py3-none-any.whl \
jupyterlab \
scikit-learn \
virtualenv
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@
# the built documents.
#
# The short X.Y version.
version = '0.19.0'
version = '0.19.1'
# The full version, including alpha/beta/rc tags.
release = '0.19.0'
release = '0.19.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion satsim/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

__author__ = """Alex Cabello"""
__email__ = '[email protected]'
__version__ = '0.19.0'
__version__ = '0.19.1'

from .satsim import gen_images, gen_multi, image_generator
from .config import load_json, load_yaml
2 changes: 1 addition & 1 deletion satsim/generator/obs/breakup.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def collision_from_tle(tle, collision_time, radius=37.5, K=0.5,
Example usage in SatSim configuration::
"obs": {
"generator": {
"$generator": {
"module": "satsim.generator.obs.breakup",
"function": "collision_from_tle",
"kwargs": {
Expand Down
2 changes: 1 addition & 1 deletion satsim/generator/obs/cso.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def one(origin=[0.5, 0.5], velocity=[0.0, 0.0], mv=[15.0, 16.0], separation=0.01
"length":
{ "sample": "random.randint", "low": 0, "high": 15 },
"list": {
"generator": {
"$generator": {
"module": "satsim.generator.obs.cso",
"function": "one",
"kwargs": {
Expand Down
2 changes: 1 addition & 1 deletion satsim/generator/obs/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def sphere(n=10, origin=[0.5,0.5], velocity=[0.01, 5.0], mv=[10.0, 16.0], t=0.0)
Example usage in SatSim configuration::
"obs": {
"generator": {
"$generator": {
"module": "satsim.generator.obs.geometry",
"function": "sphere",
"kwargs": {
Expand Down
2 changes: 1 addition & 1 deletion satsim/generator/obs/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def tle_file(filename, lines=3, mv=[10.0, 16.0]):
Example usage in SatSim configuration::
"obs": {
"generator": {
"$generator": {
"module": "satsim.generator.obs.io",
"function": "tle_file",
"kwargs": {
Expand Down
2 changes: 1 addition & 1 deletion satsim/generator/obs/rpo.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def rpo_from_tle(tle, epoch, delta_distance=5, delta_position_direction='random'
Example usage in SatSim configuration::
"obs": {
"generator": {
"$generator": {
"module": "satsim.generator.obs.rpo",
"function": "rpo_from_tle",
"kwargs": {
Expand Down
1 change: 1 addition & 0 deletions satsim/io/fits.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def get_or_default(key, default=''):
hdr['CROTA1'] = 0.0
hdr['CROTA2'] = 0.0
hdr['EQUINOX'] = 2000.0
hdr["TRKMODE"] = get_or_default('track_mode')

if dtype == 'uint16':
hdu.scale('int16', bzero=32768)
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.19.0
current_version = 0.19.1
commit = True
tag = True

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@
test_suite='tests',
tests_require=test_requirements,
url='https://github.com/ssc-ai/satsim',
version='0.19.0',
version='0.19.1',
zip_safe=False,
)
17 changes: 15 additions & 2 deletions tests/test_satsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import numpy as np
import scipy
from tifffile import imread
from astropy.io import fits as afits


from satsim import config, gen_images
Expand Down Expand Up @@ -298,21 +299,33 @@ def test_poppy():

configure_eager()

queue = MultithreadedTaskQueue()

ssp = config.load_json('./tests/config_poppy.json')
ssp, d = config.transform(ssp, max_stages=10, with_debug=True)

ssp['fpa']['num_frames'] = 1
ssp['fpa']['time']['exposure'] = 1

gen_images(ssp, eager=True, output_dir='./.images', output_debug=True)
dir_name = gen_images(ssp, eager=True, output_dir='./.images', output_debug=True, queue=queue)
queue.waitUntilEmpty()
hdul = afits.open(os.path.join(dir_name, 'ImageFiles', 'sat_00000.0000.fits'))
hdulhdr = hdul[0].header
assert(hdulhdr['EXPTIME'] == ssp['fpa']['time']['exposure'])
assert(hdulhdr['TRKMODE'] == ssp['geometry']['site']['track']['mode'])

ssp['sim']['enable_shot_noise'] = False
ssp['sim']['save_pickle'] = False
ssp['geometry']['site']['track']['mode'] = 'sidereal'
ssp['geometry']['site']['track']['tle'] = [ssp['geometry']['site']['track']['tle1'], ssp['geometry']['site']['track']['tle2']]
del(ssp['geometry']['site']['track']['tle1'])
del(ssp['geometry']['site']['track']['tle2'])
gen_images(ssp, eager=True, output_dir='./.images', output_debug=True)
dir_name = gen_images(ssp, eager=True, output_dir='./.images', output_debug=True, queue=queue)
queue.waitUntilEmpty()
hdul = afits.open(os.path.join(dir_name, 'ImageFiles', 'sat_00000.0000.fits'))
hdulhdr = hdul[0].header
assert(hdulhdr['EXPTIME'] == ssp['fpa']['time']['exposure'])
assert(hdulhdr['TRKMODE'] == ssp['geometry']['site']['track']['mode'])

ssp['geometry']['site']['track']['mode'] = 'rate'
ssp['geometry']['site']['track']['position'] = [-35180.62550265, -23252.99066344, 92.95410805]
Expand Down

0 comments on commit 28b9809

Please sign in to comment.