|
1 | 1 | Difference imaging forced photometry pipeline |
2 | | ---------------------------------------------- |
| 2 | +============================================= |
| 3 | + |
| 4 | +phrosty: **PHotometry for ROman Simulations protoTYpe.** |
| 5 | + |
| 6 | +Aldoroty, L., *et al.*, 2025, in prep |
| 7 | + |
| 8 | +This is lightcurve software being developed for the Roman Supernova Project Infrastructure Team (SNPIT). It is designed to take a sequence of Roman images, divided into "template" and "science" images. It subtracts each template image from each science image. It then measures the flux in a point source at a specified RA/Dec on each difference image. A combination of all of the fluxes measured for a given science image provide an estimate of the flux at the MJD of that science image. All of these fluxes together provide the lightcurve. |
| 9 | + |
| 10 | +Currently, *phrosty* only handles the OpenUniverse sims [ref needed]. It reads images from those sims in FITS format, using the standard FITS WCSes found in the headers of those files for image alignment. The galsim package and a particular version of the roman imsim package (https://github.com/matroxel/roman_imsim.git) provide the PSF used both for PSF photometry and for the PSF matching in the SFFT image subtraction software (Hu *et al.*, 2022, ApJ, 936, 157). |
| 11 | + |
| 12 | +Prerequisites and Environment |
| 13 | +----------------------------- |
| 14 | + |
| 15 | +Although SFFT works in both CPU and GPU environments, currently some of the code in *phrosty* requires a CUDA-based GPU. It requires a machine with an NVidia GPU that has at least 20MB (or more) of GPU RAM. The Perlmutter GPU nodes at NERSC (with 40GB of GPU RAM) meet this requirement, but consumer graphics cards with only 12GB of RAM aren't sufficient. |
| 16 | + |
| 17 | +A number of standard python libraries are required, all of which may be installed from pip, including ``numpy``, ``scipy``, ``astropy``, ``scikit-image``, ``cupy-cuda12x``, ``pandas``, ``requests``, ``fitsio``, ``pyarrow``, ``fastparquet``, and (maybe?) ``nvmath-python[cu12]``. *Phrosty* also requires ``galsim``, which may be installed from pip. |
| 18 | + |
| 19 | +*phrosty* requires commit ``74a9053`` (*warning*: this may be out of |
| 20 | +date) from ``roman_imsim``, which may be git cloned from ``https://github.com/matroxel/roman_imsim.git``. (This is nominally ``v2.0`` of that archive, but as of this writing, there is both a branch and a tag ``v2.0``, which confuses the ``git archive`` command. Thus, we give you the specific commit.) |
| 21 | + |
| 22 | +*phrosty* should run in the `roman snpit environment <https://github.com/Roman-Supernova-PIT/environment>`_. In particular, it should run in the docker image created from that environment. That environment is curretly heavily under development (just like *phrosty*), so exactly which version of the environment works will vary with time. As of this writing, you can pull the latest version of the docker image from either of: |
| 23 | + |
| 24 | +* ``rknop/roman-snpit-env:cuda-dev`` |
| 25 | +* ``registry.nersc.gov/m4385/rknop/roman-snpit-env:cuda-dev`` |
| 26 | + |
| 27 | +(For an example of actually running phrosty in this dockerized environment, see ``examples/perlmutter/README.md``.) |
| 28 | + |
| 29 | +### Manual installs |
| 30 | + |
| 31 | +Not included in the docker image described above is SFFT— because, as of this writing, the version used with phrosty was under development. SFFT must be separately cloned from [email protected]:Roman-Supernova-PIT/sfft.git, the directory to which you clone that archive must by in your `` PYTHONPATH``. As of this writing, * phrosty* requires the `` fixes_20241022`` branch, though hopefully we will get that branch merged back to the `` master`` branch. See "Examples" below for samples of this in action. |
| 32 | + |
| 33 | +### Necessary directories data files |
| 34 | + |
| 35 | +Currently, *phrosty* depends on the following environment variables to find data: |
| 36 | + |
| 37 | +* ``SIMS_DIR`` : OpenUniverse roman data (on nersc: ``/dvs_ro/cfs/cdirs/lsst/shared/external/roman-desc-sims/Roman_data``) |
| 38 | +* ``SN_INFO_DIR`` : A directory that holds information about the OpenUniverse sims, and transients from the OpenUniverse sims. It must have a file ``tds.yaml`` that is copied from ``$SIMS_DIR/RomanTDS/tds.yaml`` and properly modified for whatever environment you're running (mostly by fixing paths). |
| 39 | +* ``SNANA_PQ_DIR`` : A directory with the transient parquet files from the OpenUniverse sims (on nersc: /dvs_ro/cfs/cdirs/lsst/www/DESC_TD_PUBLIC/Roman+DESC/PQ+HDF5_ROMAN+LSST_LARGE) |
| 40 | +* ``DIA_OUT_DIR`` : A directory where difference images (and psfs and other associated images) will be written. |
| 41 | + |
| 42 | + |
| 43 | +## Running the code |
| 44 | + |
| 45 | +TODO. |
| 46 | + |
| 47 | +For now, see the one extant example below. |
| 48 | + |
| 49 | +## Examples |
| 50 | + |
| 51 | +Currently, these examples are intended for members of the Roman SN PIT. Anybody may try them, but since we're early in development, we can't support non-PIT members yet. Members of the PIT, if you have any issues running phrosty, ping Rob Knop and Lauren Aldoroty in the ``#photometry`` channel on the SN PIT Slack. |
| 52 | + |
| 53 | +### NERSC/Perlmutter |
| 54 | + |
| 55 | +An example running *phrosty* on an interactive node, and on a slurm-allocated node, on Perlmutter at NERSC may be found in the examples/perlmutter directory. |
| 56 | + |
| 57 | +## Running tests |
| 58 | + |
| 59 | +The tests need to be run within an environment where *phrosty* will run properly. At the moment, the only environment we've successfully used this with is the Docker environment described in the NERSC/Perlmutter environment above. Follow that example through running ``bash interactive_podman.sh``. Then, instead of doing what the example says, run:: |
| 60 | + cd /home/phrosty/tests |
| 61 | + export DIA_OUT_DIR=../../dia_out_dir |
| 62 | + export SN_INFO_DIR=../../sn_info_dir |
| 63 | + pytest -v |
| 64 | + |
| 65 | +TODO: we need to clean this up and make the test environment more self-contained. |
| 66 | + |
| 67 | +## Plotting lightcurves |
| 68 | + |
| 69 | +TODO. |
| 70 | + |
| 71 | +For now, you can use your favorite plotting program and just read the `.csv` files produced by the pipeline. However, we need to document how you read in the OpenUniverse truth files for plotting lightcurves against the truth files. |
3 | 72 |
|
4 | 73 | License |
5 | | -------- |
| 74 | +======= |
6 | 75 |
|
7 | 76 | This project is Copyright (c) Lauren Aldoroty and licensed under |
8 | 77 | the terms of the BSD-3Clause license. This package is based upon |
9 | 78 | the `Roman Supernova PIT packaging guide <https://github.com/Roman-Supernova-PIT/package-template>`_ |
10 | 79 | which is licensed under the BSD 3-clause licence. See the licenses folder for |
11 | 80 | more information. |
12 | 81 |
|
13 | | -Contributing |
14 | | ------------- |
15 | | - |
16 | | -We love contributions! phrosty is open source, |
17 | | -built on open source, and we'd love to have you hang out in our community. |
18 | | - |
19 | | -**Imposter syndrome disclaimer**: We want your help. No, really. |
20 | | - |
21 | | -There may be a little voice inside your head that is telling you that you're not |
22 | | -ready to be an open source contributor; that your skills aren't nearly good |
23 | | -enough to contribute. What could you possibly offer a project like this one? |
24 | | - |
25 | | -We assure you - the little voice in your head is wrong. If you can write code at |
26 | | -all, you can contribute code to open source. Contributing to open source |
27 | | -projects is a fantastic way to advance one's coding skills. Writing perfect code |
28 | | -isn't the measure of a good developer (that would disqualify all of us!); it's |
29 | | -trying to create something, making mistakes, and learning from those |
30 | | -mistakes. That's how we all improve, and we are happy to help others learn. |
31 | | - |
32 | | -Being an open source contributor doesn't just mean writing code, either. You can |
33 | | -help out by writing documentation, tests, or even giving feedback about the |
34 | | -project (and yes - that includes giving feedback about the contribution |
35 | | -process). Some of these contributions may be the most valuable to the project as |
36 | | -a whole, because you're coming to the project with fresh eyes, so you can see |
37 | | -the errors and assumptions that seasoned contributors have glossed over. |
38 | | - |
39 | | -Note: This disclaimer was originally written by |
40 | | -`Adrienne Lowe <https://github.com/adriennefriend>`_ for a |
41 | | -`PyCon talk <https://www.youtube.com/watch?v=6Uj746j9Heo>`_, and was adapted by |
42 | | -phrosty based on its use in the README file for the |
43 | | -`MetPy project <https://github.com/Unidata/MetPy>`_. |
|
0 commit comments