Roman-Supernova-PIT / sn-forward-model

Forward model SN + host galaxy flux in a series of images.
0 stars 0 forks source link

Run on Rubin+Roman data on RomanDESCSim #11

Open wmwv opened 2 months ago

wmwv commented 2 months ago

Run a supernova from RomanDESCSim with both Roman and Rubin/LSST data

  1. One SN
  2. Ten SNe
wmwv commented 2 months ago

The Rubin/LSST images haven't been processed. Need some way of getting the image list. If we use the eimage files and assume the WCS is perfect we might be able to do this still.

wmwv commented 2 months ago

On NERSC, the RomanDESCSim data are in

/global/cfs/cdirs/lsst/production/roman-desc-sims/

With RomanWFI/TDS data in

/global/cfs/cdirs/lsst/production/roman-desc-sims/Roman_data/RomanTDS/images/simple_model

And Rubin/LSST data in

/global/cfs/cdirs/lsst/production/roman-desc-sims/raw_data/

There's a sample reduction for the Rubin/LSST data done (by Jim Chiang?) with repo and collection

repo = "/global/cfs/cdirs/lsst/production/roman-desc-sims/preview_data_staging/preview_data/"
collection = "u/descdm/preview_data_step1_w_2024_12/20240326T152819Z/"
wmwv commented 1 month ago

Ah, I was confused. Correct repo, collection

repo = "/global/cfs/cdirs/lsst/production/gen3/roman-desc-sims/repo"
collections = ["u/descdm/preview_data_step1_w_2024_12"]
wmwv commented 1 month ago

Here's a snippet to get the matching images for a given RA, Dec

from lsst.daf.butler import Butler
from lsst import sphgeom

transient_id = 30328322
ra, dec = 8.52941151,-43.0266337
mjd_start, mjd_end = 62300.0, 62600.0

repo = "/global/cfs/cdirs/lsst/production/gen3/roman-desc-sims/repo"
collections = ["u/descdm/preview_data_step1_w_2024_12"]

# The Step3/coadd collection is:
# collection = ["u/descdm/preview_data_step3_2877_19_w_2024_12"]

butler = Butler(repo, collections=collections)
butler.registry.queryCollections()

level = 10  # the resolution of the HTM grid
pixelization = sphgeom.HtmPixelization(level)

htm_id = pixelization.index(
    sphgeom.UnitVector3d(
        sphgeom.LonLat.fromDegrees(ra, dec)
    )
)

dataset_refs = butler.registry.queryDatasets("calexp", htm20=htm_id)
wmwv commented 1 month ago

Reading and processing Roman and Rubin data !

wmwv commented 1 month ago

Next need to rethinking dataset, which is now per-function, but needs to be per row.

wmwv commented 3 weeks ago

Dropped dataset. Just tracking based on instrument.

wmwv commented 3 weeks ago

Next steps:

  1. [ ] Read truth file for region, (ra, dec)=(8.5, -43) with nside=32
  2. [ ] Pick some SN w/ roman+Rubin time (and space) overlap. From set of already processed Rubin data (from RomanDESCSims)
  3. [ ] Plot sampled model LCs from truth files for selected SN (both new and exist). Save LC data files and plots
  4. [ ] Construct transient info and transient info host/scence tables
  5. [ ] Get image list
  6. [ ] Run
wmwv commented 3 weeks ago

Selecting supernova with:

import numpy as np
from astropy.table import Table

file = "/global/cfs/cdirs/descssim/imSim/skyCatalogs_v1.1.2/snana_10306.parquet"
df = Table.read(file)
w, = np.where((df["z_CMB"] < 0.7) & (df["ra"] > 8.3) & (df["ra"] < 8.7) & (df["dec"] > -43.5) & (df["dec"] < -42.5) & (df["start_mjd"] > 62200))

yields 391 candidates.

[Edit: Give absolute path for skyCatalogs.]

wmwv commented 3 weeks ago

Of the first 10 and last 10 candidates of those 391, the following three had Rubin simulated images during the SN that have been processed out of the RomanDESCSims:

50130277 50132692 110000220

had matching images.

wmwv commented 2 weeks ago

Updated to include collection with many more (all?) of the images. Getting much long before and during lists now. (Not as many after, because the end date is super conservative and the survey ends).

wmwv commented 2 weeks ago
import numpy as np
from astropy.table import Table

file = "/global/cfs/cdirs/descssim/imSim/skyCatalogs_v1.1.2/snana_10306.parquet"
df = Table.read(file)
w, = np.where((df["z_CMB"] < 0.4) & (df["ra"] > 8.3) & (df["ra"] < 8.7) & (df["dec"] > -43.5) & (df["dec"] < -42.5) & (df["start_mjd"] > 62200))
df[w]["id", "ra", "dec", "z_CMB", "start_mjd", "end_mjd"].write("list.csv")