Skip to content

Incorporate det into sca#30

Open
arunkannawadi wants to merge 26 commits into
mainfrom
incorporate_det_into_sca
Open

Incorporate det into sca#30
arunkannawadi wants to merge 26 commits into
mainfrom
incorporate_det_into_sca

Conversation

@arunkannawadi
Copy link
Copy Markdown
Member

This is NOT yet reviewed and is NOT ready to be merged

@arunkannawadi
Copy link
Copy Markdown
Member Author

@yuedong0607 could you move the changes related to the coadd level simulation to another branch? Is the work on incorporating detector physics done and ready for some testing?

@yuedong0607 yuedong0607 force-pushed the incorporate_det_into_sca branch from 68096c4 to 270869e Compare May 15, 2025 20:55
Comment thread config/was.yaml Outdated
sky_subtract: False
sky_subtract: True

dither_from_file: /hpc/home/yf194/Work/final_sims_2023/Roman_WAS_obseq_11_1_23_ditherlist.txt
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not readable. I also have changes in the prism branch that make this optional.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Arun, this file is needed by the persistence module to select the neighboring dithers. Any suggestions on how to make this more readable? Could you point me to the changes in prism branch that you have mentioned?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just meant that this file in your home directory is readable only by you, not others.

Comment thread roman_imsim/sca.py Outdated
# sky_image /= roman.gain
# sky_image.quantize()
# image -= sky_image

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want us to use commenting out code as a way to keeping history. Git does that for us. Just delete these lines.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have removed most of the commented old codes

@arunkannawadi
Copy link
Copy Markdown
Member Author

Is this ready for review? If so, can you rebase this branch on to the main branch, resolve the conflicts and mark it as "Ready for review". Does this run? Trying to run this branch gave me an error, while the main branch did not.

@yuedong0607
Copy link
Copy Markdown
Collaborator

yuedong0607 commented Jul 22, 2025

Is this ready for review? If so, can you rebase this branch on to the main branch, resolve the conflicts and mark it as "Ready for review". Does this run? Trying to run this branch gave me an error, while the main branch did not.

Arun, could you be more specific about what error message you got? I just did a test run via galsim was.yaml and it completed successfully (see attached figure). The test I did was under simdevel2 environment. Strangely only pip install -e . doesn't work and I need to do a python setup.py install --user instead.

And I rebased on to the main branch.

Screenshot 2025-07-22 at 2 34 01 PM

@yuedong0607 yuedong0607 marked this pull request as ready for review July 22, 2025 19:23
@arunkannawadi
Copy link
Copy Markdown
Member Author

Ah, never mind. The skyCatalogs version in simdevel2 is outdated. We'll need to make some changes in this repo while updating our environment to a more recent version, but that's not something that needs to happen in this branch.

Also, I don't see this branch rebased. You've pulled in the main branch in here. Please see the CONTRIBUTING.md on the main branch on how to rebase.

@yuedong0607 yuedong0607 force-pushed the incorporate_det_into_sca branch from 2ae453f to 957f4e3 Compare July 30, 2025 23:27
Copy link
Copy Markdown
Member Author

@arunkannawadi arunkannawadi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have passed through the code once and I've given my first round of comments so you could work on them right away. I will give another round of review with some additional science inputs.

Comment thread roman_imsim/effects/background.py Outdated
import galsim.roman as roman


class background(roman_effects):
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use CamelCase for all class names? So this would read as follows

Suggested change
class background(roman_effects):
class Background(RomanEffects):

Comment thread roman_imsim/effects/gain.py Outdated
import numpy as np
import fitsio as fio
import galsim.roman as roman
from roman_imsim.effects import roman_effects
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
from roman_imsim.effects import roman_effects
import .roman_effects

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and similarly elsewhere.

Comment thread roman_imsim/effects/interpix_cap.py Outdated
from .utils import sca_number_to_file


class interpix_cap(roman_effects):
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class interpix_cap(roman_effects):
class IPC(roman_effects):

IPC or InterPixelCapacitance

Comment thread roman_imsim/sca.py Outdated

# # [TODO]
# break

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove these lines

Comment thread config/was.yaml Outdated
model: lab_model
sky_subtract: False

# dither_from_file: /hpc/home/yf194/Work/final_sims_2023/Roman_WAS_obseq_11_1_23_ditherlist.txt
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# dither_from_file: /hpc/home/yf194/Work/final_sims_2023/Roman_WAS_obseq_11_1_23_ditherlist.txt

Comment thread roman_imsim/effects/roman_effects.py Outdated
import roman_imsim.effects as effects


class roman_effects(object):
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class roman_effects(object):
class RomanEffects:

or more accurately RomanInstrumentalEffects. Long names are fine if they are more accurate and descriptive.

Comment thread roman_imsim/effects/saturate.py Outdated
from .utils import sca_number_to_file


class saturate(roman_effects):
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class saturate(roman_effects):
class Saturation(RomanEffects):

Let's use nouns for all the effects.

Comment thread roman_imsim/effects/setup_sky.py Outdated
from .utils import get_pointing


class setup_sky(object):
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this live inside roman_imsim.effects? It's not an effect itself. This module should live one directory above.

Comment thread roman_imsim/effects/recip_failure.py Outdated
import galsim.roman as roman


class recip_failure(roman_effects):
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class recip_failure(roman_effects):
class ReciprocityFailure(RomanEffects):

Comment thread roman_imsim/effects/recip_failure.py Outdated
"%s hasn't been implemented yet, the simple model will be applied for %s"
% (str(self.params["model"]), str(self.__class__.__name__))
)
self.model = self.simple_model
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For effects that do not have a lab_model implemented, we need to emit a warning OR error saying that they are not yet implemented if they are set to lab_model in the config file.

* Enable selection of different models for each effect via the configuration YAML.
* Implementing a nested class structure in detector_effects.py.
* Testing the implementation of QE and BFE effects.
* removing some commented-out codes
* move setup_sky to RomanEffects file.
@yuedong0607 yuedong0607 force-pushed the incorporate_det_into_sca branch from 1b39b5d to 0346889 Compare August 27, 2025 05:23
@yuedong0607
Copy link
Copy Markdown
Collaborator

I ran both this branch and main using the following noise setup:
main:
stray_light: True
thermal_background: True
reciprocity_failure: True
dark_current: True
nonlinearity: True
ipc: True
read_noise: True

this branch:
add_effects:
Background:
model: simple_model
thermal_background: True
stray_light: True
ReciprocityFailure:
model: simple_model
DarkCurrent:
model: simple_model
Nonlinearity:
model: simple_model
IPC:
model: simple_model
ReadNoise:
model: simple_model
Gain:
model: simple_model

the only differences I noticed was the date parameter given to getSkyLevel() call (see issue #68)
Aside from that, the results from the two branches differ only slightly. Some statistics are shown below:
mean diff 0.0022401611704918408
median diff 0.0
std diff 23.382407151643644

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants