Skip to content

Commit

Permalink
Merge pull request #733 from rbanffy/main
Browse files Browse the repository at this point in the history
Typo/trailing whitespace fixes
  • Loading branch information
mschwamb authored Nov 24, 2023
2 parents 5a391ab + b0a6822 commit a74b45c
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 60 deletions.
2 changes: 1 addition & 1 deletion docs/cite.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Please also cite the software and ancillary data files that helps power Sorcha:
* rebound https://rebound.readthedocs.io/en/latest/
* sbpy https://joss.theoj.org/papers/10.21105/joss.01426
* scipy https://scipy.org/citing-scipy/
* SPICE kernels and anscillary data files https://naif.jpl.nasa.gov/naif/credit.html
* SPICE kernels and ancillary data files https://naif.jpl.nasa.gov/naif/credit.html
* spiceypy https://spiceypy.readthedocs.io/en/main/citation.html
* tqdm https://tqdm.github.io/

Expand Down
4 changes: 2 additions & 2 deletions docs/complexparameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Incorporating Rotational Light Curves and Active Objects
==========================================================
Sorcha has the ability user provided functions though python classes that augment/change the apparent brightness calculations for the synthetic Solar System objects. Any values required as input for these calculations, must be provided in the separate :ref:`CPP` file as input.

We have base example classes that the user can take and modify to whatever your need is. Within the Sorcha :ref:`configs`, the user would then specify when class would use and provide the required :ref:`CPP` file on the command line. We also have 2 pre-made example classes that can augment the calculated apparent magnitude of each synthetic object, One for handling cometary activity as a function of heliocentric distance and one that applies rotational light curves to the synthetic objects. In both cases, any derived class must inherit from the correspondig base class and follow its API, to ensure that sorcha knows how to find and use your class.
We have base example classes that the user can take and modify to whatever your need is. Within the Sorcha :ref:`configs`, the user would then specify when class would use and provide the required :ref:`CPP` file on the command line. We also have 2 pre-made example classes that can augment the calculated apparent magnitude of each synthetic object, One for handling cometary activity as a function of heliocentric distance and one that applies rotational light curves to the synthetic objects. In both cases, any derived class must inherit from the corresponding base class and follow its API, to ensure that sorcha knows how to find and use your class.

Cometary Activity or Simulating Other Active Objects
--------------------------------------------------------
Expand All @@ -14,7 +14,7 @@ Cometary Activity or Simulating Other Active Objects
Rotational Light Curve Effects
-----------------------------------

The base lightcurve class is `AbstractLightCurve <https://github.com/dirac-institute/sorcha/blob/04baa79a7d67e1647b839a2d3880d8bfd9ce4624/src/sorcha/lightcurves/base_lightcurve.py#L10>`_ (see below). Inside the `sorcha addons github repository <https://github.com/dirac-institute/sorcha-addons>`_, we provide a simple example implementation where the apparent magnitude of the object (that is, the magnitude after all geometric effects have been taken into account), has a sinusoidal term added to it. To use this function, in the :ref:`CPP` file, the user must provide a light curve amplitude (`LCA`), corresponding to half the peak-to-peak amplitude for the magnitude changes, a period `Period`, and a reference time `Time0` where the light curve is at 0 - if these are not provided, the software will produce an error message. Despite being simple, that implementation shows all the class methods that need to be implemented for a custom light curve function.
The base lightcurve class is `AbstractLightCurve <https://github.com/dirac-institute/sorcha/blob/04baa79a7d67e1647b839a2d3880d8bfd9ce4624/src/sorcha/lightcurves/base_lightcurve.py#L10>`_ (see below). Inside the `sorcha addons GitHub repository <https://github.com/dirac-institute/sorcha-addons>`_, we provide a simple example implementation where the apparent magnitude of the object (that is, the magnitude after all geometric effects have been taken into account), has a sinusoidal term added to it. To use this function, in the :ref:`CPP` file, the user must provide a light curve amplitude (`LCA`), corresponding to half the peak-to-peak amplitude for the magnitude changes, a period `Period`, and a reference time `Time0` where the light curve is at 0 - if these are not provided, the software will produce an error message. Despite being simple, that implementation shows all the class methods that need to be implemented for a custom light curve function.

.. literalinclude:: ../src/sorcha/lightcurves/base_lightcurve.py
:language: python
Expand Down
10 changes: 5 additions & 5 deletions docs/ephemerisgen.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Sorcha's ephemeris generator is powered by `ASSIST <https://assist.readthedocs.
How It Works
--------------------------------------------------------

The Sorcha ephemeris generator determines which objects will appear in or near the camera field of view (FOV) for any given exposure. It uses spatial indexing to speed up these calculations. It runs through the survey visits and does on-the-fly checks of where every synthetic object is near the center of each night for which there are visits and organizes those positions using the `HEALPix (Hierarchical Equal Area isoLatitude Pixelation of a sphere) <https://healpix.sourceforge.io/>`_ tesselation of the sky. Given that information, it then steps through the visits for that night, doing precise calculations for just those objects that are near the camera FOV (field-of-view) of each survey on-sky visit. Specifically, for each visit, the generator calculates the unit vector from the observatory's location to the RA/Dec location of the field center. Then it finds the set of HEALPix tiles that are overlapped by the survey vist's camera FOV (nside=64). The ephemeris generator then collects the IDs for the particles in the HEALPix tiles overlapped by the given survey visit FOV. It then does light time corrected ephemeris calculations for just those, outputting the right ascenion, declination, rates, and relevant distances, and phase angle values for each of the particles.
The Sorcha ephemeris generator determines which objects will appear in or near the camera field of view (FOV) for any given exposure. It uses spatial indexing to speed up these calculations. It runs through the survey visits and does on-the-fly checks of where every synthetic object is near the center of each night for which there are visits and organizes those positions using the `HEALPix (Hierarchical Equal Area isoLatitude Pixelation of a sphere) <https://healpix.sourceforge.io/>`_ tesselation of the sky. Given that information, it then steps through the visits for that night, doing precise calculations for just those objects that are near the camera FOV (field-of-view) of each survey on-sky visit. Specifically, for each visit, the generator calculates the unit vector from the observatory's location to the RA/Dec location of the field center. Then it finds the set of HEALPix tiles that are overlapped by the survey vist's camera FOV (nside=64). The ephemeris generator then collects the IDs for the particles in the HEALPix tiles overlapped by the given survey visit FOV. It then does light time corrected ephemeris calculations for just those, outputting the right ascension, declination, rates, and relevant distances, and phase angle values for each of the particles.

Because ASSIST uses REBOUND's `IAS15 integrator <https://ui.adsabs.harvard.edu/abs/2015MNRAS.446.1424R/abstract>`_, which has an adaptive time step, Sorcha's ephemeris generator instantiates a REBOUND n-body simulation for each individual massless synthetic object including the effects of the Sun, planets, Moon, and 16 asteroids (see the :ref:`MAP` section). It also includes the J2, J3, and J4 gravitational harmonics of the Earth, the J2 gravitational harmonic of the Sun, and general relativistic correction terms for the Sun, using the Parameterized Post-Newtonian (PPN) formulation. The positions of the massive bodies come from the latest `DE441 <https://iopscience.iop.org/article/10.3847/1538-3881/abd414>`_ ephemeris, provided by NASA's `Navigation and Ancillary Information Facility (NAIF) <https://naif.jpl.nasa.gov/naif/credit.html>`_. We note that the coordinate frame for ASSIST+REBOUND is the equatorial International Celestial Reference Frame (ICRF). The positions and velocities are barycentric within this frame, rather than heliocentric. The ephemeris generator translates the input barycentric or heliocentric orbits into x,y, z and velocities into the barycentric ICRF to be read into ASSIST.

Expand Down Expand Up @@ -46,7 +46,7 @@ Here's the list of asteroid pertubers that are included in the ASSIST+REBOUND in
- **(4) Vesta = A807 FA**

.. warning::
If you simulate the orbits of these select asteroids you will get **POOR results** with the internal Sorcha epehmeris generator because of how the n-body integration is setup. We recommend getting the positions of these asteroids from some other source and inputting them as an external ephemeris file.
If you simulate the orbits of these select asteroids you will get **POOR results** with the internal Sorcha ephemeris generator because of how the n-body integration is setup. We recommend getting the positions of these asteroids from some other source and inputting them as an external ephemeris file.

Tuning the Ephemeris Generator
-----------------------------------
Expand All @@ -62,10 +62,10 @@ There are several tunable options for the ephemeris generation which are describ
.. tip::
We recommend you use the defaults value that we use in our :ref:`example_configs` as they are sufficient for most Solar System populations you'll want to simulate.

Auxillary Files
Auxiliary Files
-----------------

A number of auxillary file available from the `Minor Planet Center <https://www.minorplanetcenter.net/data>`_ and `NASA's Navigation and Ancillary Information Facility (NAIF) <https://naif.jpl.nasa.gov/pub/naif/generic_kernels/>`_ are required for ephemeris generation:
A number of auxiliary file available from the `Minor Planet Center <https://www.minorplanetcenter.net/data>`_ and `NASA's Navigation and Ancillary Information Facility (NAIF) <https://naif.jpl.nasa.gov/pub/naif/generic_kernels/>`_ are required for ephemeris generation:

- **naif0012.tls** is the leap second file. This changes whenever there is a new leap second. The last was in 2017.
- **earth_720101_070426.bpc** is the historical Earth orientation specification. This should not change, unless there is a new model.
Expand All @@ -76,5 +76,5 @@ A number of auxillary file available from the `Minor Planet Center <https://www.
- **obscodes_extended.json** - observatory position information and Minor Planet Center (MPC) observatory codes.

.. tip::
See our :ref:`installation_aux` instructions to find out how to download and install these auxillary files automatically using our download utility.
See our :ref:`installation_aux` instructions to find out how to download and install these auxiliary files automatically using our download utility.

18 changes: 9 additions & 9 deletions docs/gettingstarted.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ Getting Started
In this tutorial, we will show you how to setup and run a basic simulation using Sorcha.

.. tip::
In this tutorial, we demonstrate how to run a single instance of Sorcha. Sorcha is designed to allow multiple instances to be run in parallel in order to accomodate simulations with very large numbers of synthetic planetesimals by breaking up the job across multiple live proccesses. We recommend first starting with the examples below, before moving on to parallel processing.
In this tutorial, we demonstrate how to run a single instance of Sorcha. Sorcha is designed to allow multiple instances to be run in parallel in order to accommodate simulations with very large numbers of synthetic planetesimals by breaking up the job across multiple live processes. We recommend first starting with the examples below, before moving on to parallel processing.


.. important::
All the input files and configuration files used in this demonstation are available in the demo directory(sorcha/demo). We provide the contents of these files and the links below to download each. You can also grab them in one go by downloading the Sorcha source code repository (Steps 1-4 **only** of :ref:`dev_mode`).
All the input files and configuration files used in this demonstration are available in the demo directory(sorcha/demo). We provide the contents of these files and the links below to download each. You can also grab them in one go by downloading the Sorcha source code repository (Steps 1-4 **only** of :ref:`dev_mode`).

.. note::
All input data files in this example are white-space separated format solely for the ease of reading.
Expand All @@ -29,13 +29,13 @@ First, we will start with creating an :ref:`orbits`, and generate a file called
Make the Physical Parameters File
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Next, we need to produce the :ref:`physical`, which we call 'sspp_testset_colours.txt'. This file assigns colors, phase curve properties, and absolute mangitudes to each of the simulated small bodies whose orbits are defined in our input orbit file. You can download the file from `here <https://github.com/dirac-institute/sorcha/blob/main/demo/sspp_testset_colours.txt>`__. The contents of the file is below:
Next, we need to produce the :ref:`physical`, which we call 'sspp_testset_colours.txt'. This file assigns colors, phase curve properties, and absolute magnitudes to each of the simulated small bodies whose orbits are defined in our input orbit file. You can download the file from `here <https://github.com/dirac-institute/sorcha/blob/main/demo/sspp_testset_colours.txt>`__. The contents of the file is below:

.. literalinclude:: ../demo/sspp_testset_colours.txt
:language: text

.. note::
For this tutorial, we have defined chosen the main filter to be r-band. In the following configuration file, we wil list the r filter first when we have to input ourlist of filters to use.
For this tutorial, we have defined chosen the main filter to be r-band. In the following configuration file, we will list the r filter first when we have to input our list of filters to use.

Getting the Pointing Database
------------------------------------------
Expand All @@ -45,7 +45,7 @@ For this tutorial, we're using the first year of the baseline v2.0 LSST cadence
Setting Up Sorcha's Configuration File
------------------------------------------

The key information about the simulation paramteres are held in the configuration file. For further details check out our :ref:`configs` page. We'll be using the configuration file we have set up to get you started. You can download the file from `here <https://github.com/dirac-institute/sorcha/blob/main/demo/sorcha_config_demo.ini>`__. The contents of the file is below:
The key information about the simulation parameters are held in the configuration file. For further details check out our :ref:`configs` page. We'll be using the configuration file we have set up to get you started. You can download the file from `here <https://github.com/dirac-institute/sorcha/blob/main/demo/sorcha_config_demo.ini>`__. The contents of the file is below:

.. literalinclude:: ../demo/sorcha_config_demo.ini
:language: text
Expand All @@ -54,13 +54,13 @@ The key information about the simulation paramteres are held in the configuratio
For this tutorial, we have set up Sorcha to only find detections on g,r,i,z,u, or y filter observations, by what we have set the **observing_filters** parameter to. Since we specified the absolute magnitude and colors for our synthetic objects to r-band, the r filter starts the list of filters for **observing_filters**.

.. note::
This config file sdets the output to be in CSV format.
This config file sets the output to be in CSV format.


Running Sorcha
----------------------

We now have all the required input files. If you downloaded the Sorcha repository, start by moving into the sorcha directory or make a demo directory called **demo** and move/copy all the input files into there. For this example run, we assume that you have downloaded the required ephemeris generator's auxiliary files to ./ar_files. Check the :ref:`installation` instuctions for further details.
We now have all the required input files. If you downloaded the Sorcha repository, start by moving into the sorcha directory or make a demo directory called **demo** and move/copy all the input files into there. For this example run, we assume that you have downloaded the required ephemeris generator's auxiliary files to ./ar_files. Check the :ref:`installation` instructions for further details.

Next, let's take a look at the command line arguments for sorcha. On the command line, typing::

Expand Down Expand Up @@ -90,7 +90,7 @@ The output will appear in a csv file (testrun_e2e.csv) in your current directory
If you want to run this command a second time you'll need to add a **-f** flag to the command line to force overwriting output files that already were exist in the output directory. Do note that the previous run's log and error log files will not be removed. New log files are generated at each run.

.. warning::
Only one instance of Sorcha should be run per output directory to ensure that distict log and error files are created for each Sorcha run. Make sure to have different output pathways if you are running multiple instances on the same compute node.
Only one instance of Sorcha should be run per output directory to ensure that distinct log and error files are created for each Sorcha run. Make sure to have different output pathways if you are running multiple instances on the same compute node.

.. note::
This test run is using pre-generated ephemeris already stored in the demo directory of the Sorcha github repository.
This test run is using pre-generated ephemeris already stored in the demo directory of the Sorcha GitHub repository.
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ or brightness in Irish and Scots Gaelic, and our software is estimating the brig
simulated Solar System small bodies and determines which ones the survey could detect in
each of the survey's observations or based on user set criteria. Sorcha has been designed
with the `Vera C. Rubin Observatory Legacy Survey of Space and Time (LSST) <https://www.lsst.org>`_
in mind. The software has a modulardesign, and with some effort it can be adapted to be
in mind. The software has a modular design, and with some effort it can be adapted to be
used with any survey.

.. warning::
This documentation site and the software package it describes are under
active development. Validation is still on-going. DO NOT USE this for science
purposes just yet. WE REALLY MEAN THIS. THE CODEBASE IS UNDER HEAVY DEVLEOPMENT.
purposes just yet. WE REALLY MEAN THIS. THE CODEBASE IS UNDER HEAVY DEVELOPMENT.


Welcome to Sorcha's documentation!
Expand Down
Loading

0 comments on commit a74b45c

Please sign in to comment.