A new command called poledit has been added to the Starlink POLPACK package and will be available in Starlink builds made after 10:00 UTC on 15th April 2020. It allows a vector catalogue to be changed in several different ways, as specified by the MODE parameter (new forms of edit will no doubt be added in the future). One of the available options is to add a new column to the output catalogue containing values read from an NDF. This option is divided into two sub-options – one that stores the values from the NDF directly in the new column, and another that stores a boolean flag in each row of the new column indicating whether the corresponding NDF pixel had a good value or not (i.e. was not set to the “bad” value – the Starlink equivalent of NaN).
This second sub-option (selected using the poledit MASKCOL parameter) can be used to create a column in a POL2 catalogue that indicates which vectors are inside the AST mask. If your catalogue is “mycat.FIT”, then do:
% polpack
% poledit mycat newcat mode=AddColumn col=AST ndf=astmask maskcol=yes
where “astmask.sdf” is an existing NDF that was created by pol2map at step 2 or 3 using the MASKOUT1 parameter. The above command will create a new catalogue in file “newcat.FIT” containing a copy of “mycat.FIT” with an additional column called “AST”. This new column will contain the value zero for each row that has a bad value in “astmask.sdf” (i.e. is outside the AST mask) and the value one for all other rows.
By default, the catalogue and NDF are aligned in (RA,Dec) – that is, the (RA,Dec) values for each row in the catalogue are used to determine the NDF pixel that corresponds to the row. There is an option to align in pixel coordinates instead using the (X,Y) columns in the catalogue.