Info Class

class nustar_gen.info.NuSTAR

Class for holding constant attributes about NuSTAR and for time conversion from MET to ‘TIME’ objects and back again

property launch

Returns the launch date

met_to_time(met)

Assumes unitless MET seconds input.

Parameters:

met (float) – Unitless NuSTAR MET seconds.

Examples

>>> ns = NuSTAR()
>>> met = 315578085.0
>>> time = ns.met_to_time(met)
>>> print(time.fits)
2020-01-01T12:34:42.000
property pixel

Returns the size of a sky pixel (2.54 arcsec)

property pixel_um

Returns the physical size of a NuSTAR sub-pixel (raw_pixel / 5)

rate_conversion(rate, incident=False)

Converts observed counts per second into an incident rate

Parameters:
  • rate (float) – Unitless NuSTAR MET seconds.

  • incident (boolean, optional, False) – If False, converts between measured and incident rates If True, converts between incident and measured rates.

Returns:

rate – Measured/incident rate if the incident parameters is False/True

Return type:

float

property ref_epoch

Returns MET time reference epoch (Jan 1, 2010, UTC)

property tick

Returns the clock resolution, nominally 16 samples at 14.7456 Mhz

time_to_met(time)

Convert a Time object to a unitless NuSTAR MET second. Note that the time scale for MET seconds is always ‘TT’ seconds.

Parameters:

time (Astropy Time object) – The time or array of times that you want to convert to MET.

Returns:

met – Seconds since Jan 1, 2010 UTC in TT seconds.

Return type:

float

Examples

>>> ns = NuSTAR()
>>> time = Time('2020-01-01T12:34:42', format = 'fits', scale = 'utc')
>>> met = ns.time_to_met(time)
>>> print(met)
315578085.0

Observation Class

class nustar_gen.info.Observation(path='./', seqid=False, evdir=False, out_path=False)

Class for storing meta-data about a given NuSTAR observation.

Parameters:
  • path (str, optional, default './') – The top-level working directory. All paths are assumed to be relative to this location. This should be one level above the sequence ID location.

  • seqid (str) – The sequence id for the observation

  • evdir (str, optional, default obs.datapath+'event_cl') – Full path to the directory containing the event files

  • out_path (str, optional, default is the obs.evdir) – Full path to the desired output location

download_bgd_report()

Wrappers to download the background report from the SOC:

property evdir

Returns the event file directory

property exposure

Returns an dict (with ‘A’ and ‘B’ as keys) with lists of exposures for all event files.

exposure_report()

Make the output report on the exposure for various observation types

property observation_date

Returns the date of the observation parsed from the file headers

property out_path

Returns the output path.

property path

Returns the top-level path

property science_files

Returns a list of science (01) event files

property seqid

Returns the current sequence ID

set_outpath(value)

Set the output path.

set_path(path)

Sets the path. Makes sure that path ends with a ‘/’

property source_position

Returns the current source RA/Dec from the FITS headers as Astropy SkyCoord object