nedkit¶
XNEdit macros for the NED team at IPAC. Reshaping a data file by hand is slow and easy to get subtly wrong, and a macro does the same edit the same way every time. Python utilities live here too, for the jobs too big to run inside the editor.
New here? Getting started has the install in four steps. XNEdit itself is built from source, once ever. After that the nine commands are a download and a command.
Install the commands Clean up a pasted table
The commands¶
-
Expand Tabs
For a table pasted out of a paper or a spreadsheet. Writes the spaces each tab stands for, at the editor's own tab width, so nothing moves on screen and the commands that refuse a tab will take the file.
-
Normalize Characters
For characters that look like ASCII and are not. Rewrites the dashes, quotes and ligatures a PDF brings with it, and reports whatever it could not safely translate.
-
Fold Letters to ASCII
For accented names and Greek symbols. Turns
BalázsintoBalazsandαintoa, keeping case, and lists every Greek letter it replaced, since those readings collide. -
Pipe at Cursor Column
For a fixed-width table with no delimiter in it. Writes a
|down the column the cursor is in, on every line at once, and it is on the right-click menu so you can do a boundary without leaving the text. -
Pipe at Columns
For several boundaries in one pass. Asks which columns, and whether to write over the space there or push the rest of the line right, then does the whole file.
-
RA to NED Form
For the right ascension column, picked out with a rectangular selection. Takes the colons out and changes nothing else, so
00:10:09.97becomes001009.97at whatever precision the source published. -
Dec to NED Form
For the declination column. Takes the colons out and always writes the sign, so
15:34:09.66becomes+153409.66and a value between 0 and -1 degrees cannot lose the one character telling north from south. -
Pad Columns
For a pipe-delimited table that has gone out of true. Pads every field to the width of the widest value in its column, counting characters rather than bytes, so the pipes line up again.
-
Trim Trailing Blanks
For invisible whitespace at the ends of lines. Removes trailing spaces and tabs, and leaves the buffer alone when there is nothing to remove.
They are in the order they are meant to be run. Cleaning up a pasted table walks the sequence through on a real file, and getting started covers installing them in the first place.
Beyond the editor¶
Some jobs are too big to run inside XNEdit.
ned-transients prepares the monthly supernova, fast radio
burst and gamma-ray burst load: it fetches the lists from the Transient Name
Server and Swift XRT and writes the loadstatus file, the ptables, the directory
tree and the Jira ticket. It loads nothing and chooses nothing.
Which editor¶
Written for XNEdit. They are ordinary NEdit macros, so classic NEdit 5.7 runs them too.
| Compared on | XNEdit | NEdit 5.7 |
|---|---|---|
| Tested against | every week | every week |
| Settings live in | ~/.xnedit/ |
~/.nedit/ |
| A column counts | characters | bytes |
| A file it cannot read as UTF-8 | locks, and every command refuses it | opens as if nothing were wrong |
The column row is the one that bites. Balázs is six columns wide on XNEdit
and seven on 5.7, so anything that counts columns lands a place out. When the
file is locked covers the
other row.
Under XQuartz¶
XNEdit is an X11 application, which explains three things that look like bugs.
| What you see | Why |
|---|---|
| The menu bar is inside the window | X11 draws its own, rather than using the Mac one |
| Copy and paste do not reach other Mac apps | They go through the X selection |
t_print() prints nothing |
It lands in the terminal that launched xnedit |