Skip to content

Commit

Permalink
test: ✅ add full catalog validation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thkruz committed Aug 12, 2022
1 parent e785e78 commit 97cb4c1
Show file tree
Hide file tree
Showing 103 changed files with 1,887 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/sgp4/sgp4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2741,7 +2741,6 @@ class Sgp4 {
satrec.aycof = -0.5 * j3oj2 * sinip;

// Sgp4fix for divide by zero for xincp = 180 deg
/* istanbul ignore next | This is no longer possible*/
if (Math.abs(cosip + 1.0) > 1.5e-12) {
satrec.xlcof = (-0.25 * j3oj2 * sinip * (3.0 + 5.0 * cosip)) / (1.0 + cosip);
} else {
Expand Down
1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_0.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_1.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_10.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_11.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_12.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_13.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_14.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_15.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_16.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_17.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_18.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_19.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_2.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_20.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_21.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_22.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_23.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_24.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_25.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_26.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_27.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_28.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_29.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_3.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_30.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_31.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_32.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_33.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_34.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_35.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_36.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_37.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_38.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_39.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_4.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_40.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_41.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_42.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_43.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_44.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_45.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_46.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_47.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_48.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_49.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_5.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_50.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_6.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_7.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_8.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/sgp4/full-catalog/TLE_9.json

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions test/sgp4/full-catalog/sgp4-catalog-0.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

/* eslint-disable no-sync */
/* eslint-disable prefer-destructuring */
/**
* @file Test Suite to verify results match OscState0.json which is a subset of the entire catalog from Aug 2022
* @author Theodore Kruczek.
* @since 1.5.5
*/

import * as fs from 'fs';

/**
* sgp4Data is from SGP4Prop 8.3 Build: Apr 27 2022
*/
import { Sgp4 } from '../../../lib/ootk';

const fileName = 'TLE_0';
const rawData = fs.readFileSync(`test/sgp4/full-catalog/${fileName}.json`, 'utf8');
// Convert to JSON
const sgp4Data = JSON.parse(rawData);

describe('OscState0 testing', () => {
sgp4Data.forEach((sgp4DataItem) => {
// Fetching satellite record from TLE lines
const satrec = Sgp4.createSatrec(sgp4DataItem.line1, sgp4DataItem.line2);
const satnum = sgp4DataItem.line1.slice(2, 7);

it(`${satnum} measurements match snapshot`, () => {
expect(Sgp4.propagate(satrec, 0)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 360)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 720)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 1080)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 1440)).toMatchSnapshot();
});
});
});
36 changes: 36 additions & 0 deletions test/sgp4/full-catalog/sgp4-catalog-1.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

/* eslint-disable no-sync */
/* eslint-disable prefer-destructuring */
/**
* @file Test Suite to verify results match OscState1.json which is a subset of the entire catalog from Aug 2022
* @author Theodore Kruczek.
* @since 1.5.5
*/

import * as fs from 'fs';

/**
* sgp4Data is from SGP4Prop 8.3 Build: Apr 27 2022
*/
import { Sgp4 } from '../../../lib/ootk';

const fileName = 'TLE_1';
const rawData = fs.readFileSync(`test/sgp4/full-catalog/${fileName}.json`, 'utf8');
// Convert to JSON
const sgp4Data = JSON.parse(rawData);

describe('OscState1 testing', () => {
sgp4Data.forEach((sgp4DataItem) => {
// Fetching satellite record from TLE lines
const satrec = Sgp4.createSatrec(sgp4DataItem.line1, sgp4DataItem.line2);
const satnum = sgp4DataItem.line1.slice(2, 7);

it(`${satnum} measurements match snapshot`, () => {
expect(Sgp4.propagate(satrec, 0)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 360)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 720)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 1080)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 1440)).toMatchSnapshot();
});
});
});
36 changes: 36 additions & 0 deletions test/sgp4/full-catalog/sgp4-catalog-10.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

/* eslint-disable no-sync */
/* eslint-disable prefer-destructuring */
/**
* @file Test Suite to verify results match OscState10.json which is a subset of the entire catalog from Aug 2022
* @author Theodore Kruczek.
* @since 1.5.5
*/

import * as fs from 'fs';

/**
* sgp4Data is from SGP4Prop 8.3 Build: Apr 27 2022
*/
import { Sgp4 } from '../../../lib/ootk';

const fileName = 'TLE_10';
const rawData = fs.readFileSync(`test/sgp4/full-catalog/${fileName}.json`, 'utf8');
// Convert to JSON
const sgp4Data = JSON.parse(rawData);

describe('OscState10 testing', () => {
sgp4Data.forEach((sgp4DataItem) => {
// Fetching satellite record from TLE lines
const satrec = Sgp4.createSatrec(sgp4DataItem.line1, sgp4DataItem.line2);
const satnum = sgp4DataItem.line1.slice(2, 7);

it(`${satnum} measurements match snapshot`, () => {
expect(Sgp4.propagate(satrec, 0)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 360)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 720)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 1080)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 1440)).toMatchSnapshot();
});
});
});
36 changes: 36 additions & 0 deletions test/sgp4/full-catalog/sgp4-catalog-11.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

/* eslint-disable no-sync */
/* eslint-disable prefer-destructuring */
/**
* @file Test Suite to verify results match OscState11.json which is a subset of the entire catalog from Aug 2022
* @author Theodore Kruczek.
* @since 1.5.5
*/

import * as fs from 'fs';

/**
* sgp4Data is from SGP4Prop 8.3 Build: Apr 27 2022
*/
import { Sgp4 } from '../../../lib/ootk';

const fileName = 'TLE_11';
const rawData = fs.readFileSync(`test/sgp4/full-catalog/${fileName}.json`, 'utf8');
// Convert to JSON
const sgp4Data = JSON.parse(rawData);

describe('OscState11 testing', () => {
sgp4Data.forEach((sgp4DataItem) => {
// Fetching satellite record from TLE lines
const satrec = Sgp4.createSatrec(sgp4DataItem.line1, sgp4DataItem.line2);
const satnum = sgp4DataItem.line1.slice(2, 7);

it(`${satnum} measurements match snapshot`, () => {
expect(Sgp4.propagate(satrec, 0)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 360)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 720)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 1080)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 1440)).toMatchSnapshot();
});
});
});
36 changes: 36 additions & 0 deletions test/sgp4/full-catalog/sgp4-catalog-12.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

/* eslint-disable no-sync */
/* eslint-disable prefer-destructuring */
/**
* @file Test Suite to verify results match OscState12.json which is a subset of the entire catalog from Aug 2022
* @author Theodore Kruczek.
* @since 1.5.5
*/

import * as fs from 'fs';

/**
* sgp4Data is from SGP4Prop 8.3 Build: Apr 27 2022
*/
import { Sgp4 } from '../../../lib/ootk';

const fileName = 'TLE_12';
const rawData = fs.readFileSync(`test/sgp4/full-catalog/${fileName}.json`, 'utf8');
// Convert to JSON
const sgp4Data = JSON.parse(rawData);

describe('OscState12 testing', () => {
sgp4Data.forEach((sgp4DataItem) => {
// Fetching satellite record from TLE lines
const satrec = Sgp4.createSatrec(sgp4DataItem.line1, sgp4DataItem.line2);
const satnum = sgp4DataItem.line1.slice(2, 7);

it(`${satnum} measurements match snapshot`, () => {
expect(Sgp4.propagate(satrec, 0)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 360)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 720)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 1080)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 1440)).toMatchSnapshot();
});
});
});
36 changes: 36 additions & 0 deletions test/sgp4/full-catalog/sgp4-catalog-13.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

/* eslint-disable no-sync */
/* eslint-disable prefer-destructuring */
/**
* @file Test Suite to verify results match OscState13.json which is a subset of the entire catalog from Aug 2022
* @author Theodore Kruczek.
* @since 1.5.5
*/

import * as fs from 'fs';

/**
* sgp4Data is from SGP4Prop 8.3 Build: Apr 27 2022
*/
import { Sgp4 } from '../../../lib/ootk';

const fileName = 'TLE_13';
const rawData = fs.readFileSync(`test/sgp4/full-catalog/${fileName}.json`, 'utf8');
// Convert to JSON
const sgp4Data = JSON.parse(rawData);

describe('OscState13 testing', () => {
sgp4Data.forEach((sgp4DataItem) => {
// Fetching satellite record from TLE lines
const satrec = Sgp4.createSatrec(sgp4DataItem.line1, sgp4DataItem.line2);
const satnum = sgp4DataItem.line1.slice(2, 7);

it(`${satnum} measurements match snapshot`, () => {
expect(Sgp4.propagate(satrec, 0)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 360)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 720)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 1080)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 1440)).toMatchSnapshot();
});
});
});
36 changes: 36 additions & 0 deletions test/sgp4/full-catalog/sgp4-catalog-14.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

/* eslint-disable no-sync */
/* eslint-disable prefer-destructuring */
/**
* @file Test Suite to verify results match OscState14.json which is a subset of the entire catalog from Aug 2022
* @author Theodore Kruczek.
* @since 1.5.5
*/

import * as fs from 'fs';

/**
* sgp4Data is from SGP4Prop 8.3 Build: Apr 27 2022
*/
import { Sgp4 } from '../../../lib/ootk';

const fileName = 'TLE_14';
const rawData = fs.readFileSync(`test/sgp4/full-catalog/${fileName}.json`, 'utf8');
// Convert to JSON
const sgp4Data = JSON.parse(rawData);

describe('OscState14 testing', () => {
sgp4Data.forEach((sgp4DataItem) => {
// Fetching satellite record from TLE lines
const satrec = Sgp4.createSatrec(sgp4DataItem.line1, sgp4DataItem.line2);
const satnum = sgp4DataItem.line1.slice(2, 7);

it(`${satnum} measurements match snapshot`, () => {
expect(Sgp4.propagate(satrec, 0)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 360)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 720)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 1080)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 1440)).toMatchSnapshot();
});
});
});
36 changes: 36 additions & 0 deletions test/sgp4/full-catalog/sgp4-catalog-15.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

/* eslint-disable no-sync */
/* eslint-disable prefer-destructuring */
/**
* @file Test Suite to verify results match OscState15.json which is a subset of the entire catalog from Aug 2022
* @author Theodore Kruczek.
* @since 1.5.5
*/

import * as fs from 'fs';

/**
* sgp4Data is from SGP4Prop 8.3 Build: Apr 27 2022
*/
import { Sgp4 } from '../../../lib/ootk';

const fileName = 'TLE_15';
const rawData = fs.readFileSync(`test/sgp4/full-catalog/${fileName}.json`, 'utf8');
// Convert to JSON
const sgp4Data = JSON.parse(rawData);

describe('OscState15 testing', () => {
sgp4Data.forEach((sgp4DataItem) => {
// Fetching satellite record from TLE lines
const satrec = Sgp4.createSatrec(sgp4DataItem.line1, sgp4DataItem.line2);
const satnum = sgp4DataItem.line1.slice(2, 7);

it(`${satnum} measurements match snapshot`, () => {
expect(Sgp4.propagate(satrec, 0)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 360)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 720)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 1080)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 1440)).toMatchSnapshot();
});
});
});
36 changes: 36 additions & 0 deletions test/sgp4/full-catalog/sgp4-catalog-16.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

/* eslint-disable no-sync */
/* eslint-disable prefer-destructuring */
/**
* @file Test Suite to verify results match OscState16.json which is a subset of the entire catalog from Aug 2022
* @author Theodore Kruczek.
* @since 1.5.5
*/

import * as fs from 'fs';

/**
* sgp4Data is from SGP4Prop 8.3 Build: Apr 27 2022
*/
import { Sgp4 } from '../../../lib/ootk';

const fileName = 'TLE_16';
const rawData = fs.readFileSync(`test/sgp4/full-catalog/${fileName}.json`, 'utf8');
// Convert to JSON
const sgp4Data = JSON.parse(rawData);

describe('OscState16 testing', () => {
sgp4Data.forEach((sgp4DataItem) => {
// Fetching satellite record from TLE lines
const satrec = Sgp4.createSatrec(sgp4DataItem.line1, sgp4DataItem.line2);
const satnum = sgp4DataItem.line1.slice(2, 7);

it(`${satnum} measurements match snapshot`, () => {
expect(Sgp4.propagate(satrec, 0)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 360)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 720)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 1080)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 1440)).toMatchSnapshot();
});
});
});
36 changes: 36 additions & 0 deletions test/sgp4/full-catalog/sgp4-catalog-17.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

/* eslint-disable no-sync */
/* eslint-disable prefer-destructuring */
/**
* @file Test Suite to verify results match OscState17.json which is a subset of the entire catalog from Aug 2022
* @author Theodore Kruczek.
* @since 1.5.5
*/

import * as fs from 'fs';

/**
* sgp4Data is from SGP4Prop 8.3 Build: Apr 27 2022
*/
import { Sgp4 } from '../../../lib/ootk';

const fileName = 'TLE_17';
const rawData = fs.readFileSync(`test/sgp4/full-catalog/${fileName}.json`, 'utf8');
// Convert to JSON
const sgp4Data = JSON.parse(rawData);

describe('OscState17 testing', () => {
sgp4Data.forEach((sgp4DataItem) => {
// Fetching satellite record from TLE lines
const satrec = Sgp4.createSatrec(sgp4DataItem.line1, sgp4DataItem.line2);
const satnum = sgp4DataItem.line1.slice(2, 7);

it(`${satnum} measurements match snapshot`, () => {
expect(Sgp4.propagate(satrec, 0)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 360)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 720)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 1080)).toMatchSnapshot();
expect(Sgp4.propagate(satrec, 1440)).toMatchSnapshot();
});
});
});
Loading

0 comments on commit 97cb4c1

Please sign in to comment.