Skip to content
Snippets Groups Projects
Select Git revision
  • 413e217564d1b0f3a2836df6569188f5c93855b6
  • master default protected
  • development_0.9.5/2.2.2_post_merge_david_branch
  • dhendriks/versions/0.9.5/2.2.2_post_merge
  • feature/MC_sampling
  • push_test
  • development_0.9.5/2.2.2
  • fix/new_mac_fix
  • development_0.9.3/2.2.1_pre-merge
  • dhendriks/versions/0.9.3/2.2.1_pre_merge
  • development_0.9.4/2.2.1
  • development_0.9.5/2.2.1
  • development_0.9.3/2.2.1
  • papers/JOSS_release
  • feature/binary_c_ensemble_manager_implementation
  • feature/HPC
  • development_0.9.2/2.2.1
  • development_0.9.2/2.2.0
  • auto_resolution
  • feature/generate_docs_script
  • feature/custom_system_generator_endpoint
  • 0.9.1
  • v2.2.0
  • archive/queue_solution
  • archive/capsules
  • archive/gitlab_pages
  • 0.3.1
  • 0.3
  • archive/population
  • archive/david_branch
  • archive/black_formatting
  • 2.1.6
  • archive/help_function
  • 0.21
  • 0.2
  • archive/restructure_module
  • 2.1.5
  • archive/readthedocs
  • archive/better_makefile
  • archive/src_location
  • 2.1.4
41 results

make_bse_tables.pl

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    make_bse_tables.pl 1.31 KiB
    #!/usr/bin/env perl
    use strict;
    
    #
    # Script to extract and write tables for binary_c to interpolate
    # based on BSE fitting formulae.
    #
    my $binary_c = './binary_c';
    my $tabledir = './src/tables';
    my $prefix = 'BSE_';
    my $postfix = '.h';
    my $test = 1;
    
    check_binary_c();
    
    make_table('TABLE_MS_LR',
               'MS_LR',
               3);
    
    make_table('TABLE_TIMESCALES_H',
               'TIMESCALES_H',
               2);
    
    exit;
    
    ############################################################
    
    sub make_table
    {
        my ($filter, $file, $nparams) = @_;
    
        # table macro
        my $macro = $prefix.$file;
    
        # construct filename
        $file = $tabledir.'/'.$prefix.$file.$postfix;
        $file=~s!/+!/!g;
    
        print `$binary_c | filter $filter | env CIFY=$macro cify.pl > $file`;
        print "Made $file\n";
    
        if($test)
        {
            print "Testing $file : ";
            my $test_result = `test_for_rectangular_table.pl $file $nparams`; 
        
            if($test_result=~/grid seems fine/)
            {
                print "it is fine\n";
            }
            else
            {
                print "error detected!\n$test_result";
                exit;
            }
        }
    
    }
    
    
    sub check_binary_c
    {
        if(`$binary_c --version`=~/MAKE_BSE_TABLES is on/)
        {
            return;
        }
        else
        {
            die("You must build binary_c with MAKE_BSE_TABLES defined in code_options.h");
        }