This page was created by the IDL library routine `mk_html_help2`.

Last modified: Tue Aug 5 18:17:40 2025.

# Directory Listing of Routines

# general/missions/rbsp/efw/rbsp_phasef/misc

- AARON_FIG_6_1
- CALC_ECORO
- CALC_EVXB
- FIG_4_2_TIMELINE
- FIG_6_1
- FIG_SAMPLE_RATE_FILTER_TIME_LAG
- FINAL_PAPER_SDT_PLOT
- GEN_YEARLY_BOOM_FLAG
- PATCH_FOR_L1_TIME_TAG_CORRECTION
- PATCH_FOR_L1_TIME_TAG_OF_LEAP_SECOND
- PATCH_ORBIT_NUM_FOR_L4
- PERIGEE_CORRECTION_PLOT1
- PLOT_EMFISIS_CORRECTION
- PLOT_FIX_SPICE_UVW2GSE
- PLOT_L1_TIME_TAG_CORRECTION
- PLOT_UVW2GSE_CORRECTION
- RBSP_EFW_PHASEF_FIX_L4_BFIELD
- RBSP_EFW_PHASEF_FIX_L4_LABEL
- RBSP_EFW_PHASEF_FIX_LABELING_FOR_L2_ESVY_DESPUN
- RBSP_EFW_PHASEF_GEN_L2_ESVY_DESPUN
- RBSP_EFW_PHASEF_GET_SERVER[2]
- RBSP_EFW_PHASEF_LOCAL_ROOT
- RBSP_EFW_PHASEF_READ_B_MGSE[2]
- RBSP_EFW_PHASEF_READ_R_MGSE
- RBSP_EFW_PHASEF_READ_V_MGSE
- RBSP_EFW_PHASEF_SCAN_VB1_SPLIT_DATA_RATE
- RBSP_EFW_PHASEF_SPICE_VAR_ADD_LABELING
- RBSP_EFW_READ_L1_TIME_TAG_CORRECTION[2]
- RBSP_EFW_READ_L1_TIME_TAG_CORRECTION_GEN_FILE
- RBSP_FIX_B_UVW
- RBSP_FIX_Q_UVW2GSE
- RBSP_PHASEF_FIT_PER_MANEUVER
- RBSP_PHASEF_LOAD_FIT_QUANTITIES
- RBSP_PHASEF_READ_FIT_COEF_V01
- RBSP_PHASEF_READ_FIT_COEF_V02
- RBSP_PHASEF_READ_FIT_TIMES
- RBSP_REMOVE_SPINTONE
- SAVE_RBSP_SDT_TIME_RANGES
- SCAN_FOR_TIME_TAG_IRREGULARITY
- TPLOT_EFIELD
- WYGANT_ADD_E_COMBO_TO_YEARLY_FILES
- WYGANT_GEN_YEARLY_FILES

# Routine Descriptions

## AARON_FIG_6_1

[Next Routine] [List of Routines]

     Generate Fig 6.1 for Aaron for the instrument paper.

(See general/missions/rbsp/efw/rbsp_phasef/misc/aaron_fig_6_1.pro)

## CALC_ECORO

[Previous Routine] [Next Routine] [List of Routines]

     Calculate the E_coro from r_coord and b_coord.
     They need to be in the same coord.

     b_var=.
     r_var=.
     save_to=.
     probe=.

(See general/missions/rbsp/efw/rbsp_phasef/misc/calc_ecoro.pro)

## CALC_EVXB

[Previous Routine] [Next Routine] [List of Routines]

     Calculate the E_vxb due to Vsc x B.
     They need to be in the same coord.

     b_var=.
     v_var=.
     r_var=.
     save_to=.
     probe=.

(See general/missions/rbsp/efw/rbsp_phasef/misc/calc_evxb.pro)

## FIG_4_2_TIMELINE

[Previous Routine] [Next Routine] [List of Routines]

     Plot the data timeline.

     Adopted from EFW_dataproduct_timeline.py.

(See general/missions/rbsp/efw/rbsp_phasef/misc/fig_4_2_timeline.pro)

## FIG_6_1

[Previous Routine] [Next Routine] [List of Routines]

     Generate Fig 6.1 for Aaron for the instrument paper.

(See general/missions/rbsp/efw/rbsp_phasef/misc/fig_6_1.pro)

## FIG_SAMPLE_RATE_FILTER_TIME_LAG

[Previous Routine] [Next Routine] [List of Routines]

     Plot the sampling rate dependent time tag offset and the expected time lag due to the anti-aliasing filter

(See general/missions/rbsp/efw/rbsp_phasef/misc/fig_sample_rate_filter_time_lag.pro)

## FINAL_PAPER_SDT_PLOT

[Previous Routine] [Next Routine] [List of Routines]

     Draw an example of SDT.

(See general/missions/rbsp/efw/rbsp_phasef/misc/final_paper_sdt_plot.pro)

## GEN_YEARLY_BOOM_FLAG

[Previous Routine] [Next Routine] [List of Routines]

     Generate yearly boom flag CDF.

(See general/missions/rbsp/efw/rbsp_phasef/misc/gen_yearly_boom_flag.pro)

## PATCH_FOR_L1_TIME_TAG_CORRECTION

[Previous Routine] [Next Routine] [List of Routines]

     Some files do not have the correct L1 time tag correction.
     Reprocess thoes files.

(See general/missions/rbsp/efw/rbsp_phasef/misc/patch_for_l1_time_tag_correction.pro)

## PATCH_FOR_L1_TIME_TAG_OF_LEAP_SECOND

[Previous Routine] [Next Routine] [List of Routines]

     There are days when there is a -1 sec jump in time tag, but looks like leap second. However, they need to be treated because the time tag is still non-monotonic.

(See general/missions/rbsp/efw/rbsp_phasef/misc/patch_for_l1_time_tag_of_leap_second.pro)

## PATCH_ORBIT_NUM_FOR_L4

[Previous Routine] [Next Routine] [List of Routines]

     Patch to add orbit_num to l4 spinfit, b/c this is slow to load.

(See general/missions/rbsp/efw/rbsp_phasef/misc/patch_orbit_num_for_l4.pro)

## PERIGEE_CORRECTION_PLOT1

[Previous Routine] [Next Routine] [List of Routines]

     Plot Ey and Ez in MGSE.
     Compare E_measure-E_coro and E_vxb

(See general/missions/rbsp/efw/rbsp_phasef/misc/perigee_correction_plot1.pro)

## PLOT_EMFISIS_CORRECTION

[Previous Routine] [Next Routine] [List of Routines]

     Show B GSE before and after UVW2GSE is fixed.

(See general/missions/rbsp/efw/rbsp_phasef/misc/plot_emfisis_correction.pro)

## PLOT_FIX_SPICE_UVW2GSE

[Previous Routine] [Next Routine] [List of Routines]

     Plot spin-axis in GSE before and after correcting for spin tone.

(See general/missions/rbsp/efw/rbsp_phasef/misc/plot_fix_spice_uvw2gse.pro)

## PLOT_L1_TIME_TAG_CORRECTION

[Previous Routine] [Next Routine] [List of Routines]

     Plot the start and end of section.

(See general/missions/rbsp/efw/rbsp_phasef/misc/plot_l1_time_tag_correction.pro)

## PLOT_UVW2GSE_CORRECTION

[Previous Routine] [Next Routine] [List of Routines]

     Show R MGSE before and after UVW2GSE is fixed.

(See general/missions/rbsp/efw/rbsp_phasef/misc/plot_uvw2gse_correction.pro)

## RBSP_EFW_PHASEF_FIX_L4_BFIELD

[Previous Routine] [Next Routine] [List of Routines]

     The B field related quantites are incorrect.

     This is now fixed in rbsp_efw_read_l4_gen_file.
     It's too slow to run that, so we only run the code for B field over.

(See general/missions/rbsp/efw/rbsp_phasef/misc/rbsp_efw_phasef_fix_l4_bfield.pro)

## RBSP_EFW_PHASEF_FIX_L4_LABEL

[Previous Routine] [Next Routine] [List of Routines]

     Load skeleton file and add missing labels.

     This is already fixed in rbsp_efw_read_l4_gen_file.

(See general/missions/rbsp/efw/rbsp_phasef/misc/rbsp_efw_phasef_fix_l4_label.pro)

## RBSP_EFW_PHASEF_FIX_LABELING_FOR_L2_ESVY_DESPUN

[Previous Routine] [Next Routine] [List of Routines]

     Fix labeling for L2 esvy_despun.

     old_root=. The root dir down to the old CDFs of esvy_despun.
     new_root=. The root dir for the new CDFs.

(See general/missions/rbsp/efw/rbsp_phasef/misc/rbsp_efw_phasef_fix_labeling_for_l2_esvy_despun.pro)

## RBSP_EFW_PHASEF_GEN_L2_ESVY_DESPUN

[Previous Routine] [Next Routine] [List of Routines]

     refer to rbsp_efw_make_l2.

(See general/missions/rbsp/efw/rbsp_phasef/misc/rbsp_efw_phasef_gen_l2_esvy_despun.pro)

## RBSP_EFW_PHASEF_GET_SERVER[2]

[Previous Routine] [Next Routine] [List of Routines]

     This is to easily switch among servers to download requested CDF.
     Adopted from rbsp_load_wake_effect_cdf_file.
     This program is supposed to be updated frequently during the phasef tests.

(See general/missions/rbsp/efw/rbsp_phasef/misc/rbsp_efw_phasef_get_server.pro)

## RBSP_EFW_PHASEF_LOCAL_ROOT

[Previous Routine] [Next Routine] [List of Routines]

     Set the local root for saving RBSP data.

(See general/missions/rbsp/efw/rbsp_phasef/misc/rbsp_efw_phasef_local_root.pro)

## RBSP_EFW_PHASEF_READ_B_MGSE[2]

[Previous Routine] [Next Routine] [List of Routines]

     Preprocess and load b_mgse to memory.

(See general/missions/rbsp/efw/rbsp_phasef/misc/rbsp_efw_phasef_read_b_mgse.pro)

## RBSP_EFW_PHASEF_READ_R_MGSE

[Previous Routine] [Next Routine] [List of Routines]

     Preprocess and load r_mgse to memory.

(See general/missions/rbsp/efw/rbsp_phasef/misc/rbsp_efw_phasef_read_r_mgse.pro)

## RBSP_EFW_PHASEF_READ_V_MGSE

[Previous Routine] [Next Routine] [List of Routines]

     Preprocess and load v_mgse to memory.

(See general/missions/rbsp/efw/rbsp_phasef/misc/rbsp_efw_phasef_read_v_mgse.pro)

## RBSP_EFW_PHASEF_SCAN_VB1_SPLIT_DATA_RATE

[Previous Routine] [Next Routine] [List of Routines]

     Scan all vb1_split files for time_range and data_rate.
     Needs to run on a computer with all vb1 or vb1_split data are downloaded.

     data_dir. Data should be saved at data_dir/YYYY/*.cdf.

(See general/missions/rbsp/efw/rbsp_phasef/misc/rbsp_efw_phasef_scan_vb1_split_data_rate.pro)

## RBSP_EFW_PHASEF_SPICE_VAR_ADD_LABELING

[Previous Routine] [Next Routine] [List of Routines]

     Add labeling to v08 files, to make sure variables are properly labeled.

(See general/missions/rbsp/efw/rbsp_phasef/misc/rbsp_efw_phasef_spice_var_add_labeling.pro)

## RBSP_EFW_READ_L1_TIME_TAG_CORRECTION[2]

[Previous Routine] [Next Routine] [List of Routines]

     Read the time range of sections shifted in time tag, and the correction.
     Data adopted from the txt file generated by rbsp_efw_read_l1_time_tag_correction_gen_file.

     The tplot_var is 'rbspx_l1_time_tag_correction', to use
        get_data, 'rbspa_l1_time_tag_correction', start_times, time_ranges, corrections
        nsection = n_elements(corrections)

        foo_l1_efw_data = 'rbspa_efw_esvy'
        get_data, foo_l1_efw_data, times, data
        for ii=0, nsection-1 do begin
            tmp = where(times ge time_ranges[ii,0] and times le time_ranges[ii,1], count)
            if count eq 0 then continue
            ; Have to find the closest time, otherwise the index can be 1 record off.
            if min(times) ge correction_time_ranges[ii,0] then i0 = 0 else begin
                index = min(times-correction_time_ranges[ii,0], /absolute, i0)
            endelse
            if max(times) le correction_time_ranges[ii,1] then i1 = n_elements(times) else begin
                index = min(times-correction_time_ranges[ii,1], /absolute, i1)
            endelse
            times[i0:i1-1] += corrections[ii]
        endfor
        store_data, foo_l1_efw_data, times, data

(See general/missions/rbsp/efw/rbsp_phasef/misc/rbsp_efw_read_l1_time_tag_correction.pro)

## RBSP_EFW_READ_L1_TIME_TAG_CORRECTION_GEN_FILE

[Previous Routine] [Next Routine] [List of Routines]

     Write the start and end time of sections shifted in time tag, and the wanted correction.
     To correct: read data in the time range, add the correction to the old_times:
       new_times = old_times+correction

(See general/missions/rbsp/efw/rbsp_phasef/misc/rbsp_efw_read_l1_time_tag_correction_gen_file.pro)

## RBSP_FIX_B_UVW

[Previous Routine] [Next Routine] [List of Routines]

     Fix spin tone in B UVW, remove bad data.

(See general/missions/rbsp/efw/rbsp_phasef/misc/rbsp_fix_b_uvw.pro)

## RBSP_FIX_Q_UVW2GSE

[Previous Routine] [Next Routine] [List of Routines]

     Fix spin tone and other artificial signals in UVW2GSE.
     The assumption is that, attitude evovles slowly in time, except during eclipse and maneuver.

     time_range. The time range in sec.
     probe=.
     restore_eclipse=. Set to restore attitude during eclipse.
     restore_maneuver=. Set to restore attitude during maenuver.

(See general/missions/rbsp/efw/rbsp_phasef/misc/rbsp_fix_q_uvw2gse.pro)

## RBSP_PHASEF_FIT_PER_MANEUVER

[Previous Routine] [Next Routine] [List of Routines]

     Fit E_measure-E_model per maneuver.

(See general/missions/rbsp/efw/rbsp_phasef/misc/rbsp_phasef_fit_per_maneuver.pro)

## RBSP_PHASEF_LOAD_FIT_QUANTITIES

[Previous Routine] [Next Routine] [List of Routines]

     Load quantities for fitting perigee corrections.

(See general/missions/rbsp/efw/rbsp_phasef/misc/rbsp_phasef_load_fit_quantities.pro)

## RBSP_PHASEF_READ_FIT_COEF_V01

[Previous Routine] [Next Routine] [List of Routines]

     Fit E_measure-E_model per maneuver.

     time_range. Optional, used because at early stage not all data are available.

(See general/missions/rbsp/efw/rbsp_phasef/misc/rbsp_phasef_read_fit_coef_v01.pro)

## RBSP_PHASEF_READ_FIT_COEF_V02

[Previous Routine] [Next Routine] [List of Routines]

     Fit E_measure-E_model per maneuver.

     time_range. Optional, used because at early stage not all data are available.

(See general/missions/rbsp/efw/rbsp_phasef/misc/rbsp_phasef_read_fit_coef_v02.pro)

## RBSP_PHASEF_READ_FIT_TIMES

[Previous Routine] [Next Routine] [List of Routines]

     Read the section times to do fit, in [n,2].
     Ensure that each section is long enough to contain >3 perigees.

(See general/missions/rbsp/efw/rbsp_phasef/misc/rbsp_phasef_read_fit_times.pro)

## RBSP_REMOVE_SPINTONE

[Previous Routine] [Next Routine] [List of Routines]

     Remove spin tone in RBSP data.

(See general/missions/rbsp/efw/rbsp_phasef/misc/rbsp_remove_spintone.pro)

## SAVE_RBSP_SDT_TIME_RANGES

[Previous Routine] [Next Routine] [List of Routines]

     Save the time ranges of SDT.

(See general/missions/rbsp/efw/rbsp_phasef/misc/save_rbsp_sdt_time_ranges.pro)

## SCAN_FOR_TIME_TAG_IRREGULARITY

[Previous Routine] [Next Routine] [List of Routines]

     Scan L2 esvy data for irregular time tags.

(See general/missions/rbsp/efw/rbsp_phasef/misc/scan_for_time_tag_irregularity.pro)

## TPLOT_EFIELD

[Previous Routine] [Next Routine] [List of Routines]

     Specially designed to plot E field, with 3 dyanmic ranges:
       [-1,1]*5 mV/m to show small field.
       [-1,1]*50 mV/m to show large field.
       [-1,1]*500 mV/m to show very large and invalid field.

(See general/missions/rbsp/efw/rbsp_phasef/misc/tplot_efield.pro)

## WYGANT_ADD_E_COMBO_TO_YEARLY_FILES

[Previous Routine] [Next Routine] [List of Routines]

     Add Ey V13, V14, V23, V24
     Add Ez V13, V14, V23, V24

(See general/missions/rbsp/efw/rbsp_phasef/misc/wygant_add_e_combo_to_yearly_files.pro)

## WYGANT_GEN_YEARLY_FILES

[Previous Routine] [List of Routines]

     Generate yearly files include:
       1. Ey V12 V34
       2. Ez V12 V34
       3. Ey wake V12 V34
       4. Ez wake V12 V34

(See general/missions/rbsp/efw/rbsp_phasef/misc/wygant_gen_yearly_files.pro)