Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
192 commits
Select commit Hold shift + click to select a range
debef9c
split into candidate and simple calc phases
markmac99 Jan 16, 2026
240a720
print candmode in logs
markmac99 Jan 16, 2026
b1040c6
tidy up logging
markmac99 Jan 17, 2026
aa20b49
bug in conversion step
markmac99 Jan 17, 2026
02a9865
avoid committing to sqlite after every update
markmac99 Jan 19, 2026
f569ebe
support for excluding already-failed candidates
markmac99 Jan 19, 2026
12dab86
start adding some standalone management to the sqlite db scripts
markmac99 Jan 19, 2026
9b18baa
add obs-date to database
markmac99 Jan 19, 2026
8208b77
got params in wrong order arg
markmac99 Jan 20, 2026
1dc6ae5
improve archiving process
markmac99 Jan 20, 2026
332c5f3
log how many obs got moved to sqlite
markmac99 Jan 20, 2026
db77938
make logging provisional
markmac99 Jan 20, 2026
1089a1b
remove unnecessary logging
markmac99 Jan 20, 2026
e4320a5
make obs database a class
markmac99 Jan 21, 2026
75f11ea
improve documentation
markmac99 Jan 21, 2026
405d6c0
some tidying up
markmac99 Jan 21, 2026
81a2969
simplify migration to sqlite
markmac99 Jan 21, 2026
9a71d85
keep track of which traj we're doing
markmac99 Jan 21, 2026
297da7c
improve archiving and add merging support
markmac99 Jan 21, 2026
f1f5f5e
updates to improve handling of operation modes and remote data
markmac99 Jan 24, 2026
6eb44fa
improve documentation
markmac99 Jan 25, 2026
9024741
Merge branch 'wmpg:master' into distrib_processing
markmac99 Jan 25, 2026
1afaff1
bugfix to create phase1 trajs properly
markmac99 Jan 26, 2026
625ee4d
bugfix in when to save phase1
markmac99 Jan 26, 2026
3684014
be a bit less verbose
markmac99 Jan 27, 2026
7f5677a
remove unnecessary message
markmac99 Jan 27, 2026
21fa47e
reinstate prior behaviour to skip ignored stations when retrying solu…
markmac99 Jan 27, 2026
2c1ab8b
simplify calls to addTrajectory
markmac99 Jan 27, 2026
610cfa5
create trajectories db in sqlite
markmac99 Jan 27, 2026
22e9932
add trajectories db as json file
markmac99 Jan 27, 2026
558ce81
bugfixes
markmac99 Jan 27, 2026
fd228a9
updates to handle trajectory sqlite db better
markmac99 Jan 28, 2026
b82689b
dont load the traj db in MCMODE2 as we don't need it
markmac99 Jan 28, 2026
8331148
some support to analyse the traj db
markmac99 Jan 28, 2026
62b45cd
improve logging
markmac99 Jan 29, 2026
02b6c0e
handle verbose flags better
markmac99 Jan 29, 2026
13e6836
more debug
markmac99 Jan 29, 2026
9ec2eaa
remove commitnow as its causing issues
markmac99 Jan 29, 2026
7a8d4e3
debug
markmac99 Jan 29, 2026
36a9f0b
debug
markmac99 Jan 29, 2026
ebf5473
typo
markmac99 Jan 29, 2026
7e88468
more doc and debug to track down issue
markmac99 Jan 29, 2026
2eaeb91
fix bug in fails table
markmac99 Jan 29, 2026
ad4eec4
bugfix
markmac99 Jan 29, 2026
d27a13b
simplify code
markmac99 Jan 29, 2026
6c28d9d
bugfixes in correlateDB
markmac99 Jan 29, 2026
863d7e2
avoid removing trajectories incorrectly
markmac99 Jan 29, 2026
50eb9df
ting bug in reporting of removed traj
markmac99 Jan 29, 2026
36a880b
Client-mode remote data processing
markmac99 Jan 30, 2026
bb7b502
reduce amount of legacy data thats loaded
markmac99 Jan 30, 2026
23b258b
make dates tz aware
markmac99 Jan 30, 2026
be29951
improve logging
markmac99 Jan 30, 2026
5eebd9d
more tweaks to copying legacy data
markmac99 Jan 30, 2026
a87fb16
bugfix
markmac99 Jan 30, 2026
71e20aa
bugfix
markmac99 Jan 30, 2026
6083b46
remove unncessary debug
markmac99 Jan 31, 2026
5f986c7
don't try to save an unopened database
markmac99 Jan 31, 2026
6e8bb88
Updates for remote client datahandling
markmac99 Feb 1, 2026
9cd2d00
support to signal when a client is ready for data
markmac99 Feb 3, 2026
458170d
more work on master mode
markmac99 Feb 3, 2026
138d672
fix bug in unpairing if db is empty
markmac99 Feb 3, 2026
69c99ce
fix bug in unpairing if db is empty
markmac99 Feb 3, 2026
fd38bd5
make uploaded database names unique
markmac99 Feb 3, 2026
6aac11f
oops, make sure phase1 dir exists even in mc mode
markmac99 Feb 3, 2026
ce2877b
small bugfixes
markmac99 Feb 4, 2026
3622d0c
remove some excess verbosity
markmac99 Feb 4, 2026
67fefbe
indicate how many are being solved
markmac99 Feb 4, 2026
c4eecac
bugfix to handle nans in the database
markmac99 Feb 4, 2026
92f865a
add log suffix
markmac99 Feb 4, 2026
b271037
add log suffix properly
markmac99 Feb 4, 2026
1d366bf
catch SFTP fails
markmac99 Feb 4, 2026
333b48e
more small changes to protect against sftp fails
markmac99 Feb 4, 2026
c224ac1
defend against sftp failures
markmac99 Feb 11, 2026
47a2d27
bugfix to prevent phase2 crash merging data
markmac99 Feb 11, 2026
6da8bbb
add function to copy json data over
markmac99 Feb 11, 2026
83a2b72
bugfix: only move phase1 if client was doing phase1
markmac99 Feb 11, 2026
6ece9ab
make sure folders exist
markmac99 Feb 12, 2026
c9bb9bd
initialise remote data handling in the right place for phase2
markmac99 Feb 12, 2026
c9ede51
improve logging
markmac99 Feb 12, 2026
cda60ba
prevent crash in mcmode 2
markmac99 Feb 12, 2026
fbd7899
print operation mode more frequently
markmac99 Feb 12, 2026
7677acc
update remote data handling to actually move trajectories!
markmac99 Feb 12, 2026
21c94b4
slight improvement in shutdown messaging
markmac99 Feb 12, 2026
1b73810
bugfix
markmac99 Feb 12, 2026
8d8a325
chmod upload folders as needed
markmac99 Feb 12, 2026
cb20be5
fix perms on upload folders
markmac99 Feb 12, 2026
db2f17c
add some verbosity for debug
markmac99 Feb 13, 2026
e753a1e
bugfix in pairing routine
markmac99 Feb 13, 2026
b2cf365
Merge branch 'wmpg:master' into distrib_processing
markmac99 Feb 14, 2026
b12504a
rename archiveoldrecords to archivemonths
markmac99 Feb 14, 2026
379a5e9
Merge branch 'distrib_processing' of github.com:markmac99/WesternMete…
markmac99 Feb 14, 2026
4d212af
remove unnecessasry flag
markmac99 Feb 14, 2026
22dadc5
whoops changed param name incorrectly
markmac99 Feb 14, 2026
86721cd
initialise obs and traj db
markmac99 Feb 14, 2026
508f40e
a bit of documentation
markmac99 Feb 16, 2026
bd31fa0
check status from merge functions
markmac99 Feb 16, 2026
8de1c47
if connection fails, close gracefully and retry later
markmac99 Feb 16, 2026
e04f9f4
write pidfile
markmac99 Feb 16, 2026
17ef66d
remove unnecessary saving of temp pickles in ph2
markmac99 Feb 16, 2026
0a102b9
tidying up the date formats when reporting candidates, fails etc
markmac99 Feb 18, 2026
b73f07d
bugfix failed to define ref_dt
markmac99 Feb 19, 2026
7b45db1
add some comments
markmac99 Feb 26, 2026
91ab59e
create function to merge broken so we can call it elsewhere if needed
markmac99 Feb 26, 2026
615ea33
commit the write-ahead-log after every candidate save op
markmac99 Feb 27, 2026
43a4e8d
commit the obs database after saving candidates
markmac99 Feb 27, 2026
1a5d592
don't load stations or scan folders if in phase1 or phase2 only modes
markmac99 Feb 27, 2026
4ba68fc
support fractional bins
markmac99 Feb 27, 2026
3c0ae48
small correction in correlateDB
markmac99 Feb 27, 2026
f51e56c
remove unnecessary cursors
markmac99 Feb 27, 2026
d898e1f
support to purge local processed data
markmac99 Feb 27, 2026
704aa0a
make sure dbs are closed in the maintenance section
markmac99 Feb 27, 2026
51b637a
add verbosity
markmac99 Feb 27, 2026
3e7ac46
fix verbosity
markmac99 Feb 27, 2026
7c16e37
error handling in db merge process
markmac99 Feb 27, 2026
739ae25
remote remote WAL dbs after merger
markmac99 Feb 27, 2026
dcc904a
avoid trying to merge empty databases
markmac99 Feb 27, 2026
6415260
more fixes for database or table not existing
markmac99 Feb 27, 2026
d46b06f
documentation
markmac99 Feb 27, 2026
70b59ce
add more debug
markmac99 Feb 27, 2026
8071f49
delete rather than update when unpairing
markmac99 Feb 27, 2026
f663308
handle unpairing more efficiently with multi-insert
markmac99 Feb 27, 2026
6e20cf7
rename function more sensibly
markmac99 Mar 3, 2026
821bf68
switch logic round to mark paired after succeessful phase1. This redu…
markmac99 Mar 3, 2026
5fe13e0
remove unnecessay commit
markmac99 Mar 3, 2026
cfc0b81
pass new obs to solveTrajectory so they can be marked paired if needed
markmac99 Mar 4, 2026
7db6bdf
bug in phase1 processing
markmac99 Mar 5, 2026
ac19e59
working on ref_dt bug
markmac99 Mar 5, 2026
ced94c2
add debug messages to help testing
markmac99 Mar 5, 2026
9db92f7
tidying up
markmac99 Mar 6, 2026
e9d3c6e
avoid reprocessing already processed candidates
markmac99 Mar 7, 2026
c2572de
bugfixes and performance improvements
markmac99 Mar 8, 2026
e9794a8
remove incorrect location of Obs DB
markmac99 Mar 8, 2026
9612432
various improvements
markmac99 Mar 9, 2026
b9d9747
tidying up
markmac99 Mar 9, 2026
d7fabbd
fixes for issues #86, #87, #88, #94
markmac99 Mar 10, 2026
88bcd09
Add candidate database and use it
markmac99 Mar 11, 2026
48a35b0
purge older candidate data to keep database size reasonable
markmac99 Mar 11, 2026
cfd7645
save cands using jdt_ref to make checks easier
markmac99 Mar 11, 2026
c820387
small bug in cands db purge process
markmac99 Mar 11, 2026
bcaa042
move cand loading to within datahandle
markmac99 Mar 11, 2026
f234e8e
avoid slightly misleading message in log
markmac99 Mar 11, 2026
16a3db2
make sure to close and commit databases on exit
markmac99 Mar 11, 2026
2416d4b
bugfix
markmac99 Mar 12, 2026
1e44569
bugfixes and tidying up
markmac99 Mar 12, 2026
87c5109
add obs id to traj data
markmac99 Mar 15, 2026
21ab115
remove some debug
markmac99 Mar 16, 2026
8f6eaf6
add obs_ids to failed traj if convergence angle too small
markmac99 Mar 16, 2026
d9505a1
add ignored obs to database
markmac99 Mar 17, 2026
92e42bd
add ignored obs to traj object
markmac99 Mar 17, 2026
323d4c9
simplify updating the traj database
markmac99 Mar 17, 2026
6fe3f86
bugfix in trajdb
markmac99 Mar 17, 2026
a17a3a6
Merge branch 'wmpg:master' into distrib_processing
markmac99 Mar 20, 2026
205b9a3
add functionality to remove a trajectory by ID and to retrieve obsids…
markmac99 Mar 20, 2026
e74b8d7
remove some debugging
markmac99 Mar 21, 2026
830cce1
better remote data error management
markmac99 Mar 24, 2026
5bbf10e
improved duplicate management
markmac99 Mar 24, 2026
0fbfb3e
be sure to remove both traj with an overlap in obs so they get reanal…
markmac99 Mar 24, 2026
4a0c828
possible dupes: don't delete both trajs if not in auto mode
markmac99 Mar 26, 2026
c317cd6
less aggressive purging of processed phase1
markmac99 Mar 26, 2026
37cb56a
bugfixes in process to copy data from Json file
markmac99 Mar 27, 2026
e269d94
bugfix in allocation of data to children
markmac99 Mar 27, 2026
be840b8
log where phase1 files are saved
markmac99 Mar 27, 2026
8aa22e4
adding remote processing config file
markmac99 Mar 27, 2026
c12138c
tweaking debug
markmac99 Mar 27, 2026
b592ac8
support conversion of legacy trajectories as well as failed to sqlite
markmac99 Mar 28, 2026
9a3a4ed
more work on getting buckets right
markmac99 Mar 29, 2026
f421533
bugfix
markmac99 Mar 29, 2026
4fb4433
fix error in cand/phase1 saving logic
markmac99 Mar 29, 2026
83098f3
reworking on obs loading
markmac99 Mar 29, 2026
704bbb4
improve exception handling
markmac99 Mar 29, 2026
af31def
fixing timebucket calcs
markmac99 Mar 29, 2026
7521455
remove some debugging
markmac99 Mar 29, 2026
8b22845
improvements in data selection to avoid
markmac99 Mar 30, 2026
a89601a
performance bugfix in finding unprocessed data
markmac99 Mar 30, 2026
5785fed
bugfix when iterating through testing stations to ignore
markmac99 Mar 31, 2026
9433235
remove some debug and add some informational messages
markmac99 Mar 31, 2026
e6a8679
fix bug that was creating duplicates when reprocessing existing traj …
markmac99 Apr 1, 2026
8c8356b
updating some inline documentation
markmac99 Apr 3, 2026
68154de
Adding documentation on new capabilities
markmac99 Apr 3, 2026
0dfb9b4
Move documentation to right place
markmac99 Apr 3, 2026
047f784
More work on documentation
markmac99 Apr 3, 2026
bb872b7
More doco tweaks
markmac99 Apr 3, 2026
2807a0b
don't load json db if its not present (doh)
markmac99 Apr 4, 2026
5c09521
add merge process for canddb and fix small bug
markmac99 Apr 7, 2026
f437bca
bugfix in addTrajectory
markmac99 Apr 11, 2026
bae0d29
avoid closing closed databases
markmac99 Apr 11, 2026
8c5ce08
filter out legacy traj that can't be checked for dupes as easily
markmac99 Apr 11, 2026
5e44e3c
make dbdir and logdir if they dont exist
markmac99 Apr 16, 2026
b4daaa1
make sure traj objects include obs_ids when persisted
markmac99 Apr 20, 2026
300376b
bugfix - set candidate id and ref_ts in UTC
markmac99 Apr 20, 2026
7996132
sort trajbasics by jdt_ref
markmac99 Apr 21, 2026
cb989e3
bugfix for zero-length obsids
markmac99 Apr 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
183 changes: 183 additions & 0 deletions Documentation/WMPL_Upgrades_2026April.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
# WMPL Upgrades
by Mark McIntyre, April 2026

## Key points

- Added new operation mode to create candidates.
- Added distributed processing for candidates.
- Added checks for duplicate transactions.
- Replaced JSON database with SQLite databases.
- Slight change to command-line options.

### Operation Modes

The updated solver now has three core operational modes, numbered 4, 1, and 2. In the code these are MCMODE_CANDS, MCMODE_PHASE1 and MCMODE_PHASE2. The previous mode 1 has been split into two stages numbered 4 and 1 as explained below.

Here's what each phase does.

- In mcmode 4, the solver finds and saves candidate groups of observations.
During this phase, unpaired observations are loaded and candidate groups found. Observations are excluded if they're already marked as paired in the observations database, and potential candidate groups are also checked against the candidate database to avoid reanalysing combinations that were already found. Remaining new candidates are then added to the candidate database and saved to disk.

- In mcmode 1, the solver loads candidates created by the previous step and attempts to find a simple solution.
If successful, the trajectory is saved to disk and a copy placed in the 'phase1' folder for further analysis, while the trajectory and observations databases are updated accordingly. If unsuccessful, the trajectory is added to the list of failed trajectories in the trajectories database.

- In mcmode 2, the solver loads phase1 solutions and performs Monte-Carlo analysis. This mode is unchanged from previously.

Some Bitwise combinations of modes are permitted as shown in the table below:

| Value | Effect | Example Use |
| ------------------- | ------------------------------------------------------------ | ------------------------------------------- |
| 3 <br>MCMODE_SIMPLE | Runs modes 1+2, i.e. loads and fully solves candidates. | UKMON currently uses this mode. |
| 5 <br>MCMODE_BOTH | Runs modes 4+1, i.e. creates phase 1 solutions from scratch. | GMN currently uses this mode. |
| 7 <br>MCMODE_ALL | Equivalent to 0 or passing no mcmode | Typically used during manual data analysis. |
| Any other value | Treated as a value of 7 | |

Note that in modes 0, 3, 5 and 7, intermediate files (ie candidates and phase1 files) are not saved to disk.

### Distributed Processing

The solver supports distribution of both candidates and phase1 solutions to child nodes.

To enable distributed processing, we require one master node and one or more child nodes.

On the master, we create a configuration file '**wmpl_remote.cfg**' in the same folder as the databases and then run three instances of the Solver on a master node, one in each of mcmodes 4, 1 and 2 (more than one instance in mcmode 2 can be run). The content of the configuration file is explained below and a sample file is included in the repository.

On each child, we also create a configuration file (see 'Child Node Configuration' below). Child nodes can run in mcmodes 1 or 2, collecting relevant data from the master node and uploading the results back.

SFTP is used to move data between master and child, and each child must therefore have an SFTP account on the server hosting the master.

Data are written into a 'files' folder in the sftp account's home directory, and therefore the account running the master instances of the solver must be able to read from, write to and create folders in a "files" directory in the children's home directories. On my test server I achieved this with POSIX ACLs and Unix group membership.

Additionally, the solver itself sets permissions on files and subfolders, and these should not be altered.

The required folder structure for one node is shown below.

![image](node_structure.png)

**Master Node Configuration**

The configuration file for the master node specifies the child nodes that are available, the capacity of each node, and the mcmode that its operating in (modes 1 or 2, no other mcmode is supported). The capacity value can be any integer, with zero meaning the node is disabled and any negative value meaning the node has no capacity limit.

When running in master mode, the instance in mcmode 4 will distribute candidates and the instance in mcmode 1 will distribute phase1 pickle files, provided suitable child nodes are configured.

Example master-mode configuration file:

\[mode\]
mode = master
\[children\]
node1 = /home/node1, 600, 1
node2 = /home/node2, 500, 2
node3 = /home/node3, 0, 1

This indicates that:

- node 1 is running in mcmode 1 and has capacity of 600.
- node 2 is running in mcmode 2 and has capacity of 500.
- Node 3 is currently disabled (capacity zero) and will not be assigned data.

If we bring node 3 online, we can change the capacity from zero to some suitable value, and the master will begin assigning candidates to it (see 'Dynamically Adding Nodes' below).

If no nodes are available, or if all nodes are at capacity, any remaining data will be assigned to the master node.

The master will also stop assigning data to a node if a special file named "stop" is present in the files folder of the child's SFTP home directory. The child nodes create this file when shutting down but it can also be created manually.

Furthermore, if data has not been picked up by a child within six hours, then it will be reassigned to the master node. This ensures that data is left unprocessed if for example a node crashes unexpectedly.

**Dynamically Adding Nodes**

The master instance of the solver re-reads the remote configuration file on each loop, and so nodes can be added, removed, disabled or enabled on demand, without needing to restart the master.

So, for example, one could create a configuration listing several child nodes with capacity set to zero, which would mean they were initially disabled and so the Solver would assign all candidates to the master node. However, if volumes rose, an instance of the solver could be started up on a child node and the master configuration file updated. On the master node's next loop, data would be automatically assigned to the children.

You can also _manually_ move files between child node folders on the server. For instance, if you want to move some load from node1 to node2 you can move some of the candidate files from node1's _candidates_ folder to node2's _candidates_ folder. A UNIX command to do this might be

_ls -1 ~node/files/candidates | head -100 | while read i ; do mv \$i ~node2/files/candidates; done_

**Processing Uploaded Data**

Upon each loop round, the master node will scan each node's home directory for uploaded results. These will be integrated into the trajectories data, and the databases updated.

**Child Node Configuration**

The child must be running in mcmode 1 or 2 - no other mode is supported at present.

The child configuration file specifies the server, user and key to use for connections to the master node. Port is optional but can be specified if a non-standard SFTP port is in use.

\[mode\]
mode = child
<br/>\[children\]
host = testserver.somewhere.com
user = node1
key = ~/.ssh/somekey
port = 22

At startup, the child node will connect to the master and remove the "stop" file, if present. This indicates to the master that it is "open for business". The child will then loop around, downloading any assigned data and processing it. Downloaded files are moved to a subfolder _processed_ on the sftp server. Upon completion it will upload the results to the sftp server.

**Stopping a Child Node**

Any node can be terminated by pressing Ctrl-C or by sending SIGINT to its process. The node will stop processing immediately and create a "stop" file on the sftp server.

Note that termination will leave data incompletely processed and no upload will take place, and so it is advisable to wait until the child's logfile indicates it is idle.

Alternatively, one can identify the most recent, potentially incomplete, data set that was assigned to the node by looking in the child's _processed_ folders and copying the data back to the master node's _candidate_ or _phase1_ folders as appropriate.

**Recovering from a Child Node Crash or Shutdown**

If a child node crashes or is otherwise terminated during processing, the data can be recovered and redistributed to the master or other nodes, or indeed to the failed node after it has restarted. This can be done by looking in the _processed_ folders on the child, or if the child node is unavailable, in the child node's _processed_ folder on the master node, identifying the most recent data, and moving it as necessary.

## Duplicate Transaction Checks

A check has been introduced in both candidate finding and phase1 solving that examines the database for potential duplicate or mergeable trajectories.

Duplicates are defined as trajectories that contain the same observations. When detected, the solution with the least ignored observations is retained and the duplicates are deleted.

Mergeable trajectories are defined as those with at least one common observation. In principle these should never arise but in practice with a distributed processing model, it is possible. For example, a candidate might be found and handed off for solving but while it is still being solved, a new observation might be uploaded by a camera, and so on its next pass the candidate finder creates a second candidate with an additional observation and a different reference timestamp. When detected the mergeable trajectories are deleted and all observations are marked unpaired, so that on its next pass the candidate finder should identify a single combined candidate.

## Databases

The JSON database has been replaced by three SQLite databases, one for Observations, one for Trajectories and one for Candidates.

This approach was taken because most database writing takes place during phase 1 solving, but some takes place during candidate finding notably when reprocessing previous trajectories with new observations. By splitting the databases, we minimise potential concurrent write situations. SQLite does not support multiple simultaneous writes, and though it will back off and retry after a few milliseconds, it is preferrable to avoid unnecessary delays.

**If The Solver Crashes**

Although most operations are immediately committed to the databases, it is possible for the solver to crash and leave an incomplete transaction. This will be revealed by the existence of write-ahead logs in the database directory e.g. "observations.db-wal".

If this file is present, then upon next startup, SQLite will complete any pending transactions. This minimises the risk of data loss, but at worst may lead to observations being reprocessed. This is preferable to trajectories being missed.

**The Legacy JSON database**

The legacy JSON database is no longer used It is not deleted however, after an initial data migration described below it is no longer being used and can be moved to long-term storage if desired.

**Initial Population of SQLite**

When the Solver is started up, it checks for the existence of the new databases. If they are not present, it creates them and prepopulates them with the last few days of data from the old JSON database if available. For example, if run with the auto flag and default period of 5 days lookback, the last five days of data will be copied to SQLite. This ensures that sufficient observation and failed trajectory data is present for normal operation of the solver.

The JSON database is then closed and is not referred to again even on subsequent runs of the solver. It is not truncated, archived or deleted and remains as an historical record of the state of the database as at the cutover date.

**Historic Reruns**

If the solver is rerun for an historic period from before the cutover, there will be no paired observations or failed trajectories data in the databases. The assumption is that if we are rerunning for an historic period, we are either looking to integrate new observations into the dataset or to recalculate trajectories using improved mathematical models. In either case it seems likely we'd want to start by reanalysing the raw data.

That said, should we wish to copy historical data into the SQLite databases, this can be done with the command-line interface to CorrelateDB as shown below:

_python -m wmpl.Trajectory.CorrelateDB --dir_path rms_data --action copy --timerange "(20251215-000000,20251222-000000)"_

This will copy observations and failed trajectories into SQLite from the JSON database in _rms_data_ for a date range 2025-12-15 to 2025-12-22, creating the SQLite databases if necessary.

This is quite a slow operation - on my 4-core i7 desktop it takes about several minutes to copy a week's worth of data.

## Command Line Options

One option has been removed and two new options added

Removed:

- \--**remotehost**: this has been superseded by the remote configuration file

Added:

- \--**addlogsuffix**: default false - this adds a suffix to the logfile to indicate which phase is being run.
For example, with this flag passed, the logfile for a run in MCMODE*CANDS would be something like \_correlate_rms_20260214_121314_cands.log* whereas a phase-1 log file would be _correlate_rms_20260214_121314_simple.log_.

- **\--archivemonths:** default 3: this specifies the number of months' data to keep in the databases. Data older than this number of months will be archived. A value of zero means keep everything. This flag is useful during testing or when rerunning for an historical data when you might not want to remove older data.
Binary file added Documentation/node_structure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion wmpl/Rebound/REBOUND.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
REBOUND_FOUND = True

except ImportError:
print("REBOUND package not found. Install REBOUND and reboundx packages to use the REBOUND functions.")
# don't print a message here as its already printed whenever REBOUND_FOUND is False
REBOUND_FOUND = False

from wmpl.Utils.TrajConversions import (
Expand Down
Loading