#from anuga.validation_utilities.parameters import cfl args = anuga.get_args() alg = args.alg np = args.np verbose = args.verbose #--------------------------------- # Get the current svn revision #--------------------------------- timestamp = time.asctime() major_revision = anuga.get_version() try: # This fails if using git for version control minor_revision = anuga.get_revision_number() except: try: # This works when using git on unix minor_revision = os.popen("git show-ref --head -s | head -n1").read().strip() except: # This is a fallback position minor_revision = 'unknown' #---------------------------------- # Now it is ok to create the latex # macro file with run parameters # # FIXME: THis is a little dangerous as # this is changed before all the tests
system('bibtex %s' %texfile) # Create pdf file #system('dvips %s -o %s.ps' %((texfile,)*2)) #system('ps2pdf %s.ps' %texfile) # Create html pages if do_html is True: system('latex2html %s' %texfile) else: print 'Skipping html version for %s as requested' %texfile # Clean-up #system('/bin/rm version.tex') #system('svn update') # Restore version file #system('cp *.pdf ../') #system('cp anuga_user_manual.pdf ../../anuga_core/doc') print 'Cleanup aux tex files' system('rm *.aux *.bbl *.blg *.idx *.ilg *.ind *.log *.out *.toc *.syn *.synctex.gz ') # Print print 'User manual compiled' print 'Anuga version:', get_version() print 'Build:', get_revision_number() system('date')
def store_header(self, outfile, times, number_of_points, description='Converted from URS mux2 format', sts_precision=netcdf_float, verbose=False): """Write a header to the underlying data file. outfile handle to open file to write times list of the time slice times *or* a start time number_of_points the number of URS gauge sites description description string to write into the STS file sts_precision format of data to write (netcdf constant ONLY) verbose True if this function is to be verbose If 'times' is a list, the info will be made relative. """ outfile.institution = 'Geoscience Australia' outfile.description = description try: revision_number = anuga.get_revision_number() except: revision_number = None # Allow None to be stored as a string outfile.revision_number = str(revision_number) # Start time in seconds since the epoch (midnight 1/1/1970) # This is being used to seperate one number from a list. # what it is actually doing is sorting lists from numeric arrays. if isinstance(times, (list, num.ndarray)): number_of_times = len(times) times = ensure_numeric(times) if number_of_times == 0: starttime = 0 else: starttime = times[0] times = times - starttime #Store relative times else: number_of_times = 0 starttime = times outfile.starttime = starttime # Dimension definitions outfile.createDimension('number_of_points', number_of_points) outfile.createDimension('number_of_timesteps', number_of_times) outfile.createDimension('numbers_in_range', 2) # Variable definitions outfile.createVariable('permutation', netcdf_int, ('number_of_points',)) outfile.createVariable('x', sts_precision, ('number_of_points',)) outfile.createVariable('y', sts_precision, ('number_of_points',)) outfile.createVariable('elevation', sts_precision, \ ('number_of_points',)) q = 'elevation' outfile.createVariable(q + Write_sts.RANGE, sts_precision, ('numbers_in_range',)) # Initialise ranges with small and large sentinels. # If this was in pure Python we could have used None sensibly outfile.variables[q + Write_sts.RANGE][0] = max_float # Min outfile.variables[q + Write_sts.RANGE][1] = -max_float # Max self.write_dynamic_quantities(outfile, Write_sts.sts_quantities, times)
def store_header(self, outfile, times, number_of_points, description='Converted from URS mux2 format', sts_precision=netcdf_float, verbose=False): """Write a header to the underlying data file. outfile handle to open file to write times list of the time slice times *or* a start time number_of_points the number of URS gauge sites description description string to write into the STS file sts_precision format of data to write (netcdf constant ONLY) verbose True if this function is to be verbose If 'times' is a list, the info will be made relative. """ outfile.institution = 'Geoscience Australia' outfile.description = description try: revision_number = anuga.get_revision_number() except: revision_number = None # Allow None to be stored as a string outfile.revision_number = str(revision_number) # Start time in seconds since the epoch (midnight 1/1/1970) # This is being used to seperate one number from a list. # what it is actually doing is sorting lists from numeric arrays. if isinstance(times, (list, num.ndarray)): number_of_times = len(times) times = ensure_numeric(times) if number_of_times == 0: starttime = 0 else: starttime = times[0] times = times - starttime #Store relative times else: number_of_times = 0 starttime = times outfile.starttime = starttime # Dimension definitions outfile.createDimension('number_of_points', number_of_points) outfile.createDimension('number_of_timesteps', number_of_times) outfile.createDimension('numbers_in_range', 2) # Variable definitions outfile.createVariable('permutation', netcdf_int, ('number_of_points', )) outfile.createVariable('x', sts_precision, ('number_of_points', )) outfile.createVariable('y', sts_precision, ('number_of_points', )) outfile.createVariable('elevation', sts_precision, \ ('number_of_points',)) q = 'elevation' outfile.createVariable(q + Write_sts.RANGE, sts_precision, ('numbers_in_range', )) # Initialise ranges with small and large sentinels. # If this was in pure Python we could have used None sensibly outfile.variables[q + Write_sts.RANGE][0] = max_float # Min outfile.variables[q + Write_sts.RANGE][1] = -max_float # Max self.write_dynamic_quantities(outfile, Write_sts.sts_quantities, times)