TIDE Processing Software Source Code File Summary

TIDE Home Page | Documentation Menu | Processing Software Menu

C Source Code File

cdf_scpot_data.c - contains the functions used to read or write CDF files, to read spacecraft potential files, and to create papco input files.
1.  create_h0_cdf
creates a CDF file containing TIDE moments and high time resolution spectrogram data.
2.  create_papco_input
created the original TIDE PAPCO text file containing moments and high time resolution plot data. The file is no longer used, replaced by H0 and H1 CDF files.
3.  get_mfe_bfld_data
reads BX, BY, and BZ in spacecraft coordinates from the MFE high time resolution text file.
4.  get_oa_data
reads orbit/attitude CDF files and extract the information necessary to calculate the velocity coordinate transformations.
5.  get_orbit_data
saves the orbit tickmark labels that appear at the bottom of the spectrogram, chromogram, and moments plots.
6.  save_full_orbit
reads the daily orbit files and extracts a full orbit for use on spectrogram and velocity distribution plots
7.  get_scpot_data
reads the spacecraft potentials extracted from EFI key parameter data (data stored in month-long text files)
8.  is_between
checks to see if time1 is between time2 and time3
9.  compare_time_to
compares time1 to time2, if time1 < time2 returns a -1, if time1 > time2 returns a 1, else returns a 0
10.  time_diff
calculates the time in millisecs from time1 to time2
11.  vgse_to_vgsm
converts velocity in GSE to GSM
12.  vgsm_to_vgse
converts velocity in GSM to GSE
find_fit_width.c - calculates the width of the spin data in order to estimate the width of the distribution in the polar direction.
find_spneng_peaks.c - contains functions used to find peaks in the spin and energy curves
1.  find_spin_peaks
finds the absolute peak of the spin curve and finds each local peak and its e-level
2.  find_energy_peaks_sp
for stops, finds the absolute peak of the energy curve and finds each local peak and its e-level
3.  find_energy_peaks_ion
for ions, finds the absolute peak of the energy curve and finds each local peak and its e-level
4.  find_width_spn
finds width of spin peak
5.  find_width_eng_sp
for stops, finds width of energy peak
6.  find_width_eng_ion
for ions, finds width of energy peak
gaussian_curfit.c - contains functions used to perform a Gaussian curve fit when estimating polar distribution of Stops data, software based on code in Bevington
1.  gaussian_func
2.  gaussian_curfit
3.  gaussion_deriv
4.  fchisq - evaluates reduced chi-square for fit to data
get_dp.c - contains functions used to process TIDE data product data
1.  create_ion_mask
creates an ion mask as the average of all counts from an instrument background check
2.  get_instr_parms
fills in the instrument parameter data product structure
3.  log_singles
converts calibration mode singles event data from 8-bit to 16-bit integers, logs the results, and saves the results for plotting
4.  move_sing_bytes
puts the singles event 8-bit words into their correct array locations
5.  prnt_instr_parms
prints the content of the current instrument parameter data structure
6.  save_ion_cnts
saves ion count rates for selected masses and times in a large text file, one file/channel or it saves Stops whenever the mirror changes
7.  save_mass_avg
averages ion count rates over energy, spin angle, or both and saves them as a function of time or l-shell
8.  save_mass_sum
sums counts over energy and spin for a user-specified time range
9.  save_masses
un-collapses the data products containing ion count rates
get_lz.c - contains the functions used to read and process TIDE level-zero data records
1.  get_file_label
reads and processes the first record, the file label record, in a level-zero data file
2.  get_lz_rec
reads a level-zero record
3.  get_mf
gets housekeeping and major frame bytes from a level-zero record
get_spins.c - contains the functions used to process TIDE spin data
1.  calc_temp
converts TIDE housekeeping bytes to temperatures using one of three 5th degree polynomials
2.  get_dp_packet
gets and processes the next data product
3.  get_spins
the main function used to get and process TIDE spin packets
4.  get_spin_header
gets the next spin header
5.  get_spin_time
calculates the time in millisecs at the end of the spin accumulation period and sets up the various time/date labels
6.  hk_conv
fills in the housekeeping structure by bit-busting the status bytes and by converting bytes to corresponding floating point values
7.  hk_print
creates a text display of TIDE engineering data
8.  save_db_spin_stru
saves spin information in the database parameter structure
9.  save_de_spect
saves the direct-event color spectrograms in a plot input file
10.  save_moments
saves centroid moments and efficiency numbers found in the spin header and associated mass and instrument parameter data
11.  set_labels
determines the ion species and RPA voltage labels used by the TIDE plot routines
init_processing.c - contains functions used to set up TIDE level-zero processing and initial variables
1.  calc_sector_sens
either reads sector sensitivity correction values from a file or it calculates them based on day-of-year and sector number
2.  init_hk
initializes the housekeeping data structure
3.  init_ip
initializes instrument parameter data structure
4.  init_masses
initializes ion count (masses) array
5.  init_plt_prm
initializes the plot parameter data structure
6.  init_processing
sets up initial variables, structures, and output files based on the content of the parameter file
7.  init_spin
initializes the spin header structure
8.  init_sums
zeroes the summing arrays
9.  read_mask_file
reads the IEEE floating point binary mask file. If the system is not IEEE, the bytes are swapped
10.  read_mass_desc
reads the mass description file and puts it into a data structure
11.  process_data
starts and controls the processing of TIDE level-zero data
12.  putline
prints error messages and user information either to the screen or into a file, depending on the system used
13.  set_output
determines and opens output files based on the content of the level-zero processing parameter file
14.  set_stops
modifies the Stops m/q, amu, and label used in moments and phase space density calculations
lz_parm.c - driver program used to create or modify a TIDE level-zero processing parameter file - lz_parm
mass_conv.c - contains functions used to change mass units, correct masses, calculate moments, and convert coordinate systems
1.  calc_flux
calculates mirror ratio calibration data, corrects ion counts, and converts counts to user-specified flux units
2.  calc_flux_sub_min
subtracts the minimum count, calculates mirror ratio calibration data, corrects ion counts, and converts counts to user-specified flux units
3.  calc_polar_az_trig_func
calculates the cosines and sines of the polar angle bins for use in calculating moments
4.  change_units
converts the ion count array (masses) from ion counts to hertz
5.  change_units_sub_min
subtracts the minimum ion count in each spin before converting to hertz
6.  find_peaks
collapses the masses array in order to find the peaks in the energy and spin angle curves
7.  get_next_range
reads the next set of caclulation ranges from the .pk_rng file
8.  get_tide_psi_mode
calculates the TIDE/PSI status integer that goes in the moments database
9.  mask_sub_min
subtracts the minimum count from the background mask
10.  moments_calc
calculates and saves plasma density, velocity, and temperature (moments) data
11.  read_calibration
reads tide_calib.vn
12.  use_peak_info
reads the .peaks file to determine what limits to use for each moments calculation
13.  get_spin_bins_to_use
gets range of spin angle bins used in moments calculation when tracking the b-field
14.  save_psd_vs_vel
saves phase space density as a function of velocity for data parallel to the magnetic field
matinv.c - when estimating the polar angle distribution in Stops, inverts a symmetric matrix and calculates its determinate
process_mass.c - contains functions used to process TIDE science mode mass data (collapse options 0 - 5)
1.  chromo_energy
calculates and saves the TIDE chromogram based on RPA voltage
2.  chromo_polar
calculates and saves the TIDE chromogram based on polar angle
3.  chromo_spin
calculates and saves the TIDE chromogram based on spin angle
4.  chromo_energy_24bit
calculates and saves the TIDE chromogram based on RPA voltage using 24-bit color
5.  chromo_polar_24bit
calculates and saves the TIDE chromogram based on polar angle using 24-bit color
6.  chromo_spin_24bit
calculates and saves the TIDE chromogram based on spin angle using 24-bit color
7.  create_image
controls the creation of a spin-averaged image and saves the image in a plot file
8.  find_ram
uses spacecraft velocity (gse) and declination and right ascension to calculate spacecraft velocity in a fixed coordinate system
9.  flight_calibration
calculates the ion count sum over spin angle for each energy and polar angle when the mirror ratio steps down
10.  htr_rotated_ions
fills in high time resolution images with missing data caused by rotated ions
11.  process_masses
handles the processing of mass data
12.  psd_distribution
converts the masses array to phase space density (psd) velocity distribution images parallel and prependicular to the magnetic field
13.  shift_spin_bins
rotates the spin bins up two in order to corrected a shift in the TIDE data from 06/14/96 (166) to 02/14/97 (45) plus twice in 1999
14.  spect_data
saves data required by the mass spectrogram plot routines
15.  what_mass
sets a flag in mss_reprtd to indicate that data for a mass was received
process_parm.c - contains functions used to create the TIDE level-zero processing parameter file.
1.  chromo_option
determines the plot parameters used in the TIDE chromogram plot routines
2.  flux_units
determines the ion count output units and the range of data values that will be used in data files and displays
3.  get_process_parm
prompts the user for information necessary to determine the main TIDE level-zero processing options
4.  init_pint
initializes the processing option structure
5.  papco_option
sets up the processing require to create the input for TIDE high time resolution CDF (H0 and H1) files
6.  psd_vs_vel_opt
sets up the processing require to create plots of phase space density as a function of velocity parallel to the magnetic field
7.  spect_option
determines the plot parameters used to create TIDE spectrogram plots
8.  vel_dist_opt
determines the plot parameters needed to create velocity distribution plots and text files
ricedcmp.c - Software provided by SWRI to decompress data products that were Rice-compressed by TIDE on-board processor
1.  get_bit
2.  get_multi_bits
3.  rice_decomp
4.  get_xpctd_sz
5.  dcompnocode
6.  dcompfs
7.  dcompcfs
8.  dcompcfs_bar
9.  dcomphigh
10.  dcomplow
11.  dcompress
tide_lz_main.c - the main tide_lz routine, called from IDL, contains software change history

Header Files

tide_lz_def.h - contains the global variables definitions used to process TIDE level-zero data
tide_lz_func.h - lists tide_lz functions by source code file
tide_lz_glob.h - list and description of all tide_lz global variables.
tide_lz_parm.h - external variable definitions
tide_lz_stru_def.h - global structure definitions
tide_lz_stru_ext.h - external structure definitions
tide_lz_stru_glb.h - structure variable names

make files

Makefile - makefile used to compile tide_lz - command is simply make
Mparm - makefile used to compile lz_parm - command is make -f Mparm

CDF Library Code (version 3.5)

cdf.h - libcdf.a header file
libcdf.a - CDF source library

IDL Plot Procedures

Main TIDE plot procedures:
run_tide.pro - main IDL command file
tide_lz_call.pro - calls tide_lz
tide_lz_prompt.pro - set up input to tide_lz and calls plot routines when tide_lz is finished
Chromogram Plot:
chromo_24bit.pro - creates 24-bit chromogram plots
chromo_226color.pro - creates 8-bit chromogram plots
chromo_summary.pro - main procedure for plotting chromograms
graybar.pro - draws grayscale colorbar on chromogram plots (8-bit, 226 colors)
graybar_24bit.pro - draws grayscale colorbar on chromogram plots (24-bit, true color)
load_color_cg.pro - creates 8-bit chromogram color table
rgb_wheel - draws and labels the 8-bit chromogram color wheel
rgb_wheel.24bit - file containing the 24-bit chromorgram color wheel
rgb_wheel_24bit.pro - draws and labels the 24-bit chromogram color wheel
Housekeeping Summary Plots:
daily_de_spect.pro - plots direct-event spectrogram plots
daily_mass_avg.pro - plots average count rate strip charts
daily_psi_eng.pro - plots PSI engineering (housekeeping) data
daily_summary.pro - main routine used to create daily housekeeping plots
daily_tide_eng.pro - plots TIDE engineering (housekeeping) data
Spectrogram Plots:
color_bar.pro - draws colorbar on spectrogram plots
esse_spect.pro - creates energy/spin spin/energy plots with orbit plots
esse_summary.pro - creates energy/spin spin/energy plots with orbit labels
htr_spect.pro - creates high time resolution (single variable) spectrogram plots
load_color.pro - reads and loads spectrogram color table
plot_gsm_orbit.pro - plots orbit on esse plots
spect_summary.pro - plots two variable spectrogram plots
Moments Plots:
moments_summary.pro - main moments plot routine - reads moments file, sets up and labels plot
plot_density.pro - plots the density panel on the moments plot
plot_temperature.pro - plots the temperature panel on the moments plot
plot_velocity.pro - plots the velocity panel on the moments plot
Phase Space Density Velocity Distribution Plots: load_color.pro - reads and loads color table
psd_summary.pro - main program use to control velocity distribution phase space density plots
vel_dist_2_planes - creates velocity distribution plots for two adjacent planes
vel_dist_movie - creates velocity distribution plots with one plane and orbit information
vel_dist_perp_para - creates velocity distribution plots for two planes, one parallel and one perpendicular to the magnetic field plane
vel_dist_survey - creates multi-panelled velocity distribution plots
Phase Space Density (PSD) versus Velocity Plots
plot_psd_vs_vel.pro - creates PSD versus velocity plots.
Spectrogram and Velocity Distribution Color Tables
bcgyr.tbl - blue, cyan, green, yellow, red (default)
black_white.tbl - grayscale black to white
white_black.tbl - grayscale white to black
bbgopw.tbl - black, blue, green, orange, pink, white
broyw.tbl - black, red, orange, yellow, white

Miscellaneous Files

mass_calib.v8 - mass description table - tof bin ranges for all masses used and the mass fraction table used in calibration
po_h0_tid_00000000_v03.cdf - dummy TIDE h0 CDF file, copied when creating a new ions (H+, O+, He+) CDF file
po_h1_tid_00000000_v02.cdf - dummy TIDE h1 CDF file, copied when creating a new Total Ion (Stops) CDF file
run_tide.input - tide_lz input file template
sector_sens.v3 - sector sensitivity values
software.version.history - a brief list of changes made to tide_lz, taken from comments at the top of tide_lz_main.c
t000000_v0.mask - dummy mask file - contains all zeros so no background data is subtracted
tide_calib.v6 - calibration table - contains geometric factors and E/Vrpa for ions and total ions


TIDE Home Page | Documentation Menu | Processing Software Menu

Last Updated:  August 2008

NASA Web Privacy Policy