Skip to content

ayshih/nustar_pysolar

 
 

Repository files navigation

NuSTAR Solar Python Repo

Overview:

This is currently work in progress. If you encounter issues, let us know.

This repo contains scripts for converting NuSTAR solar observations to usable heliocentric coordinates.

This branch uses python-based code rather than IDL scripts so that we can take advantage of the wonderful open source developments in astropy and sunpy.

All python scripts shown here are written for python 3.5.

Library Requirements (at minimum, and with their dependencies): astopy numpy sunpy wget

We recommend using Anaconda for installation of astropy/numpy/everything else via conda.

See the sunpy documenation for details of how to install sunpy via conda.

See Iain Hannah's overview figures for the solar observations (made using SSWIDL) here.

Interested in helping out or adding code? Feedback is great, report any problems via issues_ page.

If you have code you might want to contribute, get in touch with me to join the Slack group and/or issue a pull request.

Contents:

Installation:

python setup via conda

If you already have a python-3.5 environment that includes astropy and sunpy then you can skip down to the Install nustar_pysolar step below.

If you don't already have a python environment with astropy and sunpy, do the following:

This will install a new python installation on your system so that you don't have to worry about overwriting or conflicting with any other existing python builds.

  • From the command prompt, issue the following conda commands to make sure that we're using python 3-5 and that we have the conda-forge channel installed (for sunpy):

conda install python=3.5

conda config --add channels conda-forge

Install nustar_pysolar

Clone the project from github:

git clone https://github.com/NuSTAR/nustar_pysolar.git

Install dependencies:

From the nustar_pysolar directory, issue the following conda command to install the modules that we'll need:

conda install --yes --file requirements.txt

Note that this may take a few minutes to complete.

Install nustar_pysolar:

python setup.py install

Build the documentation:

sphinx-build docs/ docs/_build

...there is now an autogenerated webpage at nustar_pysolar/docs/_build/index.html that describes nustar_pysolar.

Notebooks

We've provided several jupyter notebooks that demonstrates how to convert the NuSTAR solar data into heliocentric coordinates and data formats that align with Sunpy.

To install jupyter, use conda:

conda install jupyter

Then from the command line, do:

jupyter notebook

This will open a page in your webbrowser that shows the current file structure. Navigate to the notebooks directory and open one of the files in an ".ipynb" suffix.

This series of notebooks should result in you have a sunpy-style map object that can then be combined with other sunpy objects (AIA, etc) for making pretty pictures.

The proper order is:

  1. Observation Report
  2. Convert Example
  3. Map Example

We also have provided an example notebook for how to plan a NuSTAR solar observation

  1. Planning exmaple

How to get NuSTAR solar data

You can search the NuSTAR table at the HEASARC, using SOL in the obs_type search bar to locate all of the NuSTAR solar observations. Any data that are public can be downloaded and reprocessed for solar work.

If you have data that you'd like to see that aren't public let, let me know.

About

Python scripts for NuSTAR Solar analysis

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 66.6%
  • Python 30.5%
  • Shell 1.6%
  • Prolog 1.3%