The
Returns the fitted slope and intercept (
The
Returns the number of unique values in
Identify and obtain the unique strings from an array of strings,
Returns a pointer containing all of the unique strings and the number of unique strings as the output.
The
Returns the standard deviation.
The
Returns the mean and standard deviation as pointers.
Calculate the z-score for each value in
Returns the z-score as a pointer equal in size to the input array
A function that calculates the value for a Gaussian at
Returns the result of amplitude * e^(-(x-mean)^2 / (2 * standard_deviation^2)).
A function that calculates the value for a multi-peaked Gaussian at
Returns the result of SUM(amplitude_i * e^(-(x-mean_i)^2 / (2 * standard_deviation_i^2))).
A function that calculates the deviation between the values of a data set and a fitted Gaussian function. This function is formatted for use in MINPACK optimization.
+Returns a value of zero and updates the
A function that calculates the deviation between the values of a data set and a fitted multi-peaked Gaussian function. This function is formatted for use in MINPACK optimization.
+Returns a value of zero and updates the
The
Returns the number of values in each bin through the
The
Returns the number of relative maxima as output and an array of booleans (True is 1 and False is 0) through the
Based off of, but not identical to, the Python scipy hidden function
The
Returns the zero-ordered index of the maximum in
The
Returns the the maximum from
The
Returns the minimum from
The
Returns the incomplete upper gamma function.
+NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING.
+The
Returns the incomplete upper gamma function through the
NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING.
+The
Returns the incomplete upper gamma function through the
NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING.
+The
Returns the log of the gamma function.
+NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING.
+The
The
The
The
The
The
This function uses the straight insertion method for sorting. This is an
The
This function uses the straight insertion method for sorting. This is an
The
This function uses the straight insertion method for sorting. This is an
The
This function is typically the fastest sorting algorithm for large N (`num`).
+The
This function is typically the fastest sorting algorithm for large N (`num`).
+The
This function is typically the fastest sorting algorithm for large N (`num`).
+Creates an enhanced fitacf format file for a single radar site with the correct backscatter return direction from either a fit or fitacf format file.
Creates an fitacf format file with additional flags that denote the correct backscatter return direction and updated elevation angles for a single radar site from either a fit or fitacf format file.
The return direction is determined by examining the variations in elevation angle across the field-of-view (FoV), with ground and ionospheric backscatter examined seperately. Backscatter are also grouped into different propagation paths (by hop and ionospheric region) using virtual height limits. These limits vary from radar to radar, and care should be taken when choosing the limits for each radar. The default limits were tested for CLY and INV. The limits at HAN are the same, but with fhmax set to 900km.
+The algorithm (Burrell et al. 2015) optionally allows the user to specify the frequency bands, update the interferometer calibration (TDIFF), and specify whether badly identified groundscatter should be treated as ionospheric scatter for the purposes of calculating the origin FoV. Most radars use either a 300 kHz or 500 kHz bandwidth, so if no frequency band is specified they will be determined using a 300 kHz band width.
+After determining the return direction, text lines are written to standard output.
+The program accepts multiple fit files as input. If more than one input file is provided, the program will concatenate them together for processing. Note that only fit files from a single radar site may be concatenated.
+20170708.2001.00.cly.fitacf3" and store it in the file "20170708.2001.00.cly.10_12.fov". This file only processes transmission frequencies between 10 and 12 MHz and uses a TDIFF value for this radar and frequency band calculated using the Chisham Meteor Method. Reports the status on standard error.20000510.kod.600bw.fov".19960916.0400.00.han.fit". Uses a 300 kHz bandwidth, only data from STEREO channel a, and changes the F-region virtual height maximum from 750 km to 900 km, as is appropriate for this radar. Store an extended format grid file in "19960916.0400.00.a.han.300bw.fov_txt"
+The
The
The
The
The
The
The
The
The
The
The
The
The
The
The
The
NULL pointer is returned.The
NULL pointer is returned.struct FitMultBSID, struct FitBSIDScan,
+struct FitBSIDBeam, struct CellBSIDLoc, and
+struct CellBSIDFlgs. All these structures are defined in the
+header superdarn/fitmultbsid.h. Additional structures contained
+within struct FitBSIDBeam are found in
+superdarn/fitblk.h and superdarn/scandata.h.
+
+### `struct FitMultBSID`
+
+This structure organizes the data in a linked list heirarchically by scan, beam,
+and range gate.
+
+```
+struct FitMultBSID
+{
+ int stid; /* Radar station ID */
+ struct
+ {
+ int major; /* major version */
+ int minor; /* minor version */
+ } version;
+
+ double st_time; /* Starting time of data */
+ double ed_time; /* Ending time of data */
+ int num_scans; /* Total number of scans */
+
+ struct FitBSIDScan *scan_ptr; /* Pointer to the first scan */
+ struct FitBSIDScan *last_ptr; /* Pointer to the last scan */
+};
+```
+
+### `struct FitBSIDScan`
+
+This structure organizes the data for a single scan that contains data for each
+beam indexed in chronological order and then numerically by range gate. It may
+also be linked to the previous and subsequent scans.
+
+```
+struct FitBSIDScan
+{
+ double st_time; /* Starting time of scan data */
+ double ed_time; /* Ending time of scan data */
+ int num_bms; /* Total number of beams in this scan */
+ struct FitBSIDBeam *bm; /* Pointer of `num_bms` beam data */
+ struct FitBSIDScan *next_scan; /* Pointer to the next scan */
+ struct FitBSIDScan *prev_scan; /* Pointer to the previous scan */
+};
+```
+
+### `struct FitBSIDBeam`
+
+This structure organizes the data for a single beam, with range gate data
+stored in the zero-indexed pointer that corresponds to each data's range gate.
+
+```
+struct FitBSIDBeam
+{
+ /* Set the beam constants */
+ int cpid; /* Radar program ID */
+ int bm; /* Beam number */
+ float bmazm; /* Beam azimuth in degrees */
+ double time; /* Epoch time (does not include seconds or microseconds */
+ struct {
+ int sc; /* Seconds */
+ int us; /* Microseconds */
+ } intt;
+
+ /* Set the beam parameter values */
+ int nave; /* Number of pulse sequences transmitted */
+ int frang; /* Lag to the first range gate in km */
+ int rsep; /* Range gate seperation in km */
+ int rxrise; /* Receiver rise time in microseconds */
+ int freq; /* Transmission frequency in kHz */
+ int noise; /* Noise level */
+ int atten; /* Beam attenuation level */
+ int channel; /* Channel number */
+
+ /* Set the beam range-gate information */
+ int nrang; /* Number of range gates at this beam */
+ unsigned char *sct; /* Flag denoting presence or absence of scatter */
+ struct RadarCell *rng; /* Fitted ACF data for each range gate */
+ struct RadarCell *med_rng; /* Median smoothed data for each range gate */
+ struct FitElv *front_elv; /* Elevation angles, assuming front FoV */
+ struct FitElv *back_elv; /* Elevation angles, assuming rear FoV */
+ struct CellBSIDFlgs *rng_flgs; /* Additional flag data for each range gate */
+ struct CellBSIDLoc *front_loc; /* Location data, assuming front FoV */
+ struct CellBSIDLoc *back_loc; /* Location data, assuming rear FoV */
+};
+```
+
+### `struct CellBSIDLoc`
+
+This structure contains location data, assuming an origin FoV.
+
+```
+struct CellBSIDLoc
+{
+ float vh; /* Virtual height in km */
+ float vh_e; /* Virtual height error in km */
+ char vh_m[2]; /* Virtual height calculation method: E (elv), S (standard), or C (Chisham) */
+ char region[2]; /* Ionospheric region: U (unset), D, E, or F */
+ float hop; /* Number of hops in the propagation path */
+ float dist; /* Slant distance to the 1/2 hop location in km */
+};
+```
+
+### `struct CellBSIDFlgs`
+
+This structure contains flag data, assuming an origin FoV.
+
+```
+struct CellBSIDFlgs
+{
+ int fov; /* FoV flag values: 1 front Fov, 0 unknown FoV, -1 rear FoV */
+ int fov_past; /* Past FoV flag values */
+ int grpflg; /* Group flag: 0 if not a member, 1 if a member */
+ int grpnum; /* Group number */
+ char grpid[2]; /* Group ID string (U if unset) */
+};
+```
+
+## References
+
+- The algorithms for which these structures were designed were published in:
+
+1. Burrell, A. G., Milan, S. E., Perry, G. W., Yeoman, T. K., and Lester, M.
+ (2015), Automatically determining the origin direction and propagation mode
+ of high-frequency radar backscatter, Radio Sci., 50, 1225– 1245,
+ [doi:10.1002/2015RS005808](https://agupubs.onlinelibrary.wiley.com/doi/full/10.1002/2015RS005808).
+2. Burrell, A. G., Perry, G. W., Yeoman, T. K., Milan, S. E., & Stoneback, R.
+ (2018). Solar influences on the return direction of high-frequency radar
+ backscatter. Radio Science, 53, 577– 597.
+ [doi:10.1002/2017RS006512](https://agupubs.onlinelibrary.wiley.com/doi/10.1002/2017RS006512)
+3. Ribeiro, A. J., Ruohoniemi, J. M., Baker, J., Clausen, L. B. N., de Larquier,
+ S., & Greenwald, R. A. (2011). A new approach for identifying ionospheric
+ backscatter in midlatitude SuperDARN HF radar observations. Radio Science,
+ 46, RS4011. [doi:10.1029/2011RS004676](https://doi.org/10.1029/2011RS004676)
+4. J Ribeiro, Kevin Sterne, Sebastien de Larquier, Ashton Reimer, Matt Wessel,
+ Muhammad Rafiq (Maimaitirebike Maimaiti), Jef Spaleta, Angeline Burrell,
+ Bharat Kunduri, Xueling Shi, Christer van der Meeren, Pål Ellingsen,
+ Ray Greenwald, Nathaniel Frissell, Anurag Sharma, & Phil Erickson. (2020).
+ vtsuperdarn/davitpy: Final release of davitpy (v0.9). Zenodo.
+ [doi:10.5281/zenodo.3824466](https://doi.org/10.5281/zenodo.3824466)
+
+## History
+
+- 2021/11/23 Initial Revision.
+
diff --git a/docs/dev/gotchas.md b/docs/dev/gotchas.md
new file mode 100644
index 000000000..ac0e19d00
--- /dev/null
+++ b/docs/dev/gotchas.md
@@ -0,0 +1,18 @@
+
+
+# Development Gotchas
+
+The RST codebase has a long legacy, and it can be difficult to begin expanding
+or maintaining. Commonly enountered issues are recored here to help new
+developers.
+
+1. The library order in RST tool makefiles is important. Incorrect order may
+ cause compilation failure on some operating systems and memory leaks or
+ segmentation faults on other systems. This can be difficult to debug if your
+ system does not cause a compilation failure.
+2. The validity of SuperDARN binary files may be tested simply using the
+ `dmapdump` function. It prints the contents of any SuperDARN binary file to
+ standard out in plain text.
diff --git a/docs/index.md b/docs/index.md
index 37dd0a078..e21699b8c 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -4,13 +4,17 @@ author: Marina Schmidt, SuperDARN Canada
-->
# Radar Software Toolkit (RST)
-RST is an open source software package (licensed under GPL v3.0) that allows researchers to analyze, model, and quickly visualize the SuperDARN project data.
+RST is an open source software package (licensed under GPL v3.0) that allows
+researchers to analyze, model, and quickly visualize the SuperDARN project data.
## RST source code
The RST is released as a zip archive on [Zenodo](https://doi.org/10.5281/zenodo.801458) with a citable doi.
-The software is maintained by the SuperDARN Data Analysis Working Group (DAWG) on [GitHub](https://github.com/SuperDARN/rst). Bug reports, comments and suggestions can be provided by submitting an [issue](https://github.com/SuperDARN/rst/issues) on Github.
+The software is maintained by the SuperDARN Data Analysis Working Group (DAWG)
+on [GitHub](https://github.com/SuperDARN/rst). Bug reports, comments and
+suggestions can be provided by submitting an
+[issue](https://github.com/SuperDARN/rst/issues) on Github.
## Table of Contents
- Installation
@@ -28,12 +32,12 @@ The software is maintained by the SuperDARN Data Analysis Working Group (DAWG) o
* [FITACF to GRID](user_guide/make_grid.md)
* [GRID to MAP](user_guide/map_grid.md)
- Plotting Data
- * [Range-time Plots](user_guide/time_plot.md)
- * [Field of View Plots](user_guide/fov_plot.md)
- * [Field Plots](user_guide/field_plot.md)
- * [Grid Plots](user_guide/grid_plot.md)
- * [Convection Plots](user_guide/map_plot.md)
- * [Customizing Colors](user_guide/colors.md)
+ * [Range-time Plots](user_guide/time_plot.md)
+ * [Field of View Plots](user_guide/fov_plot.md)
+ * [Field Plots](user_guide/field_plot.md)
+ * [Grid Plots](user_guide/grid_plot.md)
+ * [Convection Plots](user_guide/map_plot.md)
+ * [Customizing Colors](user_guide/colors.md)
- SuperDARN Data Formats
* [cFit Format](references/general/cfit.md)
* [Dmap Data](references/general/dmap_data.md)
@@ -59,19 +63,21 @@ The software is maintained by the SuperDARN Data Analysis Working Group (DAWG) o
* [Testing Code](dev/testing.md)
* [Code Reviews](dev/code_reviews.md)
* [Releasing Code](dev/releases.md)
+ * [Gotchas](dev/gotchas.md)
- Data Structures in C
- * [cFit](dev/cfit_struct_c.md)
- * [FitACF](dev/fitacf_struct_c.md)
- * [Grid](dev/grid_struct_c.md)
- * [IQDat](dev/iqdat_struct_c.md)
- * [Map (cnvmap)](dev/cnvmap_struct_c.md)
- * [Radar Parameter Block](dev/radar_parameter_c.md)
- * [RawACF](dev/rawacf_struct_c.md)
+ * [FitMultBSID](dev/fitmultbsid_struct_c.md)
+ * [cFit](dev/cfit_struct_c.md)
+ * [FitACF](dev/fitacf_struct_c.md)
+ * [Grid](dev/grid_struct_c.md)
+ * [IQDat](dev/iqdat_struct_c.md)
+ * [Map (cnvmap)](dev/cnvmap_struct_c.md)
+ * [Radar Parameter Block](dev/radar_parameter_c.md)
+ * [RawACF](dev/rawacf_struct_c.md)
- Data Structures in IDL
- * [FitACF](dev/fitacf_struct_idl.md)
- * [Grid](dev/grid_struct_idl.md)
- * [IQDat](dev/iqdat_struct_idl.md)
- * [Map (cnvmap)](dev/cnvmap_struct_idl.md)
- * [Radar Parameter Block](dev/radar_parameter_idl.md)
- * [RawACF](dev/rawacf_struct_idl.md)
+ * [FitACF](dev/fitacf_struct_idl.md)
+ * [Grid](dev/grid_struct_idl.md)
+ * [IQDat](dev/iqdat_struct_idl.md)
+ * [Map (cnvmap)](dev/cnvmap_struct_idl.md)
+ * [Radar Parameter Block](dev/radar_parameter_idl.md)
+ * [RawACF](dev/rawacf_struct_idl.md)