GithubHelp home page GithubHelp logo

spacetelescope / jwst_coronagraph_visibility Goto Github PK

View Code? Open in Web Editor NEW
8.0 12.0 10.0 12.55 MB

Visualize approximate pointing constraints for JWST coronagraphs.

Home Page: https://github.com/spacetelescope/jwst_visibility/blob/master/docs/index.rst

License: BSD 3-Clause "New" or "Revised" License

Python 99.83% Makefile 0.17%
jwst coronagraph simulator astronomy

jwst_coronagraph_visibility's Introduction

jwst_coronagraph_visibility: James Webb Space Telescope Coronagraph Visibility Tool

Current Release License Python DOI STScI SIAF version: PRDOPSSOC-027

The James Webb Space Telescope Coronagraph Visibility Tool (CVT) is a GUI-based target visibility tool for assessing target visibilities and available position angles versus time relative to MIRI[1] and NIRCam[2] coronagraphic masks. The CVT is available as a standalone gui-based python tool (AstroConda package) or as a macOS app bundle.

The allowed pointing of JWST leads to target visibility that depends on ecliptic latitude, and the range of roll angles allowed depends on solar elongation. The allowed position angles for a target can thus be a complicated function of time. As a result, it can be difficult to: (1) understand the possible orientations of a given target on the detector, especially in relation to any instrumental obscurations; (2) determine the ideal roll angle offsets for multi-roll observations; and (3) determine a group of targets that are simultaneously visible. The CVT was created to address these issues and assist in planning MIRI and NIRCam programs prior to entering targets and observations into the APT[3].

We stress that the CVT is designed to provide quick illustrations of the possible observable orientations for a given target. As such, the CVT rapidly approximates JWST’s pointing restrictions and does not query the official JWST Proposal Constraint Generator (PCG), nor include detailed pointing restrictions like Earth and Moon avoidance, etc. Therefore, CVT results should be treated as useful approximations that may differ from official APT constraints by a degree or so.

Documentation can be found online at JWST Coronagraph Visibility Tool Help.

Authors: Christopher Stark, Joseph Long, J. Brendan Hagan, Mees Fix and Bryony Nickson

Screenshot of the JWST Coronagraph Visibility Tool showing target HR 8799 with three companions plotted.

Installation for Users

Installing the Python Package

Installing with pip

CVT may be installed from the Python Package Index in the usual manner for Python packages.

$ pip install jwst_coronagraph_visibility 

Installing the macOS application

If you are running macOS and would like a double-clickable application, click on the following link:
Download for macOS (86.4 MB).

Simply extract the downloaded zip file to obtain the .app bundle, then double-click to run the JWST Coronagraph Visibility Tool.

Installation for Contributors

For those wishing to contribute to the code base, you can install jwst_coronagraph_visibility by cloning and installing the repository. This is only recommended for those looking to help with development. In general, those wishing only to use the jwst_coronagraph_visibility tool should install the latest stable version from using Astroconda, as described in the instructions above.

Prerequisites

It is highly recommended that contributors have a working installation of Miniconda or Anaconda for Python 3.6. Package requirements for contributing to jwst_coronagraph_visibility will be provided by a setup.py script included in the repository.

Clone the repository:

Clone the jwst_coronagraph_visibility GitHub repository as follows:

$ git clone https://github.com/brynickson/jwst_coronagraph_visibility.git
$ cd jwst_coronagraph_visibility

Environment Installation

Following the download of the jwst_coronagraph_visibility repository, create and activate a new jwst_coronagraph_visibility environment:

$ conda create -n jwst_coronagraph_visibility-3.7 python=3.7
$ conda activate jwst_coronagraph_visibility-3.7

Package installation

Next, you need to install the jwst_coronagraph_visibility package. This can be accomplished by running the setup.py script:

(jwst_coronagraph_visibility-3.7)$ python setup.py develop

The package should now appear if you run conda list jwst_coronagraph_visibility.

Citation

If you use the CVT for work/research presented in a publication (whether directly, or as a dependency to another package), please consider citing the Zenodo record using the DOI page above. Please find additional instructions in CITATION.

Software Contributions

Contributors should use a "forking workflow" when making contributions to the project.

Code of Conduct

Users and contributors to the jwst_coronagraph_visibility repository should adhere to the Code of Conduct. Any issues or violations pertaining to the Code of Conduct should be brought to the attention of a jwst_coronagraph_visibility team member or to [email protected].

Questions

For any questions about the jwst_coronagraph_visibility project or its software or documentation, please open an Issue.

Known Issues

  • The CVT does not (and will not) query the JWST Proposal Constraint Generator. The only constraint on the field of regard is the Sun and anti-Sun avoidance angle.
  • Target name resolution depends on the availability of the SIMBAD service. If the service cannot be reached, you will have to enter coordinates yourself.
  • The CVT does not currently provide a way to export the plotted points as text. Plots can be saved from the GUI using the save icon below the plot panel.
  • The CVT has only been tested on Mac and Linux. Issue reports from Windows users are welcome, and we will do our best to address them, but we are not testing the tool on Windows.

See issue tracker at https://github.com/spacetelescope/jwst_coronagraph_visibility/issues.

Current Development Team


Acronyms

[1] - Mid-Infrared Instrument (see documentation)
[2] - Near-Infrared Instrument (see documentation)
[3] - Astronomer's Proposal Tool (see documentation)

jwst_coronagraph_visibility's People

Contributors

brynickson avatar jbhagan avatar mfixstsci avatar pyup-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jwst_coronagraph_visibility's Issues

Controls for disk / extended sources

From @mperrin:

"Disk” option could let you specify a position angle, major, and minor axis for a disk, then draw it as an ellipse. (see for instance the extended source setup in the Pandeia ETC GUI.)

Start date missing?

Hello,

I have installed v0.3.0 via astroconda and am missing the Start Date option in the gui.

screen shot 2017-08-01 at 11 55 56 am

The tutorial for the CVT suggests that it should be possible to choose the start date, a pretty useful option (https://jwst-docs.stsci.edu/display/JPP/JWST+Coronagraphic+Visibility+Tool+Help). The tutorial was written for v0.1.0, so has the start date been removed from the tool or is there a way to ensure that I can choose what date to generate the visibilities from.

Thanks

Bug when plotting in python 2.7 environment

Per Julien Girard:

on my 2.7 environment, it opens fine, I can search a star but then it does not plot when I clicl “Update Plot”, it gets stuck with the spinning wheel.
There might still be an error related to Tk:
(testVIP2) polychromatic:Downloads jgirard$ jwst-coronagraph-visibility-gui /Users/jgirard/miniconda3/envs/testVIP2/lib/python2.7/site-packages/jwst_coronagraph_visibility/gui.py:778: MatplotlibDeprecationWarning: The FigureCanvasTk.show function was deprecated in version 2.2. Use FigureCanvasTk.draw instead. self._canvas.show() /Users/jgirard/miniconda3/envs/testVIP2/lib/python2.7/site-packages/jwst_coronagraph_visibility/gui.py:783: MatplotlibDeprecationWarning: The NavigationToolbar2TkAgg class was deprecated in version 2.2. self._toolbar = NavigationToolbar2TkAgg(self._canvas, frame)

possible bug or just confusion about rotation matrix in mask drawing

Question for you @kjbrooks (and possibly @josePhoenix if you have time to look at this, since you last touched this code.)

I'm looking at this part of the code, which implements the rotation mask for drawing masks on the coronagraphic FOV: https://github.com/spacetelescope/jwst_coronagraph_visibility/blob/master/jwst_coronagraph_visibility/gui.py#L1243
and wondering why the rotation matrix there seems wrong to me. It's coded as

cos sin
-sin cos

which has the signs of the sins flipped from what I expect. Is there some reason that's correct as-is?

That code further confuses me because the first line (line 1243, linked above) modifies the x_verts array, and then the that modified copy is what gets used in the second line. So it doesn't apply the rotation matrix correctly.

For context I encountered this while trying to hack in an implementation of the NIRSpec IFU FOV as a 3rd instrument. In that case with a roughly 45 degree rotation this code is definitely wrong and produces a skew rather than a rotation. I am guessing this is likely a bug in the MIRI code as well, and just has been overlooked until now because cos(4.5 degrees) is nearly 1. What do you think?

Initial Update

The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.

wish list: target and PSF star co-schedulability

APT will remain the authoritative tool for determining that a given PSF candidate can be scheduled at the same time as a science target. But an interesting and possibly useful variant on that calculation is looking at the change in sun pitch angle between the science target and a proposed PSF calibrator, and whether there are times of the year to observe that might minimize the potential for different thermal states of the observatory for the two observations.

Hence this suggestion:

  • have a second target resolver box (maybe at the bottom of the left panel) where the user can enter a PSF star.
  • If the user enters something in the PSF star box:
    • calculate and display (in the same manner as for the science target) the observability window of the PSF star, and the solar elongation for the PSF star
    • display the difference of the science target's and PSF star's solar elongations.

Add button to zoom to central region

From @mperrin:

One that would be pretty easy is having a button for ‘Update Plot (zoom in)’ which sets the xlim, ylim to show just the inner say 3x3 arcseconds for NIRCam. That’s where all the action is.

wish list: could this be bundled with APT and launched from within that?

Karla Peterson just suggested to me that it would be pretty cool if APT could have a button that would launch the CTVT, and possibly fill in the target coordinates etc. Neither of us have yet thought about the technical feasibility of this - I expect it could get pretty tricky to do that in a cross platform manner! So this is just an idea, and a suggestion for someone to perhaps talk to Karla eventually about this.

Change default start date

From @mperrin:

you might change the default start date. Oct 1 2018 is irrelevant for this since days after launch is not partcularly useful. Better to make it “day of the year” starting on Jan 1?

Display MIRI target acquisition location indicators

The MIRI target acquisition locations should be indicated on the detector plot.

TA spots in the SIAF:

In [1]: import jwxml

In [2]: miri = jwxml.SIAF('MIRI')

In [4]: [a for a in miri.apernames if any(map(lambda x: x in a, ('_UL', '_LL', '_UR', '_LR')))]
Out[4]:
['MIRIM_TA1550_UL',
 'MIRIM_TALYOT_UL',
 'MIRIM_TALYOT_LL',
 'MIRIM_TA1140_LL',
 'MIRIM_TA1065_UL',
 'MIRIM_TA1140_LR',
 'MIRIM_TA1550_UR',
 'MIRIM_TA1140_UL',
 'MIRIM_TA1065_LL',
 'MIRIM_TA1140_UR',
 'MIRIM_TA1550_LL',
 'MIRIM_TALYOT_UR',
 'MIRIM_TA1065_LR',
 'MIRIM_TA1550_LR',
 'MIRIM_TALYOT_LR',
 'MIRIM_TA1065_UR']

Mapping info:

On Jan 23, 2017, at 8:21 AM, Michael Robinson <[email protected]> wrote:

In the scripts the mapping is:
Quadrant 1: UR
Quadrant 2: UL
Quadrant 3: LL
Quadrant 4: LR

Issue with Application Menu Bar

When application is started, OSX users can't access the examples or python cascades in the menu bar unless they switch desktops or windows first. Here is a potential solution but users have to click the application first before being able to access the menu bar, control isn't given to the GUI when it first starts up.

https://developer.apple.com/forums/thread/125025

ImportError: cannot import name 'NavigationToolbar2TkAgg'

I cannot seem to run jwst-coronagraph-visibility-gui

I have tried installing on two (linux) systems using the astroconda

  • conda version: 4.6.7 and anaconda version 1.6.9 on system 1
  • conda version: 4.5.12 anaconda version: 1.7.2 on system 2
source activate astroconda
conda install jwst_coronagraph_visibility
jwst-coronagraph-visibility-gui &

Seems to be a problem importing NavigationToolbar2TkAgg from matplotlib.backends.backend_tkagg

version of matplotlib on both systems is 3.1.1, so I guess they have moved something since the last version of jwst_coronagraph_visibility was tested? (Note in matploliblib.backends.backend_tkagg they do have NavigationToolbar2Tk so maybe this is a simple fix?)

Full traceback is below:

>>   jwst-coronagraph-visibility-gui &
>>   Traceback (most recent call last):
  File "/scratch/bin/anaconda3/envs/astroconda/bin/jwst-coronagraph-visibility-gui", line 11, in <module>
    load_entry_point('jwst-coronagraph-visibility==0.3.0', 'gui_scripts', 'jwst-coronagraph-visibility-gui')()
  File "/scratch/bin/anaconda3/envs/astroconda/lib/python3.6/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/scratch/bin/anaconda3/envs/astroconda/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
    return ep.load()
  File "/scratch/bin/anaconda3/envs/astroconda/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2443, in load
    return self.resolve()
  File "/scratch/bin/anaconda3/envs/astroconda/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/scratch/bin/anaconda3/envs/astroconda/lib/python3.6/site-packages/jwst_coronagraph_visibility/gui.py", line 29, in <module>
    from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
ImportError: cannot import name 'NavigationToolbar2TkAgg'

System information

System 1:

NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

System 2

NAME="Ubuntu"
VERSION="18.04.3 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.3 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

Update which SIAF AperName to use for MIRI

We're using MIRIM_MASK1065 but David Law has added a MIRIM_CORON1065 aperture representing the clear aperture bounds (not including un-exposed pixels). This is what Dean Hines wants us to use so that users don't even see the misleading aperture that includes un-exposed pixels.

Problem with NavigationToolbar2TkAgg

I'm trying to run the tool when installing it through astroconda and I'm getting this traceback:

(astroconda) Linus:~ nluetzge$ Traceback (most recent call last):
  File "/anaconda3/envs/astroconda/bin/jwst-coronagraph-visibility-gui", line 11, in <module>
    load_entry_point('jwst-coronagraph-visibility==0.1.0', 'gui_scripts', 'jwst-coronagraph-visibility-gui')()
  File "/anaconda3/envs/astroconda/lib/python3.6/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/anaconda3/envs/astroconda/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
    return ep.load()
  File "/anaconda3/envs/astroconda/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2443, in load
    return self.resolve()
  File "/anaconda3/envs/astroconda/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/anaconda3/envs/astroconda/lib/python3.6/site-packages/jwst_coronagraph_visibility/gui.py", line 29, in <module>
    from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
ImportError: cannot import name 'NavigationToolbar2TkAgg'

Some googling told me that apparently NavigationToolbar2TkAgg has changed name to NavigationToolbar2QT could somebody fix this?

Cheers,
Nora

Initial Update

The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.

odd crash, apparently unicode-related.

Twice just now I've had the CTVT crash and die for no apparent reason. The crashes occurred once when I was clicking in the window to position the companion at a given roll angle, and once when I clicked on the 'zoom to fit' button.

The error traceback is pretty unhelpful:

> jwst-coronagraph-visibility-gui
Traceback (most recent call last):
  File "/Users/mperrin/software/miniconda3/envs/astroconda/bin/jwst-coronagraph-visibility-gui", line 11, in <module>
    load_entry_point('jwst-coronagraph-visibility==0.3.0', 'gui_scripts', 'jwst-coronagraph-visibility-gui')()
  File "/Users/mperrin/software/miniconda3/envs/astroconda/lib/python3.5/site-packages/jwst_coronagraph_visibility/gui.py", line 1257, in run
    app.start()
  File "/Users/mperrin/software/miniconda3/envs/astroconda/lib/python3.5/site-packages/jwst_coronagraph_visibility/gui.py", line 335, in start
    self.root.mainloop()
  File "/Users/mperrin/software/miniconda3/envs/astroconda/lib/python3.5/tkinter/__init__.py", line 1140, in mainloop
    self.tk.mainloop(n)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

This is on an iMac running Sierra, Python 3.5, tinter 0.3.1, with a pretty standard astroconda setup.

Update the help

Tyler Desjardins mentions that we should consider moving emails from help[at]stsci.edu to point to the web portal where possible and appropriate. For HST (or any non-JWST), it is https://hsthelp.stsci.edu . For JWST, it is https://jwsthelp.stsci.edu . Please update info in setup.py, setup.cfg, documentation, etc as appropriate.

Please close this issue if it is irrelevant to your repository. This is an automated issue. If this is opened in error, please let pllim know!

xref spacetelescope/hstcal#317

Support for moving objects

It would be useful to determine observability for moving objects using an ephemeris from JPL HORIZONS.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.