ootk 6.0.0 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.cjs +519 -2
- package/dist/main.d.cts +308 -1
- package/dist/main.d.ts +308 -1
- package/dist/main.js +519 -3
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -14041,7 +14041,7 @@ ${this.line2}`;
|
|
|
14041
14041
|
bstar1 *= 10 ** exponent;
|
|
14042
14042
|
if (bstarSymbol === "-") {
|
|
14043
14043
|
bstar1 *= -1;
|
|
14044
|
-
} else if (bstarSymbol === "+" || bstarSymbol === " ") ; else {
|
|
14044
|
+
} else if (bstarSymbol === "+" || bstarSymbol === " " || bstarSymbol === "0") ; else {
|
|
14045
14045
|
throw new ParseError(`Invalid BSTAR symbol: ${bstarSymbol}`, "TLE");
|
|
14046
14046
|
}
|
|
14047
14047
|
return toPrecision(bstar1, 14);
|
|
@@ -14251,7 +14251,8 @@ ${this.line2}`;
|
|
|
14251
14251
|
* @returns The first derivative of the mean motion.
|
|
14252
14252
|
*/
|
|
14253
14253
|
static meanMoDev1(tleLine1) {
|
|
14254
|
-
const
|
|
14254
|
+
const raw = tleLine1.substring(_Tle.meanMoDev1_.start, _Tle.meanMoDev1_.stop).trim();
|
|
14255
|
+
const meanMoDev1 = parseFloat(raw.startsWith("+") ? raw.substring(1) : raw);
|
|
14255
14256
|
if (isNaN(meanMoDev1)) {
|
|
14256
14257
|
throw new ParseError("Invalid first derivative of mean motion", "TLE");
|
|
14257
14258
|
}
|
|
@@ -16586,6 +16587,14 @@ var Satellite = class _Satellite extends SpaceObject {
|
|
|
16586
16587
|
name
|
|
16587
16588
|
});
|
|
16588
16589
|
}
|
|
16590
|
+
/**
|
|
16591
|
+
* Creates a Satellite from an OMM (Orbit Mean-elements Message) data object.
|
|
16592
|
+
* @param omm - The OMM data in flat format
|
|
16593
|
+
* @param name - Optional satellite name (overrides OMM OBJECT_NAME)
|
|
16594
|
+
*/
|
|
16595
|
+
static fromOmm(omm, name) {
|
|
16596
|
+
return new _Satellite({ omm, name: name ?? omm.OBJECT_NAME });
|
|
16597
|
+
}
|
|
16589
16598
|
// ==================== TLE/OMM Parsing ====================
|
|
16590
16599
|
parseTleAndUpdateOrbit_(tle1, tle2, sccNum) {
|
|
16591
16600
|
const tleData = Tle.parse(tle1, tle2);
|
|
@@ -25123,6 +25132,513 @@ var OdmExporter = class _OdmExporter {
|
|
|
25123
25132
|
}
|
|
25124
25133
|
};
|
|
25125
25134
|
|
|
25135
|
+
// src/parsers/OmmParser.ts
|
|
25136
|
+
var OmmParser = class _OmmParser {
|
|
25137
|
+
constructor() {
|
|
25138
|
+
}
|
|
25139
|
+
/**
|
|
25140
|
+
* Parse OMM KVN format text into structured data.
|
|
25141
|
+
* @param content - The raw OMM file content as a string
|
|
25142
|
+
* @returns Parsed OMM structure with all sections
|
|
25143
|
+
* @throws ParseError if the file cannot be parsed or is missing required fields
|
|
25144
|
+
*/
|
|
25145
|
+
static parse(content) {
|
|
25146
|
+
const lines = content.split(/\r?\n/u).map((l) => l.trim()).filter((l) => l.length > 0);
|
|
25147
|
+
const keyValues = _OmmParser.parseKeyValues_(lines);
|
|
25148
|
+
const comments = _OmmParser.parseComments_(lines);
|
|
25149
|
+
const header = _OmmParser.parseHeader_(keyValues, comments.header);
|
|
25150
|
+
const metadata = _OmmParser.parseMetadata_(keyValues, comments.metadata);
|
|
25151
|
+
const meanElements = _OmmParser.parseMeanElements_(keyValues, comments.meanElements);
|
|
25152
|
+
const result = { header, metadata, meanElements };
|
|
25153
|
+
const spacecraftParameters = _OmmParser.parseSpacecraftParameters_(keyValues, comments.spacecraft);
|
|
25154
|
+
if (spacecraftParameters) {
|
|
25155
|
+
result.spacecraftParameters = spacecraftParameters;
|
|
25156
|
+
}
|
|
25157
|
+
const tleParameters = _OmmParser.parseTleParameters_(keyValues, comments.tle);
|
|
25158
|
+
if (tleParameters) {
|
|
25159
|
+
result.tleParameters = tleParameters;
|
|
25160
|
+
}
|
|
25161
|
+
const covarianceMatrix = _OmmParser.parseCovarianceMatrix_(keyValues, comments.covariance);
|
|
25162
|
+
if (covarianceMatrix) {
|
|
25163
|
+
result.covarianceMatrix = covarianceMatrix;
|
|
25164
|
+
}
|
|
25165
|
+
const userDefined = _OmmParser.parseUserDefined_(keyValues);
|
|
25166
|
+
if (userDefined) {
|
|
25167
|
+
result.userDefined = userDefined;
|
|
25168
|
+
}
|
|
25169
|
+
_OmmParser.validate_(result);
|
|
25170
|
+
return result;
|
|
25171
|
+
}
|
|
25172
|
+
/**
|
|
25173
|
+
* Check if a parsed OMM represents TLE-compatible data.
|
|
25174
|
+
* @param omm - Parsed OMM structure
|
|
25175
|
+
* @returns true if the OMM uses SGP, SGP4, or SGP4-XP mean element theory
|
|
25176
|
+
*/
|
|
25177
|
+
static isTleCompatible(omm) {
|
|
25178
|
+
const theory = omm.metadata.MEAN_ELEMENT_THEORY.toUpperCase();
|
|
25179
|
+
return theory === "SGP" || theory === "SGP4" || theory === "SGP4-XP";
|
|
25180
|
+
}
|
|
25181
|
+
/**
|
|
25182
|
+
* Parse all key-value pairs from OMM lines (excluding COMMENT lines).
|
|
25183
|
+
*/
|
|
25184
|
+
static parseKeyValues_(lines) {
|
|
25185
|
+
const keyValues = /* @__PURE__ */ new Map();
|
|
25186
|
+
for (const line of lines) {
|
|
25187
|
+
if (line.startsWith("COMMENT")) {
|
|
25188
|
+
continue;
|
|
25189
|
+
}
|
|
25190
|
+
if (!line.includes("=")) {
|
|
25191
|
+
continue;
|
|
25192
|
+
}
|
|
25193
|
+
const eqIndex = line.indexOf("=");
|
|
25194
|
+
const key = line.substring(0, eqIndex).trim();
|
|
25195
|
+
const value = line.substring(eqIndex + 1).trim();
|
|
25196
|
+
keyValues.set(key, value);
|
|
25197
|
+
}
|
|
25198
|
+
return keyValues;
|
|
25199
|
+
}
|
|
25200
|
+
/**
|
|
25201
|
+
* Parse COMMENT lines and assign them to sections based on position.
|
|
25202
|
+
*
|
|
25203
|
+
* Comments are assigned to sections based on the keywords that follow them.
|
|
25204
|
+
* The OMM KVN format allows comments at the beginning of each section.
|
|
25205
|
+
*/
|
|
25206
|
+
static parseComments_(lines) {
|
|
25207
|
+
const result = {
|
|
25208
|
+
header: [],
|
|
25209
|
+
metadata: [],
|
|
25210
|
+
meanElements: [],
|
|
25211
|
+
spacecraft: [],
|
|
25212
|
+
tle: [],
|
|
25213
|
+
covariance: []
|
|
25214
|
+
};
|
|
25215
|
+
let section = "header";
|
|
25216
|
+
const pendingComments = [];
|
|
25217
|
+
for (const line of lines) {
|
|
25218
|
+
if (line.startsWith("COMMENT")) {
|
|
25219
|
+
pendingComments.push(line.substring(7).trim());
|
|
25220
|
+
continue;
|
|
25221
|
+
}
|
|
25222
|
+
if (!line.includes("=")) {
|
|
25223
|
+
continue;
|
|
25224
|
+
}
|
|
25225
|
+
const eqIndex = line.indexOf("=");
|
|
25226
|
+
const key = line.substring(0, eqIndex).trim();
|
|
25227
|
+
if (key === "OBJECT_NAME") {
|
|
25228
|
+
section = "metadata";
|
|
25229
|
+
} else if (key === "EPOCH") {
|
|
25230
|
+
section = "meanElements";
|
|
25231
|
+
} else if (key === "MASS" || key === "SOLAR_RAD_AREA") {
|
|
25232
|
+
section = "spacecraft";
|
|
25233
|
+
} else if (key === "EPHEMERIS_TYPE" || key === "CLASSIFICATION_TYPE" || key === "NORAD_CAT_ID") {
|
|
25234
|
+
section = "tle";
|
|
25235
|
+
} else if (key === "COV_REF_FRAME" || key === "CX_X") {
|
|
25236
|
+
section = "covariance";
|
|
25237
|
+
}
|
|
25238
|
+
if (pendingComments.length > 0) {
|
|
25239
|
+
result[section].push(...pendingComments);
|
|
25240
|
+
pendingComments.length = 0;
|
|
25241
|
+
}
|
|
25242
|
+
}
|
|
25243
|
+
if (pendingComments.length > 0) {
|
|
25244
|
+
result[section].push(...pendingComments);
|
|
25245
|
+
}
|
|
25246
|
+
return result;
|
|
25247
|
+
}
|
|
25248
|
+
/**
|
|
25249
|
+
* Parse header section.
|
|
25250
|
+
* @see CCSDS 502.0-B-3 Table 4-1
|
|
25251
|
+
*/
|
|
25252
|
+
static parseHeader_(kv, comments) {
|
|
25253
|
+
const version = kv.get("CCSDS_OMM_VERS");
|
|
25254
|
+
if (!version) {
|
|
25255
|
+
throw new ParseError("Missing required CCSDS_OMM_VERS field", "OMM");
|
|
25256
|
+
}
|
|
25257
|
+
const creationDate = kv.get("CREATION_DATE");
|
|
25258
|
+
if (!creationDate) {
|
|
25259
|
+
throw new ParseError("Missing required CREATION_DATE field", "OMM");
|
|
25260
|
+
}
|
|
25261
|
+
const originator = kv.get("ORIGINATOR");
|
|
25262
|
+
if (!originator) {
|
|
25263
|
+
throw new ParseError("Missing required ORIGINATOR field", "OMM");
|
|
25264
|
+
}
|
|
25265
|
+
const header = {
|
|
25266
|
+
CCSDS_OMM_VERS: version,
|
|
25267
|
+
CREATION_DATE: creationDate,
|
|
25268
|
+
ORIGINATOR: originator
|
|
25269
|
+
};
|
|
25270
|
+
const messageId = kv.get("MESSAGE_ID");
|
|
25271
|
+
if (messageId) {
|
|
25272
|
+
header.MESSAGE_ID = messageId;
|
|
25273
|
+
}
|
|
25274
|
+
const classification = kv.get("CLASSIFICATION");
|
|
25275
|
+
if (classification) {
|
|
25276
|
+
header.CLASSIFICATION = classification;
|
|
25277
|
+
}
|
|
25278
|
+
if (comments.length > 0) {
|
|
25279
|
+
header.COMMENT = comments;
|
|
25280
|
+
}
|
|
25281
|
+
return header;
|
|
25282
|
+
}
|
|
25283
|
+
/**
|
|
25284
|
+
* Parse metadata section.
|
|
25285
|
+
* @see CCSDS 502.0-B-3 Table 4-2
|
|
25286
|
+
*/
|
|
25287
|
+
static parseMetadata_(kv, comments) {
|
|
25288
|
+
const objectName = kv.get("OBJECT_NAME");
|
|
25289
|
+
if (!objectName) {
|
|
25290
|
+
throw new ParseError("Missing required OBJECT_NAME field", "OMM");
|
|
25291
|
+
}
|
|
25292
|
+
const objectId = kv.get("OBJECT_ID");
|
|
25293
|
+
if (!objectId) {
|
|
25294
|
+
throw new ParseError("Missing required OBJECT_ID field", "OMM");
|
|
25295
|
+
}
|
|
25296
|
+
const centerName = kv.get("CENTER_NAME");
|
|
25297
|
+
if (!centerName) {
|
|
25298
|
+
throw new ParseError("Missing required CENTER_NAME field", "OMM");
|
|
25299
|
+
}
|
|
25300
|
+
const refFrame = kv.get("REF_FRAME");
|
|
25301
|
+
if (!refFrame) {
|
|
25302
|
+
throw new ParseError("Missing required REF_FRAME field", "OMM");
|
|
25303
|
+
}
|
|
25304
|
+
const timeSystem = kv.get("TIME_SYSTEM");
|
|
25305
|
+
if (!timeSystem) {
|
|
25306
|
+
throw new ParseError("Missing required TIME_SYSTEM field", "OMM");
|
|
25307
|
+
}
|
|
25308
|
+
const meanElementTheory = kv.get("MEAN_ELEMENT_THEORY");
|
|
25309
|
+
if (!meanElementTheory) {
|
|
25310
|
+
throw new ParseError("Missing required MEAN_ELEMENT_THEORY field", "OMM");
|
|
25311
|
+
}
|
|
25312
|
+
const metadata = {
|
|
25313
|
+
OBJECT_NAME: objectName,
|
|
25314
|
+
OBJECT_ID: objectId,
|
|
25315
|
+
CENTER_NAME: centerName,
|
|
25316
|
+
REF_FRAME: refFrame,
|
|
25317
|
+
TIME_SYSTEM: timeSystem,
|
|
25318
|
+
MEAN_ELEMENT_THEORY: meanElementTheory
|
|
25319
|
+
};
|
|
25320
|
+
const refFrameEpoch = kv.get("REF_FRAME_EPOCH");
|
|
25321
|
+
if (refFrameEpoch) {
|
|
25322
|
+
metadata.REF_FRAME_EPOCH = refFrameEpoch;
|
|
25323
|
+
}
|
|
25324
|
+
if (comments.length > 0) {
|
|
25325
|
+
metadata.COMMENT = comments;
|
|
25326
|
+
}
|
|
25327
|
+
return metadata;
|
|
25328
|
+
}
|
|
25329
|
+
/**
|
|
25330
|
+
* Parse mean Keplerian elements section.
|
|
25331
|
+
* @see CCSDS 502.0-B-3 Table 4-3
|
|
25332
|
+
*/
|
|
25333
|
+
static parseMeanElements_(kv, comments) {
|
|
25334
|
+
const epoch = kv.get("EPOCH");
|
|
25335
|
+
if (!epoch) {
|
|
25336
|
+
throw new ParseError("Missing required EPOCH field", "OMM");
|
|
25337
|
+
}
|
|
25338
|
+
const semiMajorAxis = _OmmParser.parseOptionalFloat_(kv, "SEMI_MAJOR_AXIS");
|
|
25339
|
+
const meanMotion = _OmmParser.parseOptionalFloat_(kv, "MEAN_MOTION");
|
|
25340
|
+
if (semiMajorAxis === void 0 && meanMotion === void 0) {
|
|
25341
|
+
throw new ParseError("Either SEMI_MAJOR_AXIS or MEAN_MOTION must be provided", "OMM");
|
|
25342
|
+
}
|
|
25343
|
+
const eccentricity = _OmmParser.parseRequiredFloat_(kv, "ECCENTRICITY");
|
|
25344
|
+
const inclination = _OmmParser.parseRequiredFloat_(kv, "INCLINATION");
|
|
25345
|
+
const raOfAscNode = _OmmParser.parseRequiredFloat_(kv, "RA_OF_ASC_NODE");
|
|
25346
|
+
const argOfPericenter = _OmmParser.parseRequiredFloat_(kv, "ARG_OF_PERICENTER");
|
|
25347
|
+
const meanAnomaly = _OmmParser.parseRequiredFloat_(kv, "MEAN_ANOMALY");
|
|
25348
|
+
const elements = {
|
|
25349
|
+
EPOCH: epoch,
|
|
25350
|
+
ECCENTRICITY: eccentricity,
|
|
25351
|
+
INCLINATION: inclination,
|
|
25352
|
+
RA_OF_ASC_NODE: raOfAscNode,
|
|
25353
|
+
ARG_OF_PERICENTER: argOfPericenter,
|
|
25354
|
+
MEAN_ANOMALY: meanAnomaly
|
|
25355
|
+
};
|
|
25356
|
+
if (semiMajorAxis !== void 0) {
|
|
25357
|
+
elements.SEMI_MAJOR_AXIS = semiMajorAxis;
|
|
25358
|
+
}
|
|
25359
|
+
if (meanMotion !== void 0) {
|
|
25360
|
+
elements.MEAN_MOTION = meanMotion;
|
|
25361
|
+
}
|
|
25362
|
+
const gm = _OmmParser.parseOptionalFloat_(kv, "GM");
|
|
25363
|
+
if (gm !== void 0) {
|
|
25364
|
+
elements.GM = gm;
|
|
25365
|
+
}
|
|
25366
|
+
if (comments.length > 0) {
|
|
25367
|
+
elements.COMMENT = comments;
|
|
25368
|
+
}
|
|
25369
|
+
return elements;
|
|
25370
|
+
}
|
|
25371
|
+
/**
|
|
25372
|
+
* Parse optional spacecraft parameters section.
|
|
25373
|
+
* @see CCSDS 502.0-B-3 Table 4-3
|
|
25374
|
+
*/
|
|
25375
|
+
static parseSpacecraftParameters_(kv, comments) {
|
|
25376
|
+
const mass = _OmmParser.parseOptionalFloat_(kv, "MASS");
|
|
25377
|
+
const solarRadArea = _OmmParser.parseOptionalFloat_(kv, "SOLAR_RAD_AREA");
|
|
25378
|
+
const solarRadCoeff = _OmmParser.parseOptionalFloat_(kv, "SOLAR_RAD_COEFF");
|
|
25379
|
+
const dragArea = _OmmParser.parseOptionalFloat_(kv, "DRAG_AREA");
|
|
25380
|
+
const dragCoeff = _OmmParser.parseOptionalFloat_(kv, "DRAG_COEFF");
|
|
25381
|
+
if (mass === void 0 && solarRadArea === void 0 && solarRadCoeff === void 0 && dragArea === void 0 && dragCoeff === void 0 && comments.length === 0) {
|
|
25382
|
+
return null;
|
|
25383
|
+
}
|
|
25384
|
+
const params = {};
|
|
25385
|
+
if (mass !== void 0) {
|
|
25386
|
+
params.MASS = mass;
|
|
25387
|
+
}
|
|
25388
|
+
if (solarRadArea !== void 0) {
|
|
25389
|
+
params.SOLAR_RAD_AREA = solarRadArea;
|
|
25390
|
+
}
|
|
25391
|
+
if (solarRadCoeff !== void 0) {
|
|
25392
|
+
params.SOLAR_RAD_COEFF = solarRadCoeff;
|
|
25393
|
+
}
|
|
25394
|
+
if (dragArea !== void 0) {
|
|
25395
|
+
params.DRAG_AREA = dragArea;
|
|
25396
|
+
}
|
|
25397
|
+
if (dragCoeff !== void 0) {
|
|
25398
|
+
params.DRAG_COEFF = dragCoeff;
|
|
25399
|
+
}
|
|
25400
|
+
if (comments.length > 0) {
|
|
25401
|
+
params.COMMENT = comments;
|
|
25402
|
+
}
|
|
25403
|
+
return params;
|
|
25404
|
+
}
|
|
25405
|
+
/**
|
|
25406
|
+
* Parse optional TLE-related parameters section.
|
|
25407
|
+
* @see CCSDS 502.0-B-3 Table 4-3
|
|
25408
|
+
*/
|
|
25409
|
+
static parseTleParameters_(kv, comments) {
|
|
25410
|
+
const ephemerisType = _OmmParser.parseOptionalInt_(kv, "EPHEMERIS_TYPE");
|
|
25411
|
+
const classificationType = kv.get("CLASSIFICATION_TYPE");
|
|
25412
|
+
const noradCatId = _OmmParser.parseOptionalInt_(kv, "NORAD_CAT_ID");
|
|
25413
|
+
const elementSetNo = _OmmParser.parseOptionalInt_(kv, "ELEMENT_SET_NO");
|
|
25414
|
+
const revAtEpoch = _OmmParser.parseOptionalInt_(kv, "REV_AT_EPOCH");
|
|
25415
|
+
const bstar = _OmmParser.parseOptionalFloat_(kv, "BSTAR");
|
|
25416
|
+
const bterm = _OmmParser.parseOptionalFloat_(kv, "BTERM");
|
|
25417
|
+
const meanMotionDot = _OmmParser.parseOptionalFloat_(kv, "MEAN_MOTION_DOT");
|
|
25418
|
+
const meanMotionDdot = _OmmParser.parseOptionalFloat_(kv, "MEAN_MOTION_DDOT");
|
|
25419
|
+
const agom = _OmmParser.parseOptionalFloat_(kv, "AGOM");
|
|
25420
|
+
if (ephemerisType === void 0 && classificationType === void 0 && noradCatId === void 0 && elementSetNo === void 0 && revAtEpoch === void 0 && bstar === void 0 && bterm === void 0 && meanMotionDot === void 0 && meanMotionDdot === void 0 && agom === void 0 && comments.length === 0) {
|
|
25421
|
+
return null;
|
|
25422
|
+
}
|
|
25423
|
+
const params = {};
|
|
25424
|
+
if (ephemerisType !== void 0) {
|
|
25425
|
+
params.EPHEMERIS_TYPE = ephemerisType;
|
|
25426
|
+
}
|
|
25427
|
+
if (classificationType !== void 0) {
|
|
25428
|
+
params.CLASSIFICATION_TYPE = classificationType;
|
|
25429
|
+
}
|
|
25430
|
+
if (noradCatId !== void 0) {
|
|
25431
|
+
params.NORAD_CAT_ID = noradCatId;
|
|
25432
|
+
}
|
|
25433
|
+
if (elementSetNo !== void 0) {
|
|
25434
|
+
params.ELEMENT_SET_NO = elementSetNo;
|
|
25435
|
+
}
|
|
25436
|
+
if (revAtEpoch !== void 0) {
|
|
25437
|
+
params.REV_AT_EPOCH = revAtEpoch;
|
|
25438
|
+
}
|
|
25439
|
+
if (bstar !== void 0) {
|
|
25440
|
+
params.BSTAR = bstar;
|
|
25441
|
+
}
|
|
25442
|
+
if (bterm !== void 0) {
|
|
25443
|
+
params.BTERM = bterm;
|
|
25444
|
+
}
|
|
25445
|
+
if (meanMotionDot !== void 0) {
|
|
25446
|
+
params.MEAN_MOTION_DOT = meanMotionDot;
|
|
25447
|
+
}
|
|
25448
|
+
if (meanMotionDdot !== void 0) {
|
|
25449
|
+
params.MEAN_MOTION_DDOT = meanMotionDdot;
|
|
25450
|
+
}
|
|
25451
|
+
if (agom !== void 0) {
|
|
25452
|
+
params.AGOM = agom;
|
|
25453
|
+
}
|
|
25454
|
+
if (comments.length > 0) {
|
|
25455
|
+
params.COMMENT = comments;
|
|
25456
|
+
}
|
|
25457
|
+
return params;
|
|
25458
|
+
}
|
|
25459
|
+
/**
|
|
25460
|
+
* Parse optional covariance matrix section.
|
|
25461
|
+
* @see CCSDS 502.0-B-3 Table 4-3
|
|
25462
|
+
*/
|
|
25463
|
+
static parseCovarianceMatrix_(kv, comments) {
|
|
25464
|
+
const cxX = _OmmParser.parseOptionalFloat_(kv, "CX_X");
|
|
25465
|
+
if (cxX === void 0) {
|
|
25466
|
+
return null;
|
|
25467
|
+
}
|
|
25468
|
+
const cov = {
|
|
25469
|
+
CX_X: cxX,
|
|
25470
|
+
CY_X: _OmmParser.parseOptionalFloat_(kv, "CY_X"),
|
|
25471
|
+
CY_Y: _OmmParser.parseOptionalFloat_(kv, "CY_Y"),
|
|
25472
|
+
CZ_X: _OmmParser.parseOptionalFloat_(kv, "CZ_X"),
|
|
25473
|
+
CZ_Y: _OmmParser.parseOptionalFloat_(kv, "CZ_Y"),
|
|
25474
|
+
CZ_Z: _OmmParser.parseOptionalFloat_(kv, "CZ_Z"),
|
|
25475
|
+
CX_DOT_X: _OmmParser.parseOptionalFloat_(kv, "CX_DOT_X"),
|
|
25476
|
+
CX_DOT_Y: _OmmParser.parseOptionalFloat_(kv, "CX_DOT_Y"),
|
|
25477
|
+
CX_DOT_Z: _OmmParser.parseOptionalFloat_(kv, "CX_DOT_Z"),
|
|
25478
|
+
CX_DOT_X_DOT: _OmmParser.parseOptionalFloat_(kv, "CX_DOT_X_DOT"),
|
|
25479
|
+
CY_DOT_X: _OmmParser.parseOptionalFloat_(kv, "CY_DOT_X"),
|
|
25480
|
+
CY_DOT_Y: _OmmParser.parseOptionalFloat_(kv, "CY_DOT_Y"),
|
|
25481
|
+
CY_DOT_Z: _OmmParser.parseOptionalFloat_(kv, "CY_DOT_Z"),
|
|
25482
|
+
CY_DOT_X_DOT: _OmmParser.parseOptionalFloat_(kv, "CY_DOT_X_DOT"),
|
|
25483
|
+
CY_DOT_Y_DOT: _OmmParser.parseOptionalFloat_(kv, "CY_DOT_Y_DOT"),
|
|
25484
|
+
CZ_DOT_X: _OmmParser.parseOptionalFloat_(kv, "CZ_DOT_X"),
|
|
25485
|
+
CZ_DOT_Y: _OmmParser.parseOptionalFloat_(kv, "CZ_DOT_Y"),
|
|
25486
|
+
CZ_DOT_Z: _OmmParser.parseOptionalFloat_(kv, "CZ_DOT_Z"),
|
|
25487
|
+
CZ_DOT_X_DOT: _OmmParser.parseOptionalFloat_(kv, "CZ_DOT_X_DOT"),
|
|
25488
|
+
CZ_DOT_Y_DOT: _OmmParser.parseOptionalFloat_(kv, "CZ_DOT_Y_DOT"),
|
|
25489
|
+
CZ_DOT_Z_DOT: _OmmParser.parseOptionalFloat_(kv, "CZ_DOT_Z_DOT")
|
|
25490
|
+
};
|
|
25491
|
+
const covRefFrame = kv.get("COV_REF_FRAME");
|
|
25492
|
+
if (covRefFrame) {
|
|
25493
|
+
cov.COV_REF_FRAME = covRefFrame;
|
|
25494
|
+
}
|
|
25495
|
+
if (comments.length > 0) {
|
|
25496
|
+
cov.COMMENT = comments;
|
|
25497
|
+
}
|
|
25498
|
+
return cov;
|
|
25499
|
+
}
|
|
25500
|
+
/**
|
|
25501
|
+
* Parse user-defined parameters section.
|
|
25502
|
+
*/
|
|
25503
|
+
static parseUserDefined_(kv) {
|
|
25504
|
+
const userDefined = {};
|
|
25505
|
+
let found = false;
|
|
25506
|
+
for (const [key, value] of kv) {
|
|
25507
|
+
if (key.startsWith("USER_DEFINED_")) {
|
|
25508
|
+
userDefined[key] = value;
|
|
25509
|
+
found = true;
|
|
25510
|
+
}
|
|
25511
|
+
}
|
|
25512
|
+
return found ? userDefined : null;
|
|
25513
|
+
}
|
|
25514
|
+
/**
|
|
25515
|
+
* Parse a required float field.
|
|
25516
|
+
* @throws ParseError if the field is missing or not a valid number
|
|
25517
|
+
*/
|
|
25518
|
+
static parseRequiredFloat_(kv, key) {
|
|
25519
|
+
const value = kv.get(key);
|
|
25520
|
+
if (value === void 0) {
|
|
25521
|
+
throw new ParseError(`Missing required ${key} field`, "OMM");
|
|
25522
|
+
}
|
|
25523
|
+
const parsed = parseFloat(value);
|
|
25524
|
+
if (isNaN(parsed)) {
|
|
25525
|
+
throw new ParseError(`Invalid numeric value for ${key}: ${value}`, "OMM");
|
|
25526
|
+
}
|
|
25527
|
+
return parsed;
|
|
25528
|
+
}
|
|
25529
|
+
/**
|
|
25530
|
+
* Parse an optional float field.
|
|
25531
|
+
*/
|
|
25532
|
+
static parseOptionalFloat_(kv, key) {
|
|
25533
|
+
const value = kv.get(key);
|
|
25534
|
+
if (value === void 0) {
|
|
25535
|
+
return void 0;
|
|
25536
|
+
}
|
|
25537
|
+
const parsed = parseFloat(value);
|
|
25538
|
+
return isNaN(parsed) ? void 0 : parsed;
|
|
25539
|
+
}
|
|
25540
|
+
/**
|
|
25541
|
+
* Parse an optional integer field.
|
|
25542
|
+
*/
|
|
25543
|
+
static parseOptionalInt_(kv, key) {
|
|
25544
|
+
const value = kv.get(key);
|
|
25545
|
+
if (value === void 0) {
|
|
25546
|
+
return void 0;
|
|
25547
|
+
}
|
|
25548
|
+
const parsed = parseInt(value, 10);
|
|
25549
|
+
return isNaN(parsed) ? void 0 : parsed;
|
|
25550
|
+
}
|
|
25551
|
+
/**
|
|
25552
|
+
* Validate parsed OMM for required fields and consistency.
|
|
25553
|
+
* @throws ParseError if validation fails
|
|
25554
|
+
*/
|
|
25555
|
+
static validate_(omm) {
|
|
25556
|
+
const errors = [];
|
|
25557
|
+
if (!omm.header.CCSDS_OMM_VERS) {
|
|
25558
|
+
errors.push("Missing CCSDS_OMM_VERS");
|
|
25559
|
+
}
|
|
25560
|
+
if (!omm.header.CREATION_DATE) {
|
|
25561
|
+
errors.push("Missing CREATION_DATE");
|
|
25562
|
+
}
|
|
25563
|
+
if (!omm.header.ORIGINATOR) {
|
|
25564
|
+
errors.push("Missing ORIGINATOR");
|
|
25565
|
+
}
|
|
25566
|
+
if (!omm.metadata.OBJECT_NAME) {
|
|
25567
|
+
errors.push("Missing OBJECT_NAME");
|
|
25568
|
+
}
|
|
25569
|
+
if (!omm.metadata.OBJECT_ID) {
|
|
25570
|
+
errors.push("Missing OBJECT_ID");
|
|
25571
|
+
}
|
|
25572
|
+
if (!omm.metadata.CENTER_NAME) {
|
|
25573
|
+
errors.push("Missing CENTER_NAME");
|
|
25574
|
+
}
|
|
25575
|
+
if (!omm.metadata.REF_FRAME) {
|
|
25576
|
+
errors.push("Missing REF_FRAME");
|
|
25577
|
+
}
|
|
25578
|
+
if (!omm.metadata.TIME_SYSTEM) {
|
|
25579
|
+
errors.push("Missing TIME_SYSTEM");
|
|
25580
|
+
}
|
|
25581
|
+
if (!omm.metadata.MEAN_ELEMENT_THEORY) {
|
|
25582
|
+
errors.push("Missing MEAN_ELEMENT_THEORY");
|
|
25583
|
+
}
|
|
25584
|
+
if (!omm.meanElements.EPOCH) {
|
|
25585
|
+
errors.push("Missing EPOCH");
|
|
25586
|
+
}
|
|
25587
|
+
if (omm.meanElements.SEMI_MAJOR_AXIS === void 0 && omm.meanElements.MEAN_MOTION === void 0) {
|
|
25588
|
+
errors.push("Either SEMI_MAJOR_AXIS or MEAN_MOTION must be provided");
|
|
25589
|
+
}
|
|
25590
|
+
const theory = omm.metadata.MEAN_ELEMENT_THEORY?.toUpperCase();
|
|
25591
|
+
if (theory === "SGP" || theory === "SGP4") {
|
|
25592
|
+
if (omm.meanElements.MEAN_MOTION === void 0) {
|
|
25593
|
+
errors.push("MEAN_MOTION is required when MEAN_ELEMENT_THEORY is SGP/SGP4");
|
|
25594
|
+
}
|
|
25595
|
+
}
|
|
25596
|
+
if (theory === "SGP" || theory === "SGP4" || theory === "SGP4-XP") {
|
|
25597
|
+
if (omm.metadata.CENTER_NAME !== "EARTH") {
|
|
25598
|
+
errors.push("CENTER_NAME must be EARTH for SGP/SGP4/SGP4-XP mean element theory");
|
|
25599
|
+
}
|
|
25600
|
+
if (omm.metadata.REF_FRAME !== "TEME") {
|
|
25601
|
+
errors.push("REF_FRAME must be TEME for SGP/SGP4/SGP4-XP mean element theory");
|
|
25602
|
+
}
|
|
25603
|
+
if (omm.metadata.TIME_SYSTEM !== "UTC") {
|
|
25604
|
+
errors.push("TIME_SYSTEM must be UTC for SGP/SGP4/SGP4-XP mean element theory");
|
|
25605
|
+
}
|
|
25606
|
+
}
|
|
25607
|
+
if (omm.covarianceMatrix) {
|
|
25608
|
+
const covKeys = [
|
|
25609
|
+
"CX_X",
|
|
25610
|
+
"CY_X",
|
|
25611
|
+
"CY_Y",
|
|
25612
|
+
"CZ_X",
|
|
25613
|
+
"CZ_Y",
|
|
25614
|
+
"CZ_Z",
|
|
25615
|
+
"CX_DOT_X",
|
|
25616
|
+
"CX_DOT_Y",
|
|
25617
|
+
"CX_DOT_Z",
|
|
25618
|
+
"CX_DOT_X_DOT",
|
|
25619
|
+
"CY_DOT_X",
|
|
25620
|
+
"CY_DOT_Y",
|
|
25621
|
+
"CY_DOT_Z",
|
|
25622
|
+
"CY_DOT_X_DOT",
|
|
25623
|
+
"CY_DOT_Y_DOT",
|
|
25624
|
+
"CZ_DOT_X",
|
|
25625
|
+
"CZ_DOT_Y",
|
|
25626
|
+
"CZ_DOT_Z",
|
|
25627
|
+
"CZ_DOT_X_DOT",
|
|
25628
|
+
"CZ_DOT_Y_DOT",
|
|
25629
|
+
"CZ_DOT_Z_DOT"
|
|
25630
|
+
];
|
|
25631
|
+
const missing = covKeys.filter((k) => omm.covarianceMatrix[k] === void 0);
|
|
25632
|
+
if (missing.length > 0 && missing.length < covKeys.length) {
|
|
25633
|
+
errors.push(`Incomplete covariance matrix: missing ${missing.join(", ")}`);
|
|
25634
|
+
}
|
|
25635
|
+
}
|
|
25636
|
+
if (errors.length > 0) {
|
|
25637
|
+
throw new ParseError(`OMM validation failed: ${errors.join(", ")}`, "OMM");
|
|
25638
|
+
}
|
|
25639
|
+
}
|
|
25640
|
+
};
|
|
25641
|
+
|
|
25126
25642
|
// src/comm/CommTypes.ts
|
|
25127
25643
|
var ModulationType = /* @__PURE__ */ ((ModulationType3) => {
|
|
25128
25644
|
ModulationType3["BPSK"] = "BPSK";
|
|
@@ -29261,4 +29777,4 @@ astronomy-engine/esm/astronomy.js:
|
|
|
29261
29777
|
*)
|
|
29262
29778
|
*/
|
|
29263
29779
|
|
|
29264
|
-
export { AccessCalculator, AngularDiameterMethod, AngularDistanceMethod, Antenna, AtmosphericDrag, BaseObject, BatchLeastSquaresOD, BatchLeastSquaresResult, Beacon, BoxMuller, CatalogScreener, CatalogSource, CdmExporter, CdmParser, CelestialBody, CelestialBodyType, CenterBody, CenterBodyMu, ChebyshevCoefficients, ChebyshevCompressor, ChebyshevInterpolator, ClassicalElements, CommDeviceType, CommLink, CommunicationDevice, ConjunctionAssessment, ConjunctionEvent, ConstellationGenerator, ContactScheduler, ContactSelectionStrategy, CovarianceFrame, CovarianceRealism, CovarianceSample, CubicSpline, CubicSplineInterpolator, DEFAULT_INTERPOLATOR, DEFAULT_LAGRANGE_ORDER, DEG2RAD, DataHandler, DormandPrince54Propagator, DownhillSimplex, DynamicGroundObject, Earth, EarthGravity, EphemerisBody, EphemerisSatellite, Epoch, EpochGPS, EpochTAI, EpochTDB, EpochTT, EpochUTC, EpochWindow, EquinoctialElements, EulerAngles, FieldInterpolator, FieldOfView, Force, ForceModel, FormatTle, FovFrame, FovShape, Geodetic, GibbsIOD, GoldenSection, GoodingIOD, Gravity, GroundObject, GroundStation, HerrickGibbsIOD, Hill, History, HorizonsParser, ITRF, Interpolator, InterpolatorType, J20002 as J2000, Jupiter, KM_PER_AU, KeplerPropagator, LagrangeInterpolator, LambertIOD, LandObject, LaserRangingSensor, LaunchTrajectoryGenerator, LevenbergMarquardtOD, LevenbergMarquardtResult, MILLISECONDS_PER_DAY, MILLISECONDS_PER_SECOND, MILLISECONDS_TO_DAYS, MINUTES_PER_DAY, MS_PER_DAY, Marker, Mars, Matrix, MechanicalRadar, Mercury, ModifiedGoodingIOD, ModulationType, Moon, MoonBody, Neptune, OdmExporter, OemParser, OotkError, OpticalSensor, OrbitDeterminationError, OrbitFinder, OrbitRegime, PI, ParseError, PassType, PassiveRFSensor, PayloadStatus, PhasedArrayRadar, PlaneChangeBurn, PlanetBody, Pluto, PolynomialRegression, ProbabilityOfCollision, PropagationError, Propagator, PropagatorType, Quaternion, RAD2DEG, RADIUS_OF_EARTH, RAE, RIC, RadarSensor, RadecGeocentric, RadecTopocentric, Random, RandomGaussianSource, Receiver, RelativeState, RepeatGroundTrack, RkCheckpoint, RkResult, RungeKutta4Propagator, RungeKutta89Propagator, RungeKuttaAdaptive, SLR_WAVELENGTHS, SPEED_OF_LIGHT_KM_S, Satellite, Saturn, ScheduledContact, ScreeningFilter, SegmentedLagrangeInterpolator, Sensor, SensorType, Sgp4, Sgp4Error, Sgp4ErrorCode, Sgp4OpsMode, Sgp4Propagator, SimpleLinearRegression, SolarRadiationPressure, SolarSystem, SpaceObject, SpaceObjectType, Star, StateCovariance, StateInterpolator, StateVector2 as StateVector, Sun, SunBody, SunStatus, TAU, TEME, ThirdBodyGravity, Thrust, TimeStamped, Tle, Transmitter, Transponder, TwoBurnOrbitTransfer, Uranus, ValidationError, Vector, Vector3D, Venus, VerletBlendInterpolator, VisualizationHelpers, Waypoint, ZoomValue, acoth, acsch, angularDiameter, angularDistance, angularVelocityOfEarth, array2d, asec2rad, asech, azel2uv, bodyTypeLookup, boresightFrameFromAzElRoll, cKmPerMs, cKmPerSec, cMPerSec, calcGmst, calcIncFromAz, calcInertAz, calculateFspl, calculatePropagationDelay, clamp, concat, copySign, covariance, createCovarianceFromTle, createSampleCovarianceFromTle, createVec, csch, dbmToDbw, dbwToDbm, dbwToWatts, deg2rad, derivative, dopplerFactor, earthGravityParam, ecef2eci, ecef2enu, ecef2rae, ecefRad2rae, eci2ecef, eci2lla, eci2rae, enu2rf, estimateRcs, evalPoly, factorial, gamma, getDayOfYear, getDegLat, getDegLon, getRadLat, getRadLon, halfPi, isLeapYear, jacobian, jday, linearDistance, linearInterpolate, lla2ecef, lla2eci, lla2sez, llaRad2ecef, log10, mag2db, masec2rad, matchHalfPlane, mean, msec2sec, newtonM, newtonNu, normalizeAngle, observationDerivative, observationNoiseFromSigmas, parseCenterBody, rad2deg, radecToPosition, radecToVelocity, rae2ecef, rae2eci, rae2enu, rae2raeOffBoresight, rae2ruv, rae2sez, relativeVelocity, sec2day, sec2deg, sec2min, sech, secondsPerDay, secondsPerSiderealDay, secondsPerWeek, sez2rae, sign, spaceObjType2Str, std, temp4, toPrecision, ttasec2rad, uv2azel, wattsToDbw, wrapAngle, x2o3 };
|
|
29780
|
+
export { AccessCalculator, AngularDiameterMethod, AngularDistanceMethod, Antenna, AtmosphericDrag, BaseObject, BatchLeastSquaresOD, BatchLeastSquaresResult, Beacon, BoxMuller, CatalogScreener, CatalogSource, CdmExporter, CdmParser, CelestialBody, CelestialBodyType, CenterBody, CenterBodyMu, ChebyshevCoefficients, ChebyshevCompressor, ChebyshevInterpolator, ClassicalElements, CommDeviceType, CommLink, CommunicationDevice, ConjunctionAssessment, ConjunctionEvent, ConstellationGenerator, ContactScheduler, ContactSelectionStrategy, CovarianceFrame, CovarianceRealism, CovarianceSample, CubicSpline, CubicSplineInterpolator, DEFAULT_INTERPOLATOR, DEFAULT_LAGRANGE_ORDER, DEG2RAD, DataHandler, DormandPrince54Propagator, DownhillSimplex, DynamicGroundObject, Earth, EarthGravity, EphemerisBody, EphemerisSatellite, Epoch, EpochGPS, EpochTAI, EpochTDB, EpochTT, EpochUTC, EpochWindow, EquinoctialElements, EulerAngles, FieldInterpolator, FieldOfView, Force, ForceModel, FormatTle, FovFrame, FovShape, Geodetic, GibbsIOD, GoldenSection, GoodingIOD, Gravity, GroundObject, GroundStation, HerrickGibbsIOD, Hill, History, HorizonsParser, ITRF, Interpolator, InterpolatorType, J20002 as J2000, Jupiter, KM_PER_AU, KeplerPropagator, LagrangeInterpolator, LambertIOD, LandObject, LaserRangingSensor, LaunchTrajectoryGenerator, LevenbergMarquardtOD, LevenbergMarquardtResult, MILLISECONDS_PER_DAY, MILLISECONDS_PER_SECOND, MILLISECONDS_TO_DAYS, MINUTES_PER_DAY, MS_PER_DAY, Marker, Mars, Matrix, MechanicalRadar, Mercury, ModifiedGoodingIOD, ModulationType, Moon, MoonBody, Neptune, OdmExporter, OemParser, OmmParser, OotkError, OpticalSensor, OrbitDeterminationError, OrbitFinder, OrbitRegime, PI, ParseError, PassType, PassiveRFSensor, PayloadStatus, PhasedArrayRadar, PlaneChangeBurn, PlanetBody, Pluto, PolynomialRegression, ProbabilityOfCollision, PropagationError, Propagator, PropagatorType, Quaternion, RAD2DEG, RADIUS_OF_EARTH, RAE, RIC, RadarSensor, RadecGeocentric, RadecTopocentric, Random, RandomGaussianSource, Receiver, RelativeState, RepeatGroundTrack, RkCheckpoint, RkResult, RungeKutta4Propagator, RungeKutta89Propagator, RungeKuttaAdaptive, SLR_WAVELENGTHS, SPEED_OF_LIGHT_KM_S, Satellite, Saturn, ScheduledContact, ScreeningFilter, SegmentedLagrangeInterpolator, Sensor, SensorType, Sgp4, Sgp4Error, Sgp4ErrorCode, Sgp4OpsMode, Sgp4Propagator, SimpleLinearRegression, SolarRadiationPressure, SolarSystem, SpaceObject, SpaceObjectType, Star, StateCovariance, StateInterpolator, StateVector2 as StateVector, Sun, SunBody, SunStatus, TAU, TEME, ThirdBodyGravity, Thrust, TimeStamped, Tle, Transmitter, Transponder, TwoBurnOrbitTransfer, Uranus, ValidationError, Vector, Vector3D, Venus, VerletBlendInterpolator, VisualizationHelpers, Waypoint, ZoomValue, acoth, acsch, angularDiameter, angularDistance, angularVelocityOfEarth, array2d, asec2rad, asech, azel2uv, bodyTypeLookup, boresightFrameFromAzElRoll, cKmPerMs, cKmPerSec, cMPerSec, calcGmst, calcIncFromAz, calcInertAz, calculateFspl, calculatePropagationDelay, clamp, concat, copySign, covariance, createCovarianceFromTle, createSampleCovarianceFromTle, createVec, csch, dbmToDbw, dbwToDbm, dbwToWatts, deg2rad, derivative, dopplerFactor, earthGravityParam, ecef2eci, ecef2enu, ecef2rae, ecefRad2rae, eci2ecef, eci2lla, eci2rae, enu2rf, estimateRcs, evalPoly, factorial, gamma, getDayOfYear, getDegLat, getDegLon, getRadLat, getRadLon, halfPi, isLeapYear, jacobian, jday, linearDistance, linearInterpolate, lla2ecef, lla2eci, lla2sez, llaRad2ecef, log10, mag2db, masec2rad, matchHalfPlane, mean, msec2sec, newtonM, newtonNu, normalizeAngle, observationDerivative, observationNoiseFromSigmas, parseCenterBody, rad2deg, radecToPosition, radecToVelocity, rae2ecef, rae2eci, rae2enu, rae2raeOffBoresight, rae2ruv, rae2sez, relativeVelocity, sec2day, sec2deg, sec2min, sech, secondsPerDay, secondsPerSiderealDay, secondsPerWeek, sez2rae, sign, spaceObjType2Str, std, temp4, toPrecision, ttasec2rad, uv2azel, wattsToDbw, wrapAngle, x2o3 };
|