NuSTAR Python Solar Planning Routines

nustar_pysolar.planning.get_nustar_roll(time, angle)

Code to determine the NuSTAR roll angle for a given field-of-view on the Sun for a given time.

Parameters:
  • time (Date that is parsable by sunpy.time.parse_time()) –

  • i.e.

  • time='2016-07-26T19 (53:15.00') –

angle: Desired roll offset from solar north in degrees.

For a “square” field of view, use angle=0 / 90 / 180 / 270 to have DET0 at the NE / SE / SW / NW corners of a square field of view.

For a “diamond” with DET0 to the south, use angle = 45.

Returns:

nustar_roll

Return type:

NuSTAR PA angle with respect to celestial north.

nustar_pysolar.planning.get_sky_position(time, offset)

Code for converting solar offsets to pointing position.

Parameters:
  • time (Date that is parsable by sunpy.time.parse_time()) –

  • i.e.

:param : :param time=’2016-07-26T19: :type time=’2016-07-26T19: 53:15.00’ :param offset: :type offset: Offset from the center of the Sun. Must have units from astropy: :param i.e.: :type i.e.: offset = np.array([1000, 150]) * u.arcsec

Returns:

sky_position

Return type:

Two-element array giving the [RA, Dec] coordinates of the

Notes

Syntax:

sky_position = get_sky_position(time, offset)

nustar_pysolar.planning.get_skyfield_position(time, offset, load_path=None, parallax_correction=False)

Code for converting solar coordinates to astrometric (J200) RA/Dec coordinates.

Parameters:
  • time (Date that is parsable by sunpy.time.parse_time()) –

  • i.e.

:param : :param time=’2016-07-26T19: :type time=’2016-07-26T19: 53:15.00’ :param offset: :type offset: Offset from the center of the Sun. Must have units from astropy: :param i.e.: :type i.e.: offset = np.array([1000, 150]) * u.arcsec

load_path (optional): Relative path from currently location to store bsp files

parallax_correction: Use the NuSTAR TLE to correct for orbital parallax

Returns:

  • sky_position (Two-element array giving the [RA, Dec] coordinates of the)

  • target location. Note this is given in astrometric (J2000) RA/Dec, which is what

  • we need for the NuSTAR planning system.

Notes

Syntax:

skyfield_position = get_skyfield_position(time, offset)

nustar_pysolar.planning.make_mosaic(orbit, outfile='mosaic.txt', write_output=False, make_regions=False, reg_pref='testbox', extra_roll=<Quantity 0. deg>, write_sun=False)

Code to make a mosaic for a 5x5 tiled array on the Sun.

Input:

tstart = ‘2018-05-28T15:37:00’ tend = ‘2018-05-28T23:10:00’

positions = make_mosaic(tstart, tend, write_output=True)

Optional flags:

write_output = [False] / True

Write the output pointing positions in NuSTAR SOC readable formats in ‘outfile’ for all of the pointings.

outfile = [‘mosaic.txt’]

Output file if write_output is used.

make_regions: [False] / True

Make ds9 region files for each tile so that you can see how the FoV moves with each mosaic location.

reg_pref: ‘testbox’

The prefix for the region files. Useful if you want to make this meaningful.

Output mosaic file has columns of: “Arrive By Time” RA DEC RA_SUN DEC_SUN

nustar_pysolar.planning.make_test_region(boxra, boxdec, boxpa, sunra, sundec, sunpa, outname='testbox.reg')

Code to produce a ds9 region file showing the Sun and the FoV on the sky.

Inputs:

boxra, boxdec: These are the center of the FoV. Must have astropy units. boxpa: This is the SKY PA angle. Must have astropy units.

sunra, sundec: The center of the Sun. sunpa: The solar north pole angle

outname: the name of the region file that you want to produce. Defaults to ‘tetsbox.reg’

The output is a ds9 region file. Go into ds9, enter the Sun ra/dec coordinates and load an optical stellar background field (under the ‘Analysis’ tab), then load the region file to see what’s going on.

nustar_pysolar.planning.parse_occultations(infile)

Parse the shadow analysis file to determine the ‘in Sun’ times.

Parameters:

infile (Input file to be parsed.) –

Returns:

  • Returns a list of [ [start, stop], [start stop] ] times where start means

  • you egress from Earth shadow into the sunlight, while stop means you

  • re-enter Earth shadow.

Notes

nustar_pysolar.planning.sunlight_periods(infile, tstart, tend)

Return the periods when NuSTAR is in Sunlight in the given timerange.

Parameters:
  • tstart (ISO formatted times or something else that) –

  • tend (ISO formatted times or something else that) –

  • read. (sunpy.time.parse_time() can) –

  • i.e.

  • tstart='2017-03-11T23 (09:10') –

  • infile (Input file to be parsed. This should the value returned by) –

  • nustar_pysolar.download_occultation_times()

Returns:

  • Returns a list of [ [start, stop], [start stop] ] times where start means

  • you egress from Earth shadow into the sunlight, while stop means you

  • re-enter Earth shadow.

  • The list has been filtered to only include those epochs that span the given

  • time range.

Notes