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

WIP Adding Order 2 PandExo Output for NIRISS SOSS Mode Observations #84

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

mfixstsci
Copy link
Contributor

No description provided.

@mfixstsci mfixstsci changed the title Adding Order 2 PandExo Output for NIRISS SOSS Mode Observations WIP Adding Order 2 PandExo Output for NIRISS SOSS Mode Observations Mar 28, 2024
@natashabatalha
Copy link
Owner

Quick thoughts:

  • One annoying piece of this development will be handing the bokeh js callbacks in run_online. Right now there is this old javascript code to do the binning that will not know what to do with regions of order 1/2 overlap. The easiest way to handle it would be to pre-build one dictionary output with both orders that has an ordered, non overlapping axis. It might not directly capture how binning would be done IRL but it would be easiest to manage.
  • It would be helpful if the python API and runonline had similar behavior. Again, this maps to my comment above about making edits outside of run_online and instead just change how jwst.py operates when a NIRISS SOSS run is requested. I recommend that the final data products that are used (e.g. things located in FinalSpectrumOutput) be an aggregation of o1 and o2. Then, create other products that break down order 1 and order 2 for people that want it. This would introduce nearly no changes to a users workflow.
  • The change to the user via python interface is that this: result = jdi.run_pandexo(exo_dict,['NIRISS SOSS']) would trigger both O1 and O2 (longer run time).
  • This tutorial would be changed to something like "Run only NIRISS order 1 or only order 2". It would explain that this forces "optimize" group to occur on either order 2, or order 1, and produce shorter run times (if users dont care about doing both).

@mfixstsci
Copy link
Contributor Author

mfixstsci commented Mar 29, 2024

@natashabatalha sounds good to me. I can make sure to remove the changes in run_online and just update jwst.py. I notice that the change I made to run_online would only produce the order two spectra and not both if we set the group to "optimize". I am thinking that we offer the ability to run 1, 2 , "both" to be more transparent with our users and whats going on under the hood. I was able to use the example you sent me and got everything up and running just fine for order 1. But now I am experiencing some issues with changing the order to 2

DataError: No mask configured for SOSS order 2.

{'telescope': 'jwst',
 'scene': [{'id': 1,
   'target': True,
   'position': {'ang_unit': 'arcsec', 'x_offset': 0.0, 'y_offset': 0.0},
   'shape': {'geometry': 'point'},
   'spectrum': {'extinction': {'bandpass': 'j',
     'law': 'mw_rv_31',
     'unit': 'mag',
     'value': 0.0},
    'normalization': {'type': 'none'},
    'sed': {'sed_type': 'input',
     'spectrum': array([[5.00010000e-01, 5.00160000e-01, 5.00310000e-01, ...,
             1.49900300e+01, 1.49944800e+01, 1.49989300e+01],
            [6.69523848e+02, 6.01890516e+02, 3.98278725e+02, ...,
             1.66916936e+01, 1.66826677e+01, 1.66644470e+01]])},
    'lines': []}}],
 'background_level': 'medium',
 'background': 'ecliptic',
 'calculation': {'effects': {'background': True,
   'ipc': True,
   'saturation': True},
  'noise': {'crs': True,
   'darkcurrent': True,
   'ffnoise': False,
   'readnoise': True,
   'rn_correlation': True}},
 'configuration': {'instrument': {'instrument': 'niriss',
   'mode': 'soss',
   'filter': 'clear',
   'aperture': 'soss',
   'disperser': 'gr700xd'},
  'detector': {'readout_pattern': 'nisrapid',
   'subarray': 'substrip96',
   'readmode': 'nisrapid',
   'ngroup': 2,
   'nint': 1,
   'nexp': 1}},
 'strategy': {'method': 'soss', 'order': 2, 'background_subtraction': False}}

Once we have both results, combining them should be easy to do from there.

@mfixstsci
Copy link
Contributor Author

@natashabatalha I was able to update the instrument dict and got order 2 working. I will let you know what comes from combining the spectra!

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.

None yet

2 participants