Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 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
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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
-
12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,19 @@ OSSOSv11/
OSSOSv11.tgz
.DS_Store
*.log
*.ipynb
.ipynb_checkpoints
*.swp
ossssim.egg-info
SurveySubsF95.py
*.so
*.o
*.fpp
*.mod
*.icloud
dist
Rebound_Archive*.bin
fortran/F95/bdir/
.python-version
uv.lock
bdir
.vscode
70 changes: 44 additions & 26 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,60 +1,78 @@
# 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 ubuntu:latest as deploy
USER root
RUN apt-get update && yes | unminimize
RUN apt-get update && yes | apt-get install wget man man-db manpages-posix git \
build-essential zip unzip xdg-utils less emacs nano xterm vim rsync tree gfortran
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-get update && yes | apt-get install sssd libnss-sss libpam-sss
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 pip
RUN pip3 install cadctap
RUN pip3 install vos
RUN pip3 install numpy
RUN pip3 install scipy
RUN pip3 install astropy
RUN pip3 install --pre astroquery
RUN pip3 install matplotlib
RUN pip3 install f90wrap
RUN pip3 install rebound
RUN pip3 install jupyter
RUN pip3 install jupyterlab
# 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 /opt/SSim
RUN mkdir /opt/SSim/fortran
COPY fortran/F95 /opt/SSim/fortran/F95
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
WORKDIR /opt/SSim/python
RUN pip install .
# RUN echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections
# RUN apt-get install -y ttf-mscorefonts-installer

RUN pip3 install astroplan
# 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 deploy as test
RUN echo "Adding a test user to run local testing"
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 ./
Expand Down
3 changes: 2 additions & 1 deletion 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
77 changes: 74 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,11 @@ eupl1.1.-licence-en_0.pdf (detailed description of the licence).
This source code is provided as is, with no warranty of any kind. The user takes full responsiblity for any damage to system, and
for any scientific conclusion drawn.


### Contact
The primary contact for the Survey Simulator code is:
* Jean-Marc Petit: Jean-Marc.Petit@normalesup.org


### Acknowledgement


Cite **Petit, J.-M., et al., AJ, Vol 142 ID 131 (2011)** if you make
use of the SurveySimulator, or the CFEPS L7SyntheticModel-v09 Kuiper belt model.
Expand Down Expand Up @@ -127,11 +124,85 @@ See Simulator/F95/fortran/example or Simulator/F77/fortan/example for examples o
to compile (e.g. `make InnerHotModel`) a survey simulator.

### Simulator/

#### Simulator/fortran/{F95|F77}/SurevySubs.f
This contains the source code for the Survey Simulator. in particular Detos1 which determines, based on
the given orbit and the survey characterization area, which sources are detected.

The Detos1 subrouting is described in the source code but reproduced here to make you aware of the inputs and outputs.

```fortran

subroutine Detos1 (o_m, jday, hx, color, gb, ph, period, amp, surnam, seed, &
debug, &
flag, ra, dec, d_ra, d_dec, r, delta, m_int, m_rand, eff, isur, mt, &
jdayp, ic, surna, h_rand, ierr)
!-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
! This routine determines if a given object is seen by the survey
! described in the directory \verb|surnam|.
! An object is described by its ecliptic (J2000) barycentric osculating
! elements given at time \verb|jday|.
! This version uses polygons to describe the footprint of the block on
! the sky.
!-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
!
! J.-M. Petit Observatoire de Besancon
! Version 1 : January 2006
! Version 2 : May 2013
! Version 3 : March 2016
! Version 4 : May 2016
! Changed API to remove size of arrays, added parameter
! statement to define array sizes (in include file).
! Continue looping on pointings until object is detected,
! characterized and tracked. Don't stop at first detection.
!
!-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
! INPUT
! o_m : orbital elements of object (t_orb_m)
! jday : Time of elements [JD] (R8)
! hx : Absolute magnitude of object in 'x' band, what ever this is (R8)
! color : Array of colors (128*R8)
! IACHAR(FILTER)+1 : FILTER - X
! gb : opposition surge factor G, Bowell formalism (R8)
! ph : phase of lightcurve at epoch jday [rad] (R8)
! period: period of lightcurve [day] (R8)
! amp : amplitude of lightcurve [mag] (R8)
! surnam: Survey directory name (CH)
!
! OUTPUT
! seed : Random number generator seed (I4)
! flag : Return flag (I4):
! 0: not found
! 1: found, but not tracked
! 2: found and tracked
! 3: characterized, but not tracked
! 4: characterized and tracked
! ra : Right ascension at detection [rad] (R8)
! dec : Declination at detection [rad] (R8)
! d_ra : Right ascension rate [rad/day] (R8)
! d_dec : Declination rate [rad/day] (R8)
! r : Sun-object distance [AU] (R8)
! delta : Earth-object distance [AU] (R8)
! m_int : Intrinsic apparent magnitude, in x-band (R8)
! m_rand: Averaged randomized magnitude, in detection filter (R8)
! eff : Actual efficiency of detection (R8)
! isur : Identification number of survey the object was in (I4)
! mt : Mean anomaly at discovery [rad] (R8)
! jdayp : Time of discovery [JD] (R8)
! ic : Index of color used for survey (I4)
! surna : Detection survey name (CH10)
! h_rand: Absolute randomized magnitude, in detection filter (R8)
! ierr : error flag
!-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
'''

```
#### Simulator/{F95|F77}/fortran/ReadModelFromFile.f
This contains the source code for a "GiMeObj" routine that reads
an (orbital+size+colour+lightcurve) model from a file (lookup table).
Use `make ReadModelFromFile` to build a `Driver` program that can be used
to run simulation of observing the Kuiper belt model described in `ReadModelFromFile.f`.

#### Simulator/{F95|F77}/fortran/InnerHotModel.f
Contains the source code for a GiMeObj routine that generates
objects according to some parametric prescription.
Expand Down
1 change: 0 additions & 1 deletion fortran/F95/HST.f95

This file was deleted.

90 changes: 0 additions & 90 deletions fortran/F95/Makefile

This file was deleted.

File renamed without changes.
19 changes: 19 additions & 0 deletions fortran/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[build-system]
requires = ["meson-python", "setuptools>=68", "wheel", "f90wrap"]
build-backend = "setuptools.build_meta"

[project]
name = "OSSSurveySimulatorLibrary"
version = "1.0"
description = "Outer Solar System Survey Simulation Library written in F95 and distributed as a Python module."
readme = "README.md"
requires-python = ">=3.12"
authors = [
{name = "J.M. Petit", email = "jmpetit@obs-besacon.fr" },
{name = "J.J. Kavelaars", email = "jjkavelaars@gmail.com" }
]
license = "CC0-1.0"
dependencies = []

[project.urls]
Homepage = "https://www.ossos-survey.org/simulator.html"
Loading