Last Update: 12.12.2014
Offline Version
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Start with this yaml file | |
| id: https://w3id.org/linkml/examples/image | |
| name: image | |
| prefixes: | |
| linkml: https://w3id.org/linkml/ | |
| image: https://w3id.org/linkml/examples/image | |
| imports: | |
| - linkml:types | |
| default_range: string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "title": "CreateOmeZarr", | |
| "type": "object", | |
| "properties": { | |
| "input_paths": { | |
| "title": "Input Paths", | |
| "type": "array", | |
| "items": { | |
| "type": "string" | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def normalized_gr_3d(_samples, _N, _nbins, _rho): | |
| ''' | |
| Returns g^{(2)} with the correct normalization, i.e. it goes to | |
| ((N-1)/N)*rho^2 for distances which are large, but smaller than L/2. | |
| Args: | |
| _samples : | |
| _N : number of particles | |
| _nbins : number of bins | |
| _rho : number density (number of particle divided by volume) | |
| ''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # numpy is the library which allows you to do all sort of calculations, | |
| # and you need to import it at the beginning of the file | |
| import numpy | |
| # this is your function of the two frequencies, needed to construct the matrix | |
| # you need to replace term2 with your own function | |
| def fun(omega1, omega2): | |
| term1 = numpy.exp(- (omega1 - omega2) ** 2 / 1000.0) | |
| term2 = numpy.sinc((omega1 - omega2) ** 2) | |
| return term1 * term2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # create and manipulate a list A | |
| A = [1, 2, 3, 7, 3] | |
| print 'A:', A | |
| A.append(19) | |
| print 'A:', A, ', after A.append(19)' | |
| print 'A.index(7): %i' % A.index(7) | |
| print 'A.count(3): %i' % A.count(3) | |
| print 'A[1]:', A[1] | |
| print 'A[-3:]:', A[-3:] | |
| print 'sorted(A):', sorted(A) |