imager_create_dbs
*Master Side of the recipe *
-
class lofarpipe.recipes.master.imager_create_dbs.imager_create_dbs
responsible for creating a number
of databases needed by imaging pipeline:
- Using pointing extracted from the input measurement set a database is
created of sources based on information in the global sky model (gsm)
One source db is created for each image/node:
- The pointing is supplied to to GSM database resulting in a sourcelist
- This sourcelist is converted into a source db
- Possible additional sourcelist from external sources are added to this
source list
- For each of the timeslice in image a parmdb is created. Each timeslice is
recorded on a different time and needs its own calibration and therefore
instrument parameters.
Recipe inputs
Parameters: |
- assoc_theta – (StringField) assoc_theta is used in creating the skymodel, default == None (StringField)
- makesourcedb_path – (ExecField) Path to makesourcedb executable. (ExecField)
- monetdb_hostname – (StringField) Hostname of monet database (StringField)
- monetdb_name – (StringField) db name of monet database (StringField)
- monetdb_password – (StringField) password on monet database (StringField)
- monetdb_port – (IntField) port for monet database (IntField)
- monetdb_user – (StringField) user on the monet database (StringField)
- parmdb_executable – (ExecField) Location of the parmdb executable (ExecField)
- parmdb_suffix – (StringField) suffix of the to be created paramdbs (StringField)
- parmdbs_map_path – (StringField) path to mapfile containing produced parmdb files (StringField)
- slice_paths_mapfile – (FileField) Location of the mapfile containing the slice paths (FileField)
- source_list_path – (StringField) Path to sourcelist from external source (eg. bdsm) use an empty string for gsm generated data (StringField)
- sourcedb_map_path – (StringField) path to mapfile containing produced sourcedb files (StringField)
- sourcedb_suffix – (StringField) suffix for created sourcedbs (StringField)
- working_directory – (StringField) Working directory used on nodes. Results location (StringField)
|
Recipe outputs (job.results[parameter])
Parameters: |
- parmdbs_map_path – (FileField) On succes contains path to mapfile containing producedparmdb files (FileField)
- sourcedb_map_path – (FileField) On succes contains path to mapfile containing produced sourcedb files (FileField)
|
-
_validate_input_data(slice_paths_map, input_map)
Performs a validation of the supplied slice_paths_map and inputmap.
Displays error message if this fails
-
_run_create_dbs_node(input_map, slice_paths_map, assoc_theta)
Decompose the input mapfiles into task for specific nodes and
distribute these to the node recipes. Wait for the jobs to finish and
return the list of created jobs.
-
_collect_and_assign_outputs(jobs)
Collect and combine the outputs of the individual create_dbs node
recipes. Combine into output mapfiles and save these at the supplied
path locations
*Node Side of the recipe*
-
class lofarpipe.recipes.nodes.imager_create_dbs.imager_create_dbs(job_id, host, port)
Creates two dbs: A sourcedb containgin sources in the direction of the
current measurement. And a parmdb which will be used for an instrument
table:
- Create a sourcelist
In the first major imaging cycle filled by the gsm. In later cycles
this list is retreived from the sourcefinder
- The GSM does not create a sourceDB. It creates a text file which is con-
sumed by makesourcedb resulting in a sourceDB (casa table).
Later cycles will be added to this existent sourcedb
There is a single sourcedb for a concatenated measurement set/ image
- Each individual timeslice needs a place to collect parameters: This is
done in the paramdb.
- Assign the outputs of the script
-
_create_source_list(source_list_path_extern, sourcedb_target_path, concatenated_measurement_set, monet_db_hostname, monet_db_port, monet_db_name, monet_db_user, monet_db_password, assoc_theta)
Create a sourcelist file with sources in the current fov of the ms.
If no external path is provided a call is done to the gsm to retrieve
a list.
return both the created sourcelist and a boolean to signal if an
external sourcelist has been retrieved.
-
_create_source_db(source_list, sourcedb_target_path, working_directory, executable, append=False)
_create_source_db consumes a sourcelist text file and produces a
source db (pyraptable).
If the append parameter is set to true. It expects an already existing
sourcedb on the supplied path and will then append the sources in
the list. typically used multiple iterations of the imaging pipeline,
with self calibration
-
_field_of_view(measurement_set, alpha_one=None)
_field_of_view calculates the fov, which is dependend on the
station type, location and mode:
For details see:
http://www.astron.nl/radio-observatory/astronomers/lofar-imaging-capabilities-sensitivity/lofar-imaging-capabilities/lofar
-
_create_parmdb(parmdb_executable, target_dir_path)
_create_parmdb, creates a parmdb_executable at the target_dir_path using
the suplied executable. Does not test for existence of target parent dir
returns 1 if parmdb_executable failed 0 otherwise
-
_create_parmdb_for_timeslices(parmdb_executable, slice_paths, suffix)
_create_parmdb_for_timeslices creates a paramdb for each of the
supplied time slices. The paramdb path = input path + suffix.
returns 0 on succes 1 on failure:
-
_create_monet_db_connection(hostname, database, username, password, port)
Create and return a monat db connection. Return None if the creation
failed and log the error. Returns the connection if succeed.
-
_get_ra_and_decl_from_ms(measurement_set)
This function uses pyrap to read the ra and declanation from a
measurement set (used by expected_fluxes_in_fov). This is a position
in the sky. These values are stored in the field.phase_dir in the first
row. All exceptions thrown are caught and logged, return None if reading
failed
-
_get_soucelist_from_gsm(measurement_set, sourcelist, monet_db_host, monet_db_port, monet_db_name, monet_db_user, monet_db_password, assoc_theta=None)
Create a bbs sky model. Based on the measurement (set) suplied
The skymap is created at the sourcelist