Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
f4da897
Correct variable name for propogation of component name when building…
ijiraq Apr 1, 2023
f626137
Merge branch 'OSSOS:master' into main
ijiraq Sep 3, 2023
6e20b75
Create docker-image.yml
ijiraq Sep 3, 2023
c24df53
Removed resonant parameters from default parametric models, relocated…
ijiraq Feb 11, 2024
b65a164
Merge branch 'main' of https://github.com/ijiraq/SurveySimulator
ijiraq Feb 11, 2024
0493944
Not ready for version astropy v6 yet
ijiraq Feb 11, 2024
79a7a7e
Update docker-image.yml
ijiraq Feb 11, 2024
1178713
Update docker-image.yml
ijiraq Feb 11, 2024
b9d8e7f
Put proper SFD into the model files
ijiraq Feb 12, 2024
ed4f509
ignore checkpoint files
ijiraq Feb 12, 2024
2862789
Put restrictions in correct quote marks for build
ijiraq Feb 12, 2024
50cc2a1
new version of python
ijiraq Feb 12, 2024
3bacdd2
correct filename
ijiraq Feb 12, 2024
014377d
correct filename
ijiraq Feb 12, 2024
65e28c8
Make characterization part of git repo
ijiraq Feb 13, 2024
b0418cc
Echo how to run docker command for testing
ijiraq Feb 13, 2024
39c57e2
Use new rebound save method
ijiraq Feb 13, 2024
80d6fd1
Add characterizations to python distribution of SSim
ijiraq Feb 14, 2024
7b8d68f
Add characterizations to python distribution of SSim
ijiraq Feb 14, 2024
9ca01a5
Correct to work with new REBOUND
ijiraq Feb 14, 2024
4785732
Use new verion of ssim for exampples
ijiraq Feb 14, 2024
b060498
Add characterizations to python distribution of SSim
ijiraq Feb 14, 2024
5164649
Correct the name of the Characterization
ijiraq Feb 21, 2024
efaa712
Correct the syntax of the docker run command for local execution test…
ijiraq Feb 21, 2024
ba1700f
Add matlab fonts to the container
ijiraq Feb 21, 2024
3e81570
Rework the code to allow the colors setting to be a multi-depth dicto…
ijiraq Apr 8, 2024
48fc989
Make this example work with the version of ossssim
ijiraq Apr 8, 2024
a4a61d7
Correct the in-equality used for counting the number of detections
ijiraq Apr 12, 2024
2594ebf
Improve use of rebound and expanded number of allowed surveys.
ijiraq May 2, 2024
f7af5f5
ignore rebound archive
ijiraq May 2, 2024
9a928ab
Make the implanted distribution parameters part of the call.
ijiraq May 31, 2024
43882e4
Add back a lost README file and the 'bootstrap' ad test
ijiraq Jun 17, 2024
62cf444
Add some details on survey simulator API
ijiraq Jun 17, 2024
13659e3
Allow long paths to survey characterization files
ijiraq Jun 17, 2024
a101a19
Add details on the values of 'flag' returned by detos
ijiraq Jun 17, 2024
97385b2
Add a continous differential distribution for hot/implaneted obejcts
ijiraq Jun 17, 2024
369f2f2
Don't add curl independently of the OS installation
ijiraq Jun 17, 2024
4aea4ce
clean up some formatting
ijiraq Aug 13, 2024
08d03a3
Update example to follow new OSSSSim constructor and improve some cod…
ijiraq Aug 13, 2024
3a82729
Update to latest version of astropy and numpy.
ijiraq Aug 13, 2024
b80db65
Improve how seed value is stored and managed
ijiraq Aug 13, 2024
06080f1
Add astroplan to the container.
ijiraq Aug 13, 2024
b9c1f6f
add a contrast parameter to enable a divot in the tapered exponential…
ijiraq Aug 13, 2024
4736e7d
have the seed set in the simulation object instead of passed with eac…
ijiraq Aug 13, 2024
c77ea9a
Use definition logic to set seed if None is passed
ijiraq Apr 12, 2025
7e3ac9e
Randomized Reading is depricated
ijiraq Apr 12, 2025
39c582b
Add a position to keplar converter
ijiraq Apr 12, 2025
ba97528
Use a builddir for fwarp step to allow different architectures
ijiraq Apr 15, 2025
253cbf1
Use a common data element to allow reset of the simulator withn a sin…
ijiraq Apr 15, 2025
6092eb7
Move to using toml files for build
ijiraq Apr 15, 2025
fe74686
Move to a new OS for deployment on CANFAR
ijiraq Apr 15, 2025
a0d7ca6
A pythonic reader for the .eff format
ijiraq Apr 15, 2025
c91ea65
Ignore some files created in building for CANFAR
ijiraq Apr 15, 2025
c3324e2
Make python3 compliant
ijiraq Nov 8, 2025
1b26795
Make color into a large array index by filter character and move to d…
ijiraq Nov 14, 2025
1f25cee
Do all tests
ijiraq Nov 14, 2025
4173496
make characterization a sub-module
ijiraq Nov 14, 2025
9cd8d10
A new version with color support in Fortran corrected
ijiraq Nov 14, 2025
5004cd9
ignore intermediate fortran files0
ijiraq Nov 14, 2025
55a9832
Cleanup some unused variables and ensure a proper type casting where …
ijiraq Nov 15, 2025
a4e9f2f
cleanup the Makefile a bit
ijiraq Nov 15, 2025
3825619
remove this as its now part of ReadModelFromFile
ijiraq Nov 15, 2025
60f937b
add some documentation on how to use spacecraft with SSim
ijiraq Nov 15, 2025
076f7e7
do all the tests
ijiraq Nov 15, 2025
624a6ae
move python src to be parellel to F95 content
ijiraq Nov 16, 2025
70d8e5c
Move parameters to their own module and put reset_simulation back in …
ijiraq Nov 17, 2025
5769b90
Put reset_simulation back here and add modules for debug, parameters …
ijiraq Nov 17, 2025
5ed7e0c
Move the color_array function to after the get/put subroutines for co…
ijiraq Nov 17, 2025
d3a455c
Put all modules into a archive file for passing to package building p…
ijiraq Nov 17, 2025
da1ed7c
Use a larger color vector to store possible filter color offsets
ijiraq Nov 17, 2025
6076974
Adopt new python structure where libraries are in their own package
ijiraq Nov 17, 2025
05ea72b
Reorganize file layout to be more 'pythonic'
ijiraq Nov 17, 2025
c56c2ae
ignore vscode files
ijiraq Nov 17, 2025
52fa099
Move the Fortran code to be seperate from the python
ijiraq Nov 17, 2025
2e26f78
flatten the directory structure
ijiraq Nov 17, 2025
658f21a
correct reference to test area
ijiraq Nov 17, 2025
2308ece
remove execure flag on regular file
ijiraq Nov 17, 2025
179214b
Move to a EUPL and keep the build area clean
ijiraq Nov 17, 2025
2927248
Move to EUPL-1.2
ijiraq Nov 18, 2025
510de55
Reduce file cluter
ijiraq Nov 18, 2025
8cd95b3
Improved cleanup
ijiraq Nov 18, 2025
6f86124
working towards a normalized project file structure
ijiraq Nov 24, 2025
48ede2a
Correct length of color array
ijiraq Nov 24, 2025
bc95513
Normalized project strcuture
ijiraq Nov 24, 2025
dd0ccb7
use a modern install configuration
ijiraq Nov 24, 2025
4f07d7e
migrating tutorials to be compatible with new version of ossssim
ijiraq Nov 24, 2025
6e5e40e
a stub area for survey characterizations
ijiraq Nov 24, 2025
d818ca2
make version dynamic
ijiraq Nov 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 22 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Publish to CANFAR

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build and Push the SSIM Docker image
run: |
docker build --target deploy --build-arg VERSION=python -t ssim:python -f Dockerfile .
docker login --username ${{ secrets.IMAGES_CANFAR_LOGIN}} --password ${{ IMAGES_CANFAR_TOKEN}}
docker push ssim:python
-
15 changes: 12 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
.idea
__pycache__
__version__.py
build
OSSOSv11/
OSSOSv11.tgz
.DS_Store
*.log
*.ipynb
ossssim.egg-info
SurveySubsF95.py
.ipynb_checkpoints
*.swp
*.so
*.o
*.fpp
*.mod
*.icloud
dist
Rebound_Archive*.bin
.python-version
uv.lock
bdir
.vscode
*.egg-info
79 changes: 79 additions & 0 deletions Docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# this builds a container that can be used to run the SurveySimulator (python and fortran)
# This container is loaded into the canfar Science Portal for use/execution.
# Can also be used directly with docker.
FROM condaforge/miniforge3:latest as base
# FROM jupyter/scipy-notebook as base
# USER root
# ENV DEBIAN_FRONTEND="noninteractive"
RUN apt -y -q update
RUN apt -y -q install curl wget man man-db git build-essential zip unzip xdg-utils less emacs nano xterm vim rsync tree gfortran
RUN apt -y install python3-numpy
RUN apt -y -q install meson ninja-build



# SKAHA system settings and permissions
RUN apt install -y -q sssd libnss-sss libpam-sss
COPY etc/nofiles.conf /etc/security/limits.d/
COPY etc/nsswitch.conf /etc/
## see https://bugzilla.redhat.com/show_bug.cgi?id=1773148
RUN touch /etc/sudo.conf && echo "Set disable_coredump false" > /etc/sudo.conf
# generate missing dbus uuid (issue #47)
RUN dbus-uuidgen --ensure


# setup this container for skaha launching
COPY etc/startup.sh /skaha/startup.sh
RUN chmod +x /skaha/startup.sh


# setup a the needed python environment
# RUN apt-get update && yes | apt-get install python3.11 pip
# RUN yes | apt install python3.12-venv
# RUN python3 -m venv /opt/SSim/venv
RUN pip install jupyter
RUN pip install cadctap
RUN pip install vos
RUN pip install scipy
RUN pip install astropy
RUN pip install astroquery
RUN pip install matplotlib
RUN pip install f90wrap
# RUN pip install git+https://github.com/jameskermode/f90wrap
RUN pip install rebound
RUN pip3 install astroplan
RUN pip install Deprecated
RUN pip install canfar


# Build the SSim
RUN mkdir -p /opt/SSim/fortran
COPY fortran /opt/SSim/fortran
COPY python /opt/SSim/python
WORKDIR /opt/SSim/fortran/F95

# install Fortran based binary of SSim
RUN make clean && make Driver GIMEOBJ=ReadModelFromFile
RUN cp Driver /usr/local/bin/SSim
# RUN echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections
# RUN apt-get install -y ttf-mscorefonts-installer

# install the Python based version of SSim
FROM base as deploy
WORKDIR /opt/SSim/python
# RUN pip install .
# RUN python setup.py install

# Two build sets, deploy and test
FROM base as test

RUN mkdir -p /arc/home
RUN groupadd -g 1001 testuser
RUN useradd -u 1001 -g 1001 -s /bin/bash -d /arc/home/testuser -m testuser
RUN chown -R testuser /opt/SSim
WORKDIR /opt/SSim/python
# RUN pip3 install -e .
USER testuser
WORKDIR /arc/home/testuser
COPY etc/ReadModelFromFile.in ./
ENTRYPOINT ["/skaha/startup.sh"]
3 changes: 2 additions & 1 deletion Makefile → Docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
REPO = images.canfar.net
PROJECT = uvickbos
DEVNAME = ssim
VERSION = python
VERSION = 3.0

NAME = $(REPO)/$(PROJECT)/$(DEVNAME)

Expand All @@ -14,6 +14,7 @@ deploy: production

dev: dependencies Dockerfile
docker build --target test --build-arg VERSION=$(VERSION) -t $(NAME):$(VERSION) -f Dockerfile .
echo "docker run --rm -it -p 8888:8888 $(NAME):$(VERSION) bash"

dependencies:

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
61 changes: 0 additions & 61 deletions Dockerfile

This file was deleted.

9 changes: 7 additions & 2 deletions fortran/F95/Driver.f95 → F95/Driver.f95
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,16 @@ program Driver

use gimeobjut
use surveysub
use debug

implicit none

integer, parameter :: n_obj_max = 10000, screen = 6, keybd = 5, verbose = 9
integer, parameter :: n_obj_max = 10000, screen = 6, keybd = 5
integer :: lun_h, lun_t
type(t_orb_m) :: o_m
! color array NEEDS to be length 10 or more!
real (kind=8) :: h, epoch, m_int, d_ra, d_dec, r, delta, ra, dec, random, &
mt, color(10), gb, ph, period, amp, jday_p, m_rand, eff, rn_iter, &
mt, color(128), gb, ph, period, amp, jday_p, m_rand, eff, rn_iter, &
eff_lim, h_rand
integer :: n_hits, n_track, ierr, seed, flag, isur, ic, n_iter, &
n_track_max, nchar, values(8), c_idx, i1, i2
Expand All @@ -69,6 +70,9 @@ program Driver
lun_t = 11
keep_going = .true.

! setup debuging from CL args
call debug_init_from_args()

! Get arguments
! Seed for random number generator
read (5, *, err=9999) seed
Expand Down Expand Up @@ -171,6 +175,7 @@ program Driver

! Determine if the object would be detected
call Detos1 (o_m, epoch, h, color, gb, ph, period, amp, survey_dir, seed, &
debug_on, &
flag, ra, dec, d_ra, d_dec, r, delta, m_int, m_rand, eff, isur, mt, &
jday_p, ic, surna, h_rand, ierr)

Expand Down
File renamed without changes.
105 changes: 105 additions & 0 deletions F95/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Things that are needed fort the CLI (User interface)
U = modelutils GiMeObj
OBJU = $(addsuffix .o,${U})
SRCU = $(addsuffix .f95,${U})
FPPU = $(addsuffix .fpp,${U})
MODU = $(addsuffix .mod,${U})

# Things that should end up with python module access
M = datadec ioutils surveysub
OBJM = $(addsuffix .o,${M})
SRCM = $(addsuffix .f95,${M})
FPPM = $(addsuffix .fpp,${M})
MODM = $(addsuffix .mod,${M})
F90M = $(addsuffix .f90,${M})
F90_WRAP_M = $(addprefix f90wrap_,${F90M})

# Things that should be in the library
A = parameters poly_dec datadec common_data debug poly_lib ioutils elemutils rot effut xvutils numutils getsur surveysub
OBJA = $(addsuffix .o,${A})
SRCA = $(addsuffix .f95,${A})
FPPA = $(addsuffix .fpp,${A})
MODA = $(addsuffix .mod,${A})

# SSIM = SurveySubsF95
MODULE ?= SurveySubs
GOBJ = GiMeObjF95


FC = gfortran
FPP = gfortran -E -x f95-cpp-input -fPIC -DPYTHON
# FPP_F90FLAGS = -x f95-cpp-input -fPIC


FFLAGS = -O3 -fPIC -x f95-cpp-input
FFLAGP = -O3
CFLAGS =
CPPFLAGS =
LIBTOOL = ar src
BUILD_DIR = meson
KIND_MAP = kind_map
F2PYFLAGS = --build-dir $(BUILD_DIR) --fcompiler=gfortran


.PHONY: all clean

# TOPTARGETS := clean
# use the GIMEOBJ from the command line or the default value of InnerHotModel
GIMEOBJ ?= InnerHotModel

# $(TOPTARGETS): $(SSIM)

# .PHONY: $(SUBDIRS)

# $(SUBDIRS):
# $(MAKE) -C $@ $(MAKECMDGOALS)

all: $(MODULE)

test:
$(MAKE) -s -C tests test LANGUAGE=F95

%.fpp : %.f95
$(FPP) $< -o $@

%.o : %.f95
$(FC) $(FFLAGS) -c $<

.PHONY: clean

clean: rmtmp
rm -f _$(MODULE)*.so _$(GOBJ)*.so _$(IOBJ)*.so _$(ROBJ)*.so Driver GiMeObj.f95
rm -rf $(BUILD_DIR) libsrc.a

rmtmp:
rm -f *~ *.o *.mod *.fpp f90wrap*f90 SimulDetect.dat SimulTrack.dat
rm -f $(IOBJ).py $(ROBJ).py $(MODULE).py $(GOBJ).py _$(MODULE)*.so
rm -f *.log LOG .f2py_f2cmap

.PHONY: link

link:
\rm -f GiMeObj.f95
\rm -f GiMeObj.o
ln -s $(GIMEOBJ).f95 GiMeObj.f95

Driver: link Driver.f95 $(OBJA) $(OBJU) Makefile GiMeObj.f95
$(FC) $(FFLAGP) -o Driver $(OBJA) $(OBJU) Driver.f95

magerr: link magerr.f95 $(OBJU) ${SRCM} Makefile
$(FC) $(FFLAGP) -o magerr $(OBJU) ${SRCM} magerr.f95
rm GiMeObj.f95

libsrc.a: ${OBJA}
${LIBTOOL} $@ $?

Modules: _$(MODULE).so Makefile
echo "Modules have been built"

$(MODULE): Makefile $(FPPM) libsrc.a
f90wrap -m $(MODULE) $(FPPM) -k $(KIND_MAP) -v -P > f90wrap.log 2>&1
mkdir -p $(BUILD_DIR)
ln -s -f $(CURDIR)/*.mod $(BUILD_DIR)/
f2py-f90wrap $(F2PYFLAGS) -c -m _$(MODULE) $(F90_WRAP_M) -lsrc -L$(CURDIR) > f2py_f90wrap.log 2>&1
\rm f90wrap*.f90 *.fpp *.o *.mod .f2py_f2cmap libsrc.a
\rm -r $(BUILD_DIR)
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading