meteortools.rmsutils.analyseUFOwithRMS

 1# Copyright (C) 2018-2023 Mark McIntyre
 2#
 3# analyse a UFO dataset using RMS - well, a start at it anyway ! 
 4#
 5import os
 6import argparse
 7try: 
 8    import RMS.ConfigReader as cr
 9    from RMS.DetectStarsAndMeteors import detectStarsAndMeteors
10except:
11    print('RMS not available')
12
13
14def analyseUFOwithRMS(config, ff_directory, ff_name):
15    """
16    Analyse a UFO video clip using RMS, to get a list of stars and meteors  
17
18    Arguments:
19        config: [string] An RMS-style config file for the  UFO camera  
20        ff_directory: [string] The location of the file to analyse  
21        ff_name: [string] A video file to analyse.   
22
23    Returns:  
24        (star_list, meteor_list): tuple containing a list of stars and a list of meteors  
25        
26    Note: the name of the video clip must be in %Y%m%d_%H%M%S.%f format.   
27    """ 
28    flat_struct=None
29    dark=None
30    mask=None
31    _, star_list, meteor_list = detectStarsAndMeteors(ff_directory, ff_name, config, flat_struct, dark, mask)
32
33    return star_list, meteor_list
34
35   
36if __name__ == '__main__':
37    # COMMAND LINE ARGUMENTS
38    # Init the command line arguments parser
39    arg_parser = argparse.ArgumentParser(description="Analyses a UFO avi with RMS.")
40
41    arg_parser.add_argument('ff_path', nargs='+', metavar='FILE_PATH', type=str,
42        help='Full path and name of the file to analyse')
43
44    arg_parser.add_argument('-c', '--config', nargs=1, metavar='CONFIG_PATH', type=str,
45        help="Path to a config file which will be used instead of the default one.")
46    
47    # Parse the command line arguments
48    cml_args = arg_parser.parse_args()
49
50    #########################
51
52    ff_directory, ff_name = os.path.split(cml_args.ff_path[0])
53
54    print(ff_directory, ff_name)
55    config = cr.loadConfigFromDirectory(cml_args.config[0], ff_directory)
56    print("loaded config \n\n\n")
57    
58    analyseUFOwithRMS(config, ff_directory, ff_name)
def analyseUFOwithRMS(config, ff_directory, ff_name):
15def analyseUFOwithRMS(config, ff_directory, ff_name):
16    """
17    Analyse a UFO video clip using RMS, to get a list of stars and meteors  
18
19    Arguments:
20        config: [string] An RMS-style config file for the  UFO camera  
21        ff_directory: [string] The location of the file to analyse  
22        ff_name: [string] A video file to analyse.   
23
24    Returns:  
25        (star_list, meteor_list): tuple containing a list of stars and a list of meteors  
26        
27    Note: the name of the video clip must be in %Y%m%d_%H%M%S.%f format.   
28    """ 
29    flat_struct=None
30    dark=None
31    mask=None
32    _, star_list, meteor_list = detectStarsAndMeteors(ff_directory, ff_name, config, flat_struct, dark, mask)
33
34    return star_list, meteor_list

Analyse a UFO video clip using RMS, to get a list of stars and meteors

Arguments: config: [string] An RMS-style config file for the UFO camera
ff_directory: [string] The location of the file to analyse
ff_name: [string] A video file to analyse.

Returns:
(star_list, meteor_list): tuple containing a list of stars and a list of meteors

Note: the name of the video clip must be in %Y%m%d_%H%M%S.%f format.