hop package

Subpackages

Submodules

hop.pipeline module

class hop.pipeline.HectorPipe(config_filename=None, Profit_files_location=None, config_dictionary=None, P_and_Q_offset_filename='Hexa_final_prism_gluing_PQ_table.xlsx')[source]

Bases: object

The Hector Observations pipeline. This class has methods to:

  • Use the Survey Simulator to create an input catalogue from a larger master catalogue

  • Tile an input catalogue using the Hector tiling code

  • Apply distortion correction to each tile

  • Configure each tile

  • Run the HexabundleAllocation code

add_fibre_type_column(tile_filename)[source]
allocate_hexabundles_for_all_tiles()[source]
allocate_hexabundles_for_single_tile(fileNameGuides, fileNameHexa, robot_temperature, obs_temperature, plot=False)[source]
apply_config_code_to_tile(tile_number, config_timeout=None)[source]
apply_distortion_correction(tile_out_fname, guide_tile_out_fname, tile_out_fname_after_DC, guide_tile_out_fname_after_DC, tile_RA, tile_Dec, guide_stars_for_tile, verbose=False, plot_save_filename=None, date='', robot_temp=12, obs_temp=12, label='test_label', plateID='test_plateID', distortion_file='', linearity_file='', sky_fibre_file='', profit_file_dir='', check_sky_fibres=True, turn_off_linearity=False, rot_matrix='', apply_PM_corr=True, debug_levels=None)[source]

Take a tile file from the tiling process and apply Keith’s distortion correction code. Then turn his one output file into the two output files which Caro’s configuration code expects. We also need to do some work to edit the headers/etc.

If plot_save_filename is not None, save an image of the tile before/after the correction is applied

find_premade_tiles()[source]

Find any tiles which have already been configured in the output folders.

get_remaining_targets(df_targets)[source]

Get the number of targets remaining in the field to tile

load_input_catalogue()[source]

Load an input target catalogue, guide star catalogue and standard star catalogue

make_header_dictionary()[source]
make_output_file_for_Tony(tile_file, robot_file)[source]

Take our output files and make them into a format which Tony can read in. This means:

  • ‘#’ is reserved for a comment. Header key/value pairs should not start with a #, but the row names (which are only included for readability, Tony’s code doesn’t use them) should

  • Missing values should be blank- i.e. na_rep=’’

  • things which are specified as an integer must be made an integer, not a floating point number

read_header_dictionary_from_file(filename)[source]
run_configuration_code(tile_file_for_configuration, guide_tile_for_configuration, configuration_output_filename, configuration_guide_filename, configuration_plot_filename, config_timeout, log=True, print_output=False)[source]
run_target_selection(plot=False, save=False)[source]
show_skyfibreChanges_and_magnetCountPerAnnuli(tile_fname_1=None, tile_fname_2=None, tile_1_guide=None, tile_2_guide=None, tile_batch=None, tileBatch_count=None, tileBatch_skyFibreChange='OFF')[source]
FUNCTION TO SHOW CHANGES IN SKYFIBRE SUB-PLATE NUMBERS AND MAGNET COUNT CHECK PERFORMED BETWEEN TWO TILES

TWO OPTIONS TO RUN THIS FUNCTION

INPUTS FOR OPTION 1: ‘tile_number_1’ and ‘tile_number_2’

Produces the plots for the first tile and the second tile with changes in skyfibre sub-plate number of second tile compared to first tile being highlighted, and conducts magnet count check per annulus to record any warnings of magnet count in any annulus exceeding the available number of casings on text file.

INPUTS FOR OPTION 2: ‘tile_batch’ and ‘tileBatch_count’

‘tileBatch_skyFibreChange’ - set as ‘ON’ to generate a full set of sky fibre change plots Carries out a magnet count check for each tile pair in a whole batch without any repeats and generates histogram plots for each annulus to show distribution of magnets count for each annulus in a batch. ‘tileBatch_skyFibreChange’ is OFF by default, and if set to ON will also produce a full set of sky fibre change plots for each tile pair in batch.

tile_field(configure_tiles=True, apply_distortion_correction=True, plot=True, config_timeout=None, use_galaxy_priorities=True, robot_temperature=12, obs_temperature=12, label='a test_label', plateID='a test_plateID', date='2022 10 27', check_sky_fibres=True)[source]

Tile an entire input catalogue. Optionally apply distortion correction to go from RA/DEC to locations on the plate and optionally run the configuration code to arrange the hexabundles on the plate.

Module contents