Scientific Scripting and Recipes George Moellenbrock (NRAO-Soc)

Slides:



Advertisements
Similar presentations
Chapter 10: Designing Databases
Advertisements

Process Monitoring is only the first step in improving process efficiency.
Chapter 6 Continuous Random Variables and Probability Distributions
Chapter 18 If mathematical analysis is too difficult, we can try each possibility out on paper. That way we can find which alternative appears to work.
By Hrishikesh Gadre Session II Department of Mechanical Engineering Louisiana State University Engineering Equation Solver Tutorials.
Engineering Probability and Statistics - SE-205 -Chap 4 By S. O. Duffuaa.
Random-Variate Generation. Need for Random-Variates We, usually, model uncertainty and unpredictability with statistical distributions Thereby, in order.
Lecture 6 MATLAB functions Basics of Built-in Functions, Help Feature, Elementary Functions (e.g., Polynomials, Trigonometric Functions), Data Analysis,
Probability Densities
Simulation Modeling and Analysis
Database Management: Getting Data Together Chapter 14.
Statistics.
Getting started with Matlab Numerical Methods Appendix B help/techdoc/learn_matlab/learn_matlab.html.
Statistics for Managers Using Microsoft Excel, 5e © 2008 Pearson Prentice-Hall, Inc.Chap 6-1 Statistics for Managers Using Microsoft® Excel 5th Edition.
Version 4 for Windows NEX T. Welcome to SphinxSurvey Version 4,4, the integrated solution for all your survey needs... Question list Questionnaire Design.
Introduction to Array The fundamental unit of data in any MATLAB program is the array. 1. An array is a collection of data values organized into rows and.
Synthesis of Incomplete and Qualified Data using the GCE Data Toolbox Wade Sheldon Georgia Coastal Ecosystems LTER University of Georgia.
Floyd, Digital Fundamentals, 10 th ed EET 2259 Unit 13 Strings and File I/O  Read Bishop, Chapter 9.  Lab #13 and Homework #13 due next week.
Data processing in MathCAD. Data in tables Tables are analogous to matrices Tables are analogous to matrices The numbers of columns and rows can be dynamically.
Chapter Eight Database Applications and Implications.
XP Chapter 4 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Collecting Data for Well-Designed Forms Chapter 4 “Making.
Database System Concepts and Architecture Lecture # 3 22 June 2012 National University of Computer and Emerging Sciences.
© Paradigm Publishing, Inc. 5-1 Chapter 5 Application Software Chapter 5 Application Software.
ROOT: A Data Mining Tool from CERN Arun Tripathi and Ravi Kumar 2008 CAS Ratemaking Seminar on Ratemaking 17 March 2008 Cambridge, Massachusetts.
Databases C HAPTER Chapter 10: Databases2 Databases and Structured Fields  A database is a collection of information –Typically stored as computer.
Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 13 Database Management Systems: Getting Data Together.
UPC/SHMEM PAT High-level Design v.1.1 Hung-Hsun Su UPC Group, HCS lab 6/21/2005.
Chapter 4 Continuous Random Variables and their Probability Distributions The Theoretical Continuous Distributions starring The Rectangular The Normal.
Chapter 5 Statistical Models in Simulation
PROBABILITY & STATISTICAL INFERENCE LECTURE 3 MSc in Computing (Data Analytics)
5-1 Business Statistics: A Decision-Making Approach 8 th Edition Chapter 5 Discrete Probability Distributions.
Appendices A - F A-F Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
Informix IDS Administration with the New Server Studio 4.0 By Lester Knutsen My experience with the beta of Server Studio and the new Informix database.
Steps in simulation study 1. - Clearly understand problem - Reformulation of the problem 2. - Which questions should be answered? - Is simulation appropriate?
1FileScope  FileScope File Editor Query Tool Report Generator File Conversion Tool Full Screen Support Developers Tool.
Chapter 1 : Introduction §Purpose of Database Systems §View of Data §Data Models §Data Definition Language §Data Manipulation Language §Transaction Management.
MA/CS 3751 Fall 2002 Lecture 24. MA/CS 3752 ginput ginput is a Matlab function which takes one argument input: number of points to select in the image.
THE LWA SOFTWARE LIBRARY Jayce Dowell – LWA Users’ Meeting – July 27, 2012.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition.
Ihr Logo Fundamentals of Database Systems Fourth Edition El Masri & Navathe Chapter 2 Database System Concepts and Architecture.
Getting Started with MATLAB 1. Fundamentals of MATLAB 2. Different Windows of MATLAB 1.
Recap Script M-file Editor/Debugger Window Cell Mode Chapter 3 “Built in MATLAB Function” Using Built-in Functions Using the HELP Feature Window HELP.
© Paradigm Publishing Inc. 5-1 Chapter 5 Application Software.
Demo: Power Tools for P8 Presenter: Jay Bowen Demonstration Topic: Choice List Features Demo URL below Power Tools Choice List Support 1. Native P8 Choice.
Sexy Science User Interfaces June 17, 2011 GRITS III, Pasadena, CA John Good.
+ Information Systems and Databases 2.2 Organisation.
Not Invented Here: The Re-use of Commercial Components in HEP Computing Jeremy Walton The Numerical Algorithms Group Ltd, UK.
BOĞAZİÇİ UNIVERSITY DEPARTMENT OF MANAGEMENT INFORMATION SYSTEMS MATLAB AS A DATA MINING ENVIRONMENT.
Database Management Supplement 1. 2 I. The Hierarchy of Data Database File (Entity, Table) Record (info for a specific entity, Row) Field (Attribute,
Starting point for generating other distributions.
EGR 106 Lecture 6 2-D Plotting Graphical presentation has become the standard method to show technical information. Engineers use plots to analyze, visualize,
Learning Simio Chapter 10 Analyzing Input Data
Connections to Other Packages The Cactus Team Albert Einstein Institute
Introduction to Matlab  Matlab is a software package for technical computation.  Matlab allows you to solve many numerical problems including - arrays.
Introduction to KE EMu Unit objectives: Introduction to Windows Use the keyboard and mouse Use the desktop Open, move and resize a.
Postgraduate Computing Lectures PAW 1 PAW: Physicist Analysis Workstation What is PAW? –A tool to display and manipulate data. Learning PAW –See ref. in.
N Astronomical Information Processing System n C++, scripting, GUI’s, libraries, toolkits and applications n Designed by a team of astronomers and programmers.
R objects  All R entities exist as objects  They can all be operated on as data  We will cover:  Vectors  Factors  Lists  Data frames  Tables 
Project Planning Defining the project Software specification Development stages Software testing.
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.. Chap 6-1 Chapter 6 The Normal Distribution and Other Continuous Distributions Basic Business.
Math 252: Math Modeling Eli Goldwyn Introduction to MATLAB.
2) Database System Concepts and Architecture. Slide 2- 2 Outline Data Models and Their Categories Schemas, Instances, and States Three-Schema Architecture.
EGR 106 – Week 5 – 2-D Plots Question : Why do engineers use plots? Answer : To analyze, visualize, and present data. Matlab has many useful plotting options.
Metadata for the SKA - Niruj Mohan Ramanujam, NCRA.
Is My Model Valid? Using Simulation to Understand Your Model and If It Can Accurately Predict Events Brad Foulkes JMP Discovery Summit 2016.
Modeling and Simulation CS 313
DATA MODELS.
Essential Skills Wales
Databases.
funCTIONs and Data Import/Export
Presentation transcript:

Scientific Scripting and Recipes George Moellenbrock (NRAO-Soc)

Scientific scripting philosophy n Allow complete and general access to all data, both user-defined and standard n Provide toolkit within which data may be manipulated at a variety of hierarchical levels u "Low-level" tools for generic data access and manipulation--- a very impressive "scientific calculator" u "Intermediate-" and "High-level" tools for aggregate methods and traditional applications n Custom data analysis optionally combining traditional and user-developed methods

Scientific scripting capabilities n Basic scripting in Glish n Flexible Plotting via pgplotter tool n Variety of generic ("low-level") analysis functions and tools available (e.g., statistics, fft, fitting) n Seamless access to the intermediate-level data reduction and analysis tools (e.g., ms, imager, image)

Generic data analysis n The nuts and bolts methods which underlie standard data processing in aips++ are available in Glish as generic tools and global functions u Mathematics module (s tatistics, randomnumbers, fftserver) u Functionals u Fitting u Quanta and Measures u Misc (stopwatch, misc)

Plotting with pgplotter n Familiar PGPLOT commands n Several new shortcut functions (plotxy, etc.) n Interactive plotter gui u Zooming u Printing u Cursor methods incorporated as Glish/Tk events n Editor - include 'pgplotter.g'

pgplotter - include ‘pgplotter.g’ - mypg:=pgplotter() - ang:=[0:90] ; nang:=shape(ang) - beta:=0.75+[1:9]/40 ; nbeta:=shape(beta) - D:=array(0.0,nbeta,nang) - for (i in 1:nbeta) { + gamma:=1.0/sqrt(1-beta[i]^2) + for (j in 1:nang) { + D[i,j]:=1.0/ + (gamma*(1-beta[i]*cos(ang[j]*pi/180))) + } - mypg.env(0.0,90.0,0.5*min(D),1.1*max(D),0,0) - mypg.sci(3) - for (i in 1:shape(beta)) { + mypg.line(ang,D[,i]) + mypg.ptxt(ang[3],D[i,3],0,0, + spaste('\\g=',as_string(beta[i]))) + } - mypg.lab('LOS Angle','Doppler Factor', + 'Doppler Factor vs. LOS Angle')

Statistics n Given an array, standard statistical quantities may be obtained via global functions - include 'statistics.g' # ('mathematics.g') - x:=[4.7, 4.8, 4.8, 4.9, 5.0, 5.1, 5.2] - mean(x) median(x) variance(x) stddev(x) x:=[2+6i, 4-5i, 3+11i] - mean(x) 3+4i

Random numbers n Uniform, discrete uniform, binomial, Erlang, geometric, hpergeometric, lognormal, negative exponential, normal, poisson, Weibull deviates available from the randomnumbers tool in the mathematics module: - include 'randomnumbers.g' # ('mathematics.g') - rand:=randomnumbers() - x:=rand(18.0,3.0,100); - print mean(x), median(x) print variance(x), stddev(x), skew(x)

fftserver n Given an arrays of gridded data, FFTs and related operations may be performed u Multiple-dimension FFTs, arrays of any length, real or complex u Auto- and cross-correlations u Convolution - include 'fftserver.g' ('mathematics.g')

fftserver – an example - include 'fftserver.g' - myfft:=fftserver() - ang:=2*pi*[1:57]/7.0 - y:=complex(cos(ang),sin(ang)) - myfft.complexfft(y,-1) - mypg.plotxy(seq(shape(y)), + abs(y),xtitle='bin', + ytitle='abs[FT(y)]’, + title='fftserver example') - smth:=gaussian1d([-25,25],1.0,0.0,10) - ysmth:=myfft.convolve(abs(y),smth) - ysmth:=ysmth/max(ysmth) - mypg.plotxy(seq(shape(ysmth)), + ysmth,newplot=f,linecolor=3)

Fitting n A Glish interface to the C++ Least Squares Fitting routines u Linear and non-linear u Real and Complex u Complete and Singular Value Decomposition u External Constraints optional - include 'fitting.g'

Fitting – an example - include 'fitting.g' - x:=seq(100) - y:= *x + rand.normal(0.0,200.0,100) - myfit:=fitter() - myfit.init(n=2) - myfit.makepoly(x,y) - myfit.fit() - sol:=myfit.solution(); - err:=myfit.error() - print sol ; print err [ ] [ ] - yfit:=sol[1] + sol[2]*x - mypg:=pgplotter() - mypg.plotxy(x,y, + plotlines=F,xtitle='X', + ytitle='Y',title='Y vs. X'); - mypg.plotxy(x,yfit, + plotlines=T, + newplot=F,linecolor=3)

Quanta n Quanta are values with units contained in a record n A variety of physical constants and decimal prefixes are available n Quanta may be combined algebraically: - include 'quanta.g’ - d:=25 # the diameter of a typical telescope - print A:=dq.quantity(pi*(d^2)/4,’m2’) [value= , unit=m2] - eff:=0.60 # its aperture efficiency - print k:=dq.constants('k’) # Boltzmann's constant [value= e-23, unit=J/K] - print g:=dq.div( dq.mul(eff,A), dq.mul(2,k)) [value= e+25, unit=m2/(J/K)] - print g:=dq.convert(g,’K/Jy’); [value= , unit=K/Jy] - Tant:='3K’ - S:=dq.div(Tant,g) - dq.convert(S,’Jy’) [ , unit=Jy]

Measures n Measures are quanta describing coordinates in reference frames u Positions (on earth), directions (in space), epoch, frequency, radialvelocity, doppler, baseline, uvw, earthmagnetic n Conversions between reference frames, which may be combinations of measures of different types - include 'measures.g’ - print vlapos:=dm.observatory('VLA'); [type=position, refer=ITRF, m2=[value= , unit=m], m1=[unit=rad, value= ], m0=[unit=rad, value= ]] - print dm.measure(vlapos,'WGS84') # convert to geodetic [type=position, refer=WGS84, m2=[value= , unit=m], m1=[unit=rad, value= ], m0=[unit=rad, value= ]] - dm.doframe(vlapos) - print tim:=dm.epoch('utc','today') ; dm.doframe(tim) [type=epoch, refer=UTC, m0=[value= , unit=d]] - print srcdir:=dm.source(' ') [type=direction, refer=J2000, m1=[value= , unit=rad], m0=[unit=rad, value= ]] - print 'AZ =', dq.convert( dm.getvalue( dm.measure(srcdir,'AZEL'))[1],'deg') AZ = [value= , unit=deg] - print 'EL =', dq.convert( dm.getvalue( dm.measure(srcdir,'AZEL'))[2],'deg') EL = [value= , unit=deg]

The table system n Aips++ stores all data in tables which consist of columns of associated information n The table tool provides generic access to standard aips++ and user-defined data tables u Summary & Browsing u Get/put of cells, columns u Selection (TaQL), iteration and sorting u Conversion to table from ascii, FITS formats

The table browser

Interface to standard radioastronomy analyses n Since the intermediate- and high-level aips++ tools use Glish to "glue" them together, these aggregate methods and their constituents are conveniently available for use in a user's novel applications u Access to aips++ Measurementset data via the ms tool u Conversion of Glish arrays to aips++ images F analysis in the image tool, viewer F model generation for imager/calibrater u Conversion of aips++ images to Glish arrays for ad hoc analysis

Example: Arrays as images - include 'image.g' - y:=array(0,100,100); - for (i in 1:100) { + for (j in 1:100) { + y[i,j]:=cos(2+2*pi*i/20 + 2*pi*j/30); + } - myim:=imagefromarray(outfile='array.im', pixels=y, linear=T); - myim.fft(amp='fft.im',axes=[1,2]);

Other useful scripting concepts n scripter—maintains a record of operations performed via aips++ guis. n logger—maintains a record of operations entered at the command line; can be saved to a script file n simulator—generates simulated data in Measurementset format

Recipe Repository