diff --git a/src/commands/dispatch-dump.ts b/src/commands/dispatch-dump.ts index 6b511c3..1bb85f6 100644 --- a/src/commands/dispatch-dump.ts +++ b/src/commands/dispatch-dump.ts @@ -80,6 +80,7 @@ const dispatch = async ({ const bankFiles = getFitsFromDirectory({ directory: bankDirectory, projectDirectory, + sequenceId: asiAirFiles[asiAirFiles.length - 1].sequenceId, }); logger.info(`Found ${bankFiles.length} files in the bank.`); bankFiles.forEach(file => { diff --git a/src/tests/e2e/__snapshots__/e2e-testing.spec.ts.snap b/src/tests/e2e/__snapshots__/e2e-testing.spec.ts.snap index bd2322a..d315fd8 100644 --- a/src/tests/e2e/__snapshots__/e2e-testing.spec.ts.snap +++ b/src/tests/e2e/__snapshots__/e2e-testing.spec.ts.snap @@ -12,7 +12,7 @@ exports[`E2E should be neat 2`] = ` "darkSet": "Dark_120.0s_Bin1_L_gain0", "biasSet": "Bias_1.0ms_Bin1_gain100", "lightsCount": 1, - "flatsCount": 3, + "flatsCount": 6, "darksCount": 1, "biasesCount": 3, "lights": [ @@ -23,13 +23,14 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": "S", "gain": 0, - "sequence": 1, - "datetime": "2024-06-24T01:08:50.000Z", + "sequenceId": 5, + "sequenceNumber": 1, + "datetime": "2024-06-26T01:08:50.000Z", "temperature": "-10.1C", - "fileName": "Light_FOV_120.0s_Bin1_S_gain0_20240624-010850_-10.1C_0001.fit", + "fileName": "Light_FOV_120.0s_Bin1_S_gain0_20240626-010850_-10.1C_0001.fit", "extension": "fit", "sourceDirectory": "tmp/asiair-dump/Autorun/Light/FOV", - "sourceFilePath": "tmp/asiair-dump/Autorun/Light/FOV/Light_FOV_120.0s_Bin1_S_gain0_20240624-010850_-10.1C_0001.fit", + "sourceFilePath": "tmp/asiair-dump/Autorun/Light/FOV/Light_FOV_120.0s_Bin1_S_gain0_20240626-010850_-10.1C_0001.fit", "projectDirectory": "tmp/project/S/Light_120.0s_Bin1_S_gain0" } ], @@ -41,7 +42,8 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": "L", "gain": 0, - "sequence": 1, + "sequenceId": 10, + "sequenceNumber": 1, "datetime": "2024-03-08T15:57:22.000Z", "temperature": "-10.0C", "fileName": "Dark_120.0s_Bin1_L_gain0_20240308-155722_-10.0C_0001.fit", @@ -59,13 +61,14 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": "S", "gain": 100, - "sequence": 1, - "datetime": "2024-05-11T09:43:04.000Z", + "sequenceId": 2, + "sequenceNumber": 1, + "datetime": "2024-06-24T09:43:04.000Z", "temperature": "-10.5C", - "fileName": "Flat_1.0ms_Bin1_S_gain100_20240511-094304_-10.5C_0001.fit", + "fileName": "Flat_1.0ms_Bin1_S_gain100_20240624-094304_-10.5C_0001.fit", "extension": "fit", "sourceDirectory": "tmp/asiair-dump/Autorun/Flat", - "sourceFilePath": "tmp/asiair-dump/Autorun/Flat/Flat_1.0ms_Bin1_S_gain100_20240511-094304_-10.5C_0001.fit", + "sourceFilePath": "tmp/asiair-dump/Autorun/Flat/Flat_1.0ms_Bin1_S_gain100_20240624-094304_-10.5C_0001.fit", "projectDirectory": "tmp/project/S/Flat_1.0ms_Bin1_S_gain100" }, { @@ -75,13 +78,14 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": "S", "gain": 100, - "sequence": 2, - "datetime": "2024-05-11T09:43:05.000Z", + "sequenceId": 2, + "sequenceNumber": 2, + "datetime": "2024-06-24T09:43:05.000Z", "temperature": "-10.0C", - "fileName": "Flat_1.0ms_Bin1_S_gain100_20240511-094305_-10.0C_0002.fit", + "fileName": "Flat_1.0ms_Bin1_S_gain100_20240624-094305_-10.0C_0002.fit", "extension": "fit", "sourceDirectory": "tmp/asiair-dump/Autorun/Flat", - "sourceFilePath": "tmp/asiair-dump/Autorun/Flat/Flat_1.0ms_Bin1_S_gain100_20240511-094305_-10.0C_0002.fit", + "sourceFilePath": "tmp/asiair-dump/Autorun/Flat/Flat_1.0ms_Bin1_S_gain100_20240624-094305_-10.0C_0002.fit", "projectDirectory": "tmp/project/S/Flat_1.0ms_Bin1_S_gain100" }, { @@ -91,13 +95,65 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": "S", "gain": 100, - "sequence": 3, - "datetime": "2024-05-11T09:43:06.000Z", + "sequenceId": 2, + "sequenceNumber": 3, + "datetime": "2024-06-24T09:43:06.000Z", + "temperature": "-10.5C", + "fileName": "Flat_1.0ms_Bin1_S_gain100_20240624-094306_-10.5C_0003.fit", + "extension": "fit", + "sourceDirectory": "tmp/asiair-dump/Autorun/Flat", + "sourceFilePath": "tmp/asiair-dump/Autorun/Flat/Flat_1.0ms_Bin1_S_gain100_20240624-094306_-10.5C_0003.fit", + "projectDirectory": "tmp/project/S/Flat_1.0ms_Bin1_S_gain100" + }, + { + "setName": "Flat_1.0ms_Bin1_S_gain100", + "type": "Flat", + "bulb": "1.0ms", + "bin": "Bin1", + "filter": "S", + "gain": 100, + "sequenceId": 3, + "sequenceNumber": 1, + "datetime": "2024-06-26T09:43:04.000Z", + "temperature": "-10.5C", + "fileName": "Flat_1.0ms_Bin1_S_gain100_20240626-094304_-10.5C_0001.fit", + "extension": "fit", + "sourceDirectory": "tmp/asiair-dump/Autorun/Flat", + "sourceFilePath": "tmp/asiair-dump/Autorun/Flat/Flat_1.0ms_Bin1_S_gain100_20240626-094304_-10.5C_0001.fit", + "projectDirectory": "tmp/project/S/Flat_1.0ms_Bin1_S_gain100" + }, + { + "setName": "Flat_1.0ms_Bin1_S_gain100", + "type": "Flat", + "bulb": "1.0ms", + "bin": "Bin1", + "filter": "S", + "gain": 100, + "sequenceId": 3, + "sequenceNumber": 2, + "datetime": "2024-06-26T09:43:05.000Z", + "temperature": "-10.0C", + "fileName": "Flat_1.0ms_Bin1_S_gain100_20240626-094305_-10.0C_0002.fit", + "extension": "fit", + "sourceDirectory": "tmp/asiair-dump/Autorun/Flat", + "sourceFilePath": "tmp/asiair-dump/Autorun/Flat/Flat_1.0ms_Bin1_S_gain100_20240626-094305_-10.0C_0002.fit", + "projectDirectory": "tmp/project/S/Flat_1.0ms_Bin1_S_gain100" + }, + { + "setName": "Flat_1.0ms_Bin1_S_gain100", + "type": "Flat", + "bulb": "1.0ms", + "bin": "Bin1", + "filter": "S", + "gain": 100, + "sequenceId": 3, + "sequenceNumber": 3, + "datetime": "2024-06-26T09:43:06.000Z", "temperature": "-10.5C", - "fileName": "Flat_1.0ms_Bin1_S_gain100_20240511-094306_-10.5C_0003.fit", + "fileName": "Flat_1.0ms_Bin1_S_gain100_20240626-094306_-10.5C_0003.fit", "extension": "fit", "sourceDirectory": "tmp/asiair-dump/Autorun/Flat", - "sourceFilePath": "tmp/asiair-dump/Autorun/Flat/Flat_1.0ms_Bin1_S_gain100_20240511-094306_-10.5C_0003.fit", + "sourceFilePath": "tmp/asiair-dump/Autorun/Flat/Flat_1.0ms_Bin1_S_gain100_20240626-094306_-10.5C_0003.fit", "projectDirectory": "tmp/project/S/Flat_1.0ms_Bin1_S_gain100" } ], @@ -109,7 +165,8 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": null, "gain": 100, - "sequence": 1, + "sequenceId": 9, + "sequenceNumber": 1, "datetime": "2023-09-10T10:11:33.000Z", "temperature": "-9.8C", "fileName": "Bias_1.0ms_Bin1_gain100_20230910-101133_-9.8C_0001.fit", @@ -125,7 +182,8 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": null, "gain": 100, - "sequence": 2, + "sequenceId": 9, + "sequenceNumber": 2, "datetime": "2023-09-10T10:11:33.000Z", "temperature": "-9.8C", "fileName": "Bias_1.0ms_Bin1_gain100_20230910-101133_-9.8C_0002.fit", @@ -141,7 +199,8 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": null, "gain": 100, - "sequence": 3, + "sequenceId": 9, + "sequenceNumber": 3, "datetime": "2023-09-10T10:11:33.000Z", "temperature": "-9.8C", "fileName": "Bias_1.0ms_Bin1_gain100_20230910-101133_-9.8C_0003.fit", @@ -170,13 +229,14 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": "H", "gain": 0, - "sequence": 1, - "datetime": "2024-06-24T01:08:50.000Z", + "sequenceId": 6, + "sequenceNumber": 1, + "datetime": "2024-06-25T01:08:50.000Z", "temperature": "-10.1C", - "fileName": "Light_FOV_60.0s_Bin1_H_gain0_20240624-010850_-10.1C_0001.fit", + "fileName": "Light_FOV_60.0s_Bin1_H_gain0_20240625-010850_-10.1C_0001.fit", "extension": "fit", "sourceDirectory": "tmp/asiair-dump/Autorun/Light/FOV", - "sourceFilePath": "tmp/asiair-dump/Autorun/Light/FOV/Light_FOV_60.0s_Bin1_H_gain0_20240624-010850_-10.1C_0001.fit", + "sourceFilePath": "tmp/asiair-dump/Autorun/Light/FOV/Light_FOV_60.0s_Bin1_H_gain0_20240625-010850_-10.1C_0001.fit", "projectDirectory": "tmp/project/H/Light_60.0s_Bin1_H_gain0" }, { @@ -186,13 +246,14 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": "H", "gain": 0, - "sequence": 2, - "datetime": "2024-06-24T01:08:51.000Z", + "sequenceId": 6, + "sequenceNumber": 2, + "datetime": "2024-06-25T01:08:51.000Z", "temperature": "-10.1C", - "fileName": "Light_FOV_60.0s_Bin1_H_gain0_20240624-010851_-10.1C_0002.fit", + "fileName": "Light_FOV_60.0s_Bin1_H_gain0_20240625-010851_-10.1C_0002.fit", "extension": "fit", "sourceDirectory": "tmp/asiair-dump/Autorun/Light/FOV", - "sourceFilePath": "tmp/asiair-dump/Autorun/Light/FOV/Light_FOV_60.0s_Bin1_H_gain0_20240624-010851_-10.1C_0002.fit", + "sourceFilePath": "tmp/asiair-dump/Autorun/Light/FOV/Light_FOV_60.0s_Bin1_H_gain0_20240625-010851_-10.1C_0002.fit", "projectDirectory": "tmp/project/H/Light_60.0s_Bin1_H_gain0" }, { @@ -202,13 +263,14 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": "H", "gain": 0, - "sequence": 3, - "datetime": "2024-06-24T01:08:52.000Z", + "sequenceId": 6, + "sequenceNumber": 3, + "datetime": "2024-06-25T01:08:52.000Z", "temperature": "-10.1C", - "fileName": "Light_FOV_60.0s_Bin1_H_gain0_20240624-010852_-10.1C_0003.fit", + "fileName": "Light_FOV_60.0s_Bin1_H_gain0_20240625-010852_-10.1C_0003.fit", "extension": "fit", "sourceDirectory": "tmp/asiair-dump/Autorun/Light/FOV", - "sourceFilePath": "tmp/asiair-dump/Autorun/Light/FOV/Light_FOV_60.0s_Bin1_H_gain0_20240624-010852_-10.1C_0003.fit", + "sourceFilePath": "tmp/asiair-dump/Autorun/Light/FOV/Light_FOV_60.0s_Bin1_H_gain0_20240625-010852_-10.1C_0003.fit", "projectDirectory": "tmp/project/H/Light_60.0s_Bin1_H_gain0" } ], @@ -220,7 +282,8 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": null, "gain": 0, - "sequence": 1, + "sequenceId": 14, + "sequenceNumber": 1, "datetime": "2024-03-08T15:57:22.000Z", "temperature": "-10.0C", "fileName": "Dark_60.0s_Bin1_gain0_20240308-155722_-10.0C_0001.fit", @@ -238,7 +301,8 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": "H", "gain": 100, - "sequence": 1, + "sequenceId": 1, + "sequenceNumber": 1, "datetime": "2024-05-11T09:43:06.000Z", "temperature": "-10.5C", "fileName": "Flat_1.0ms_Bin1_H_gain100_20240511-094306_-10.5C_0001.fit", @@ -254,7 +318,8 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": "H", "gain": 100, - "sequence": 2, + "sequenceId": 1, + "sequenceNumber": 2, "datetime": "2024-05-11T09:43:06.000Z", "temperature": "-10.5C", "fileName": "Flat_1.0ms_Bin1_H_gain100_20240511-094306_-10.5C_0002.fit", @@ -270,7 +335,8 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": "H", "gain": 100, - "sequence": 3, + "sequenceId": 1, + "sequenceNumber": 3, "datetime": "2024-05-11T09:43:06.000Z", "temperature": "-10.5C", "fileName": "Flat_1.0ms_Bin1_H_gain100_20240511-094306_-10.5C_0003.fit", @@ -288,7 +354,8 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": null, "gain": 100, - "sequence": 1, + "sequenceId": 9, + "sequenceNumber": 1, "datetime": "2023-09-10T10:11:33.000Z", "temperature": "-9.8C", "fileName": "Bias_1.0ms_Bin1_gain100_20230910-101133_-9.8C_0001.fit", @@ -304,7 +371,8 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": null, "gain": 100, - "sequence": 2, + "sequenceId": 9, + "sequenceNumber": 2, "datetime": "2023-09-10T10:11:33.000Z", "temperature": "-9.8C", "fileName": "Bias_1.0ms_Bin1_gain100_20230910-101133_-9.8C_0002.fit", @@ -320,7 +388,8 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": null, "gain": 100, - "sequence": 3, + "sequenceId": 9, + "sequenceNumber": 3, "datetime": "2023-09-10T10:11:33.000Z", "temperature": "-9.8C", "fileName": "Bias_1.0ms_Bin1_gain100_20230910-101133_-9.8C_0003.fit", @@ -338,7 +407,7 @@ exports[`E2E should be neat 2`] = ` "darkSet": "Dark_60.0s_Bin1_L_gain100", "biasSet": "Bias_1.0ms_Bin1_gain100", "lightsCount": 3, - "flatsCount": 3, + "flatsCount": 6, "darksCount": 3, "biasesCount": 3, "lights": [ @@ -349,7 +418,8 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": "S", "gain": 100, - "sequence": 1, + "sequenceId": 7, + "sequenceNumber": 1, "datetime": "2024-06-24T01:08:50.000Z", "temperature": "-10.1C", "fileName": "Light_FOV_60.0s_Bin1_S_gain100_20240624-010850_-10.1C_0001.fit", @@ -365,7 +435,8 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": "S", "gain": 100, - "sequence": 2, + "sequenceId": 7, + "sequenceNumber": 2, "datetime": "2024-06-24T01:08:51.000Z", "temperature": "-10.1C", "fileName": "Light_FOV_60.0s_Bin1_S_gain100_20240624-010851_-10.1C_0002.fit", @@ -381,7 +452,8 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": "S", "gain": 100, - "sequence": 3, + "sequenceId": 7, + "sequenceNumber": 3, "datetime": "2024-06-24T01:08:52.000Z", "temperature": "-10.1C", "fileName": "Light_FOV_60.0s_Bin1_S_gain100_20240624-010852_-10.1C_0003.fit", @@ -399,7 +471,8 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": "L", "gain": 100, - "sequence": 1, + "sequenceId": 12, + "sequenceNumber": 1, "datetime": "2024-03-08T15:57:22.000Z", "temperature": "-10.0C", "fileName": "Dark_60.0s_Bin1_L_gain100_20240308-155722_-10.0C_0001.fit", @@ -415,7 +488,8 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": "L", "gain": 100, - "sequence": 2, + "sequenceId": 12, + "sequenceNumber": 2, "datetime": "2024-03-08T15:57:23.000Z", "temperature": "-10.0C", "fileName": "Dark_60.0s_Bin1_L_gain100_20240308-155723_-10.0C_0002.fit", @@ -431,7 +505,8 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": "L", "gain": 100, - "sequence": 3, + "sequenceId": 12, + "sequenceNumber": 3, "datetime": "2024-03-08T15:57:24.000Z", "temperature": "-10.0C", "fileName": "Dark_60.0s_Bin1_L_gain100_20240308-155724_-10.0C_0003.fit", @@ -449,13 +524,14 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": "S", "gain": 100, - "sequence": 1, - "datetime": "2024-05-11T09:43:04.000Z", + "sequenceId": 2, + "sequenceNumber": 1, + "datetime": "2024-06-24T09:43:04.000Z", "temperature": "-10.5C", - "fileName": "Flat_1.0ms_Bin1_S_gain100_20240511-094304_-10.5C_0001.fit", + "fileName": "Flat_1.0ms_Bin1_S_gain100_20240624-094304_-10.5C_0001.fit", "extension": "fit", "sourceDirectory": "tmp/asiair-dump/Autorun/Flat", - "sourceFilePath": "tmp/asiair-dump/Autorun/Flat/Flat_1.0ms_Bin1_S_gain100_20240511-094304_-10.5C_0001.fit", + "sourceFilePath": "tmp/asiair-dump/Autorun/Flat/Flat_1.0ms_Bin1_S_gain100_20240624-094304_-10.5C_0001.fit", "projectDirectory": "tmp/project/S/Flat_1.0ms_Bin1_S_gain100" }, { @@ -465,13 +541,14 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": "S", "gain": 100, - "sequence": 2, - "datetime": "2024-05-11T09:43:05.000Z", + "sequenceId": 2, + "sequenceNumber": 2, + "datetime": "2024-06-24T09:43:05.000Z", "temperature": "-10.0C", - "fileName": "Flat_1.0ms_Bin1_S_gain100_20240511-094305_-10.0C_0002.fit", + "fileName": "Flat_1.0ms_Bin1_S_gain100_20240624-094305_-10.0C_0002.fit", "extension": "fit", "sourceDirectory": "tmp/asiair-dump/Autorun/Flat", - "sourceFilePath": "tmp/asiair-dump/Autorun/Flat/Flat_1.0ms_Bin1_S_gain100_20240511-094305_-10.0C_0002.fit", + "sourceFilePath": "tmp/asiair-dump/Autorun/Flat/Flat_1.0ms_Bin1_S_gain100_20240624-094305_-10.0C_0002.fit", "projectDirectory": "tmp/project/S/Flat_1.0ms_Bin1_S_gain100" }, { @@ -481,13 +558,65 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": "S", "gain": 100, - "sequence": 3, - "datetime": "2024-05-11T09:43:06.000Z", + "sequenceId": 2, + "sequenceNumber": 3, + "datetime": "2024-06-24T09:43:06.000Z", + "temperature": "-10.5C", + "fileName": "Flat_1.0ms_Bin1_S_gain100_20240624-094306_-10.5C_0003.fit", + "extension": "fit", + "sourceDirectory": "tmp/asiair-dump/Autorun/Flat", + "sourceFilePath": "tmp/asiair-dump/Autorun/Flat/Flat_1.0ms_Bin1_S_gain100_20240624-094306_-10.5C_0003.fit", + "projectDirectory": "tmp/project/S/Flat_1.0ms_Bin1_S_gain100" + }, + { + "setName": "Flat_1.0ms_Bin1_S_gain100", + "type": "Flat", + "bulb": "1.0ms", + "bin": "Bin1", + "filter": "S", + "gain": 100, + "sequenceId": 3, + "sequenceNumber": 1, + "datetime": "2024-06-26T09:43:04.000Z", + "temperature": "-10.5C", + "fileName": "Flat_1.0ms_Bin1_S_gain100_20240626-094304_-10.5C_0001.fit", + "extension": "fit", + "sourceDirectory": "tmp/asiair-dump/Autorun/Flat", + "sourceFilePath": "tmp/asiair-dump/Autorun/Flat/Flat_1.0ms_Bin1_S_gain100_20240626-094304_-10.5C_0001.fit", + "projectDirectory": "tmp/project/S/Flat_1.0ms_Bin1_S_gain100" + }, + { + "setName": "Flat_1.0ms_Bin1_S_gain100", + "type": "Flat", + "bulb": "1.0ms", + "bin": "Bin1", + "filter": "S", + "gain": 100, + "sequenceId": 3, + "sequenceNumber": 2, + "datetime": "2024-06-26T09:43:05.000Z", + "temperature": "-10.0C", + "fileName": "Flat_1.0ms_Bin1_S_gain100_20240626-094305_-10.0C_0002.fit", + "extension": "fit", + "sourceDirectory": "tmp/asiair-dump/Autorun/Flat", + "sourceFilePath": "tmp/asiair-dump/Autorun/Flat/Flat_1.0ms_Bin1_S_gain100_20240626-094305_-10.0C_0002.fit", + "projectDirectory": "tmp/project/S/Flat_1.0ms_Bin1_S_gain100" + }, + { + "setName": "Flat_1.0ms_Bin1_S_gain100", + "type": "Flat", + "bulb": "1.0ms", + "bin": "Bin1", + "filter": "S", + "gain": 100, + "sequenceId": 3, + "sequenceNumber": 3, + "datetime": "2024-06-26T09:43:06.000Z", "temperature": "-10.5C", - "fileName": "Flat_1.0ms_Bin1_S_gain100_20240511-094306_-10.5C_0003.fit", + "fileName": "Flat_1.0ms_Bin1_S_gain100_20240626-094306_-10.5C_0003.fit", "extension": "fit", "sourceDirectory": "tmp/asiair-dump/Autorun/Flat", - "sourceFilePath": "tmp/asiair-dump/Autorun/Flat/Flat_1.0ms_Bin1_S_gain100_20240511-094306_-10.5C_0003.fit", + "sourceFilePath": "tmp/asiair-dump/Autorun/Flat/Flat_1.0ms_Bin1_S_gain100_20240626-094306_-10.5C_0003.fit", "projectDirectory": "tmp/project/S/Flat_1.0ms_Bin1_S_gain100" } ], @@ -499,7 +628,8 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": null, "gain": 100, - "sequence": 1, + "sequenceId": 9, + "sequenceNumber": 1, "datetime": "2023-09-10T10:11:33.000Z", "temperature": "-9.8C", "fileName": "Bias_1.0ms_Bin1_gain100_20230910-101133_-9.8C_0001.fit", @@ -515,7 +645,8 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": null, "gain": 100, - "sequence": 2, + "sequenceId": 9, + "sequenceNumber": 2, "datetime": "2023-09-10T10:11:33.000Z", "temperature": "-9.8C", "fileName": "Bias_1.0ms_Bin1_gain100_20230910-101133_-9.8C_0002.fit", @@ -531,7 +662,8 @@ exports[`E2E should be neat 2`] = ` "bin": "Bin1", "filter": null, "gain": 100, - "sequence": 3, + "sequenceId": 9, + "sequenceNumber": 3, "datetime": "2023-09-10T10:11:33.000Z", "temperature": "-9.8C", "fileName": "Bias_1.0ms_Bin1_gain100_20230910-101133_-9.8C_0003.fit", diff --git a/src/tests/e2e/e2e-testing.spec.ts b/src/tests/e2e/e2e-testing.spec.ts index fe61150..c27b53b 100644 --- a/src/tests/e2e/e2e-testing.spec.ts +++ b/src/tests/e2e/e2e-testing.spec.ts @@ -24,17 +24,20 @@ describe("E2E", () => { "asiair-dump/Autorun/Light/FOV/Light_FOV_60.0s_Bin1_S_gain100_20240624-010852_-10.1C_0003.fit", // Lights set B (60.0s_Bin1_H_gain0). - "asiair-dump/Autorun/Light/FOV/Light_FOV_60.0s_Bin1_H_gain0_20240624-010850_-10.1C_0001.fit", - "asiair-dump/Autorun/Light/FOV/Light_FOV_60.0s_Bin1_H_gain0_20240624-010851_-10.1C_0002.fit", - "asiair-dump/Autorun/Light/FOV/Light_FOV_60.0s_Bin1_H_gain0_20240624-010852_-10.1C_0003.fit", + "asiair-dump/Autorun/Light/FOV/Light_FOV_60.0s_Bin1_H_gain0_20240625-010850_-10.1C_0001.fit", + "asiair-dump/Autorun/Light/FOV/Light_FOV_60.0s_Bin1_H_gain0_20240625-010851_-10.1C_0002.fit", + "asiair-dump/Autorun/Light/FOV/Light_FOV_60.0s_Bin1_H_gain0_20240625-010852_-10.1C_0003.fit", // Lights set C (120.0s_Bin1_S_gain0). - "asiair-dump/Autorun/Light/FOV/Light_FOV_120.0s_Bin1_S_gain0_20240624-010850_-10.1C_0001.fit", + "asiair-dump/Autorun/Light/FOV/Light_FOV_120.0s_Bin1_S_gain0_20240626-010850_-10.1C_0001.fit", // Flats matching set A. Flats matching set C. - "asiair-dump/Autorun/Flat/Flat_1.0ms_Bin1_S_gain100_20240511-094304_-10.5C_0001.fit", - "asiair-dump/Autorun/Flat/Flat_1.0ms_Bin1_S_gain100_20240511-094305_-10.0C_0002.fit", - "asiair-dump/Autorun/Flat/Flat_1.0ms_Bin1_S_gain100_20240511-094306_-10.5C_0003.fit", + "asiair-dump/Autorun/Flat/Flat_1.0ms_Bin1_S_gain100_20240624-094304_-10.5C_0001.fit", // Sequence that aims to match the lights set A (collimation of that day). + "asiair-dump/Autorun/Flat/Flat_1.0ms_Bin1_S_gain100_20240624-094305_-10.0C_0002.fit", + "asiair-dump/Autorun/Flat/Flat_1.0ms_Bin1_S_gain100_20240624-094306_-10.5C_0003.fit", + "asiair-dump/Autorun/Flat/Flat_1.0ms_Bin1_S_gain100_20240626-094304_-10.5C_0001.fit", // Another sequence that aims to match the lights set C (collimation of that day). + "asiair-dump/Autorun/Flat/Flat_1.0ms_Bin1_S_gain100_20240626-094305_-10.0C_0002.fit", + "asiair-dump/Autorun/Flat/Flat_1.0ms_Bin1_S_gain100_20240626-094306_-10.5C_0003.fit", // Flats matching set B. "asiair-dump/Autorun/Flat/Flat_1.0ms_Bin1_H_gain100_20240511-094306_-10.5C_0001.fit", // Gain 100, but can still matching with lights gain 0! @@ -135,13 +138,16 @@ describe("E2E", () => { "H/Flat_1.0ms_Bin1_H_gain100/Flat_1.0ms_Bin1_H_gain100_20240511-094306_-10.5C_0001.fit", "H/Flat_1.0ms_Bin1_H_gain100/Flat_1.0ms_Bin1_H_gain100_20240511-094306_-10.5C_0002.fit", "H/Flat_1.0ms_Bin1_H_gain100/Flat_1.0ms_Bin1_H_gain100_20240511-094306_-10.5C_0003.fit", - "H/Light_60.0s_Bin1_H_gain0/Light_FOV_60.0s_Bin1_H_gain0_20240624-010850_-10.1C_0001.fit", - "H/Light_60.0s_Bin1_H_gain0/Light_FOV_60.0s_Bin1_H_gain0_20240624-010851_-10.1C_0002.fit", - "H/Light_60.0s_Bin1_H_gain0/Light_FOV_60.0s_Bin1_H_gain0_20240624-010852_-10.1C_0003.fit", - "S/Flat_1.0ms_Bin1_S_gain100/Flat_1.0ms_Bin1_S_gain100_20240511-094304_-10.5C_0001.fit", - "S/Flat_1.0ms_Bin1_S_gain100/Flat_1.0ms_Bin1_S_gain100_20240511-094305_-10.0C_0002.fit", - "S/Flat_1.0ms_Bin1_S_gain100/Flat_1.0ms_Bin1_S_gain100_20240511-094306_-10.5C_0003.fit", - "S/Light_120.0s_Bin1_S_gain0/Light_FOV_120.0s_Bin1_S_gain0_20240624-010850_-10.1C_0001.fit", + "H/Light_60.0s_Bin1_H_gain0/Light_FOV_60.0s_Bin1_H_gain0_20240625-010850_-10.1C_0001.fit", + "H/Light_60.0s_Bin1_H_gain0/Light_FOV_60.0s_Bin1_H_gain0_20240625-010851_-10.1C_0002.fit", + "H/Light_60.0s_Bin1_H_gain0/Light_FOV_60.0s_Bin1_H_gain0_20240625-010852_-10.1C_0003.fit", + "S/Flat_1.0ms_Bin1_S_gain100/Flat_1.0ms_Bin1_S_gain100_20240624-094304_-10.5C_0001.fit", + "S/Flat_1.0ms_Bin1_S_gain100/Flat_1.0ms_Bin1_S_gain100_20240624-094305_-10.0C_0002.fit", + "S/Flat_1.0ms_Bin1_S_gain100/Flat_1.0ms_Bin1_S_gain100_20240624-094306_-10.5C_0003.fit", + "S/Flat_1.0ms_Bin1_S_gain100/Flat_1.0ms_Bin1_S_gain100_20240626-094304_-10.5C_0001.fit", + "S/Flat_1.0ms_Bin1_S_gain100/Flat_1.0ms_Bin1_S_gain100_20240626-094305_-10.0C_0002.fit", + "S/Flat_1.0ms_Bin1_S_gain100/Flat_1.0ms_Bin1_S_gain100_20240626-094306_-10.5C_0003.fit", + "S/Light_120.0s_Bin1_S_gain0/Light_FOV_120.0s_Bin1_S_gain0_20240626-010850_-10.1C_0001.fit", "S/Light_60.0s_Bin1_S_gain100/Light_FOV_60.0s_Bin1_S_gain100_20240624-010850_-10.1C_0001.fit", "S/Light_60.0s_Bin1_S_gain100/Light_FOV_60.0s_Bin1_S_gain100_20240624-010851_-10.1C_0002.fit", "S/Light_60.0s_Bin1_S_gain100/Light_FOV_60.0s_Bin1_S_gain100_20240624-010852_-10.1C_0003.fit", diff --git a/src/utils/types.ts b/src/utils/types.ts index c5d1064..bbf7f70 100644 --- a/src/utils/types.ts +++ b/src/utils/types.ts @@ -60,10 +60,15 @@ export type FileImageSpec = ImageSpec & { * Recorded time. */ datetime: Date; + + /** + * Sequence identifier. + */ + sequenceId: number; /** - * Sequence number: 1, 60, etc... + * Position in the sequence. */ - sequence: number; + sequenceNumber: number; // TODO. Change to float Celcius. /** diff --git a/src/utils/utils.ts b/src/utils/utils.ts index a43a362..ce9529f 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -10,9 +10,11 @@ import { logger } from "./logger"; export const getFitsFromDirectory = ({ directory: directory, projectDirectory, + sequenceId = 0, }: { directory: string; projectDirectory: string; + sequenceId?: number; }) => { const files: fs.Dirent[] = fs.readdirSync(directory, { recursive: true, @@ -34,6 +36,12 @@ export const getFitsFromDirectory = ({ // If the file is a FITS file, process it. const specs = getFileImageSpecFromFilename(file, projectDirectory); + + if (specs.sequenceNumber === 1) { + sequenceId++; + } + specs.sequenceId = sequenceId; + fileImageSpecs.push(specs); }); @@ -68,7 +76,8 @@ export const getFileImageSpecFromFilename = ( filter: match.groups.filter ?? null, gain: parseInt(match.groups.gain, 10), - sequence: parseInt(match.groups.sequence, 10), + sequenceId: -1, // Will be computed later. + sequenceNumber: parseInt(match.groups.sequence, 10), datetime: parseDate(match.groups.datetime), temperature: match.groups.temperature,