Ulysses HISCALE Data Analysis Handbook
Appendix 16. LAN PHA Documentation (continued)
A16.4 Processing
This section describes the processing performed by the program PHAGEN. The main tasks for PHAGEN are:
- Setup
- Read and select appropriate LAN archive data to process
- Accumulate, normalize and write track data
- Accumulate, normalize and write pulse matrices
- Accumulate, normalize and write MFSA spectra
Each main task process is described with a narrative of the process and a list of pertinent software modules. The process flow for PHAGEN is on the following page (Figure A16-2). Software listings are included in Section A16.7.
Figure A16-2 PHAGEN process flow
Setup for program PHAGEN involves acquiring the run time control parameters from the user, opening output data files, and reading the PHA map and channel map files.
The control parameters include time bounds for the run, the average intervals for pulse, MFSA and track data, and output destination (routines get_phagen_inputs, get_lan_timebounds). The time bounds for the run are converted into absolute seconds (i.e., seconds since Jan. 1, 1959 00:00 UT). The average intervals are also converted to seconds making the time bracketing straightforward (routines timetosec, sectotime). If output is to disk, PHAGEN will construct file names for the three output files and create these files (routines new_rates_file, new_pulse_file, new_mfsa_file, open_lanfile). Finally, the species energy map and channel map are opened, read, and closed (routines get_pha_map, get_channel_map). The species energy map file must be loaded for the track accumulation process. The channel map file is needed for the pulse normalization process.
A16.4.2 Read and Selection of LAN Archive Records
The LAN archive file is accessed using time bounds and record type criteria (routines get_next_record, read_archive, read_lanfile). Specifically, only those archive records labeled as PHAR or MSFA which contain time within the user specified time bounds are selected for processing. All other record types and times are skipped. Archive records with times partially contained within the time bounds are appropriately partially processed.
The pulse and track software use the time of each event to determine inclusion of the event into the current accumulations. The MFSA software uses the time of each MFSA archive record to determine inclusion of the spectra into the current accumulations. All times are converted to absolute seconds for testing (routines timetosec, sectotime).
The processing for the track data set involves accumulations of counts and times for multiple ion species, energy bins, instrument channels, and sector locations, normalizing the counts over the track average period, and writing the resultant count rates to the track output file.
The track data set is composed of normalized count rates for individual species, energy bins for either 8 sectors (H, He3, 4) or spin totals (all other species). During the accumulation process, however, the software retains the full sector resolution for all ion species. With minor modifications, a version of PHAGEN could produce sectored data for all species.
Figure A16-3 LAN PHA generator PHAGEN, top level process flow
The track data set is composed of count rates (R) normalized using one or more wart rate channels (ch) for species (sp), energy (bin) and sector (sec) of the form:
and
- ch is the channel number representing wart channels W1-W8.
- track_bins(sp,bin,ch,sec) is the count of PHA events identified as belonging to species sp, energy bin, channel ch, and sector sec for the current track average interval.
- events(ch,sec) is the total count of PHA events for channel ch and sector sec for the current track average interval.
- counts(ch,sec) is the total particle count for channel ch and sector sec for the current average interval. This quantity is calculated using the time synchronous rate channel data (W1-W8), the duty cycle and sector accumulation times contained in the PHA archive records. Specifically, for those records r contained in the average interval:
where
- r is the record number.
- N is the total number of records contained (completely or partially) in the current track average interval.
- wart(sec,ch) is the time synchronous count rate for sector sec and channel ch.
- t8(sec) is the accumulation time in seconds for sector sec.
- fa8(sec,ch) is the duty cycle fraction for sector sec and channel ch.
- f is the fraction (0<f=1) of record r contained within the current track average interval.
track_times(ch,sec) is the total accumulation time for channel ch and sector sec. Similar to counts (ch,sec) described above, for all records r contained in the current track average interval:
The top level routine for the track processing controls the accumulation of PHA events and rate channel counts and times (routine process_events). This routine will initialize the track and pulse files (if needed); accumulate all events from the current input archive record containing event times within the current average interval; accumulate rate channel counts and times for the portion of the current archive record contained within the current average interval. When an event time greater than the current average interval end time is encountered, the track counts and pulse counts are normalized, written, and reset (routines finish_rates, finish_pha).
The accumulation for components counts and track_times is performed by routine accum_channel_counts. The routine is called once per archive record for all records contained within the current track average interval. Input to accum_channel_counts is the fraction f (0<f<=1) of the archive record contained within the average interval.
The accumulation of events and track_bins is performed by routine process_events. The routine is called once per archive record and all events in the record are processed. Each event contained within the current average interval is mapped using the [delta E,E] event data and the species energy map into a particular species and bin. The appropriate counters are then incremented. Undefined events are mapped into species 0, bin 0. At this level, full sector resolution is retained for all species. Note that time bracketing for the average interval is performed on the event level.
The normalization of the track rates is performed by routine norm_rates. The pseudo rate R is computed along with sector summation (sector 0). Undefined events are also assembled for output.
The track data set is written by routine write_rates. The common LAN header block is set up with snapshots of the beginning and ending average times. The output record is assembled from the various accumulators and written to the output track file (routine write_lanfile).
All accumulators for the track data are reset after each output record is written (routine reset_rates).
Figure A16-4 Process_events flow diagram
Next: A16.4 continued
Return to Appendix 16 Table of Contents
Return to HISCALE List of Appendices
Return to Ulysses HISCALE Data Analysis Handbook Table of Contents
Updated 8/8/19, Cameron Crane
QUICK FACTS
Mission End Date: June 30, 2009
Destination: The inner heliosphere of the sun away from the ecliptic plane
Orbit: Elliptical orbit transversing the polar regions of the sun outside of the ecliptic plane