Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collection of old issues #10

Open
nabobalis opened this issue Sep 28, 2020 · 0 comments
Open

Collection of old issues #10

nabobalis opened this issue Sep 28, 2020 · 0 comments

Comments

@nabobalis
Copy link
Collaborator

Issues on another repository that might be useful to keep around.

1

The uncertainty of the spectrograph data was calculated in the reader function.
The relevant parts of the code from that module were:

import astropy.units as u

# Define detector info.
DETECTOR_GAIN = {"NUV": 18., "FUV": 6.}
DETECTOR_YIELD = {"NUV": 1., "FUV": 1.5}
DN_UNIT = {"NUV": u.def_unit("DN_IRIS_NUV", 
                             DETECTOR_GAIN["NUV"] / DETECTOR_YIELD["NUV"] * u.photon),
           "FUV": u.def_unit("DN_IRIS_FUV",
                             DETECTOR_GAIN["FUV"] / DETECTOR_YIELD["FUV"] * u.photon)}
READOUT_NOISE = {"NUV": 1.2*DN_UNIT["NUV"], "FUV": 3.1*DN_UNIT["FUV"]}

# Calculate uncertainty
out_uncertainty = u.Quantity(
    np.sqrt((hdulist[window_fits_indices[i]].data * DN_unit).to(u.photon).value +
             readout_noise.to(u.photon).value**2),
    unit=u.photon).to(DN_unit).value

2

Write equivalencies using astropy units from counts (u.ct) to photons for iris_sji_dn_equivalency, iris_fuv_dn_equivalency and iris_nuv_dn_equivalency.

  • Currently there is no DN unit (data number) in astropy so make the equivalency between counts (u.ct) and photons.
  • The SJI equivalency should be in the sji_utils.py file while the FUV and NUV equivalencies should be in the sg_utils.py file.
  • Look up astropy equivalencies to see how to write new equivalencies.
  • The conversions between DN and photons via the detector gains can be found in the definition of the DN units in iris_tools.
  • These equivalencies should replace the IRIS units.

4

The code in the obsid module and its test module hasn't changed in the move from IRISpy. But some of the infrastructure that was used to perform the tests may need editing due to the move, e.g. missing imports, changed path names, etc.

A PR addressing this issue should not try to get tests for other modules working as they will change substantially and the test can be fixed at those times. However, a lot of the work done here may also mean there's less to do for other modules later in fixing their tests.

For simplicity, if this is the first issue addressed, this PR should comment out all other test modules by making those files giant docstrings. The modules can be uncommented as work on their modules is performed.

5

In IRISpy, the uncertainty of the spectrograph data was calculated in the reader function. The relevant parts of the code from that module were:

import astropy.units as u

# Define detector info.
DETECTOR_GAIN = {"NUV": 18., "FUV": 6.}
DETECTOR_YIELD = {"NUV": 1., "FUV": 1.5}
DN_UNIT = {"NUV": u.def_unit("DN_IRIS_NUV", 
                             DETECTOR_GAIN["NUV"] / DETECTOR_YIELD["NUV"] * u.photon),
           "FUV": u.def_unit("DN_IRIS_FUV",
                             DETECTOR_GAIN["FUV"] / DETECTOR_YIELD["FUV"] * u.photon)}
READOUT_NOISE = {"NUV": 1.2*DN_UNIT["NUV"], "FUV": 3.1*DN_UNIT["FUV"]}

# Calculate uncertainty
out_uncertainty = u.Quantity(
    np.sqrt((hdulist[window_fits_indices[i]].data * DN_unit).to(u.photon).value +
             readout_noise.to(u.photon).value**2),
    unit=u.photon).to(DN_unit).value
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

No branches or pull requests

1 participant