philrosenfield / match Goto Github PK
View Code? Open in Web Editor NEWPython utilities for processing and plotting input and output from Andy Dolphin's MATCH
License: MIT License
Python utilities for processing and plotting input and output from Andy Dolphin's MATCH
License: MIT License
In scripts/ I assume some common file extensions that I notice are different from Jake's codes. Mine are hard coded in calcsfh_parallel.py. Perhaps we should have a file that can be imported as a dictionary file-type: file-ext, or just decide on common file extensions for the different MATCH input/output files.
We should add vertical lines to the completeness vs. mag plots indicating the 50% (and maybe other) completeness values.
need .cmd reader and asts to support PHAT-like 4-filters.
for .cmd reader, each cmd is pasted below one can split the file.
for the asts, need to read in 8 columns instead of 4.
Q: How should the python implementation of pgpro look?
Background:
Currently, there are two areas of where this codebase has duplicate/competing code. This issue focuses on one, the python implementation of MATCH/pgpro:
residual_plot/Hess_plot.py
and
scripts/graphics/match_plot.py
I added png outputs of both codes Hess_plot_out.png and match_plot_out.png to residual_plot/Hess_plot for comparison.
There are aesthetic differences between the Hess_plot and match_plot, where the color bars are, and where the labels are. Do users prefer one or the other, or should there be an option for one or the other?
[End of question, below is more information]
Going forward:
I'd like to stick to the match_plot interface, which follows the scripts interface. That is, a class for each major input/output from MATCH, in this case, CMD output file class.
So to make the pgpro-like image:
python -m match.scripts.cmd out.cmd
or
python ~/match/scripts/cmd.py out.cmd
and one interested in the API would access match_plot which already has extra options to take a colormap (or list of them), make the image grid 2x2 or 1x4 (or 1x3 and drop the significance figure, which I see often omitted in papers), and can expand to have other options, like kwargs to pass to imshow (the two codes have different hard coded plt.imshow interpolation) and will include grabbing the exclude/include gate code from CMD.pgpro to ensure match_plot is stand alone)
There is more and more spikes added to big pile of scripts. Examples are not clear or completely absent.
It makes it very hard to even attempt to integrate existing code to anything.
A solid API core is needed to properly build tools upon it.
Currently, most scripts here are not compatible with Python3.
"from future import absolute_import "
does not solve this.
For now, use python 2.xx.
asts.completeness_plot(comp_fracs=[0.5])
gives:
TypeError Traceback (most recent call last)
in ()
----> 1 asts.completeness_plot(comp_fracs=[0.5])
/Users/dweisz/Documents/code/match/scripts/asts.pyc in completeness_plot(self, ax, comp_fracs)
537
538 if comp_fracs is not None:
--> 539 self.add_complines()
540 ax.set_xlabel(r'${{\rm mag}}$', fontsize=20)
541 ax.set_ylabel(r'${{\rm Completeness\ Fraction}}$', fontsize=20)
TypeError: add_complines() takes at least 2 arguments (1 given)
At least for log or linear ages, perhaps we should implement astropy units. Currently in scripts.ssp there is a gyr switch that will plot and print ages in Gyr instead of log age. I can think of cases where Myr would also be useful...
Change scripts.fileio format functions to json format or something similar in a dedicated template folder
Given the growing diversity of code, I think we need to provide more examples (e.g., input files, plots) of how to use the code and what to expect as correct output. It would probably be better do this on a folder-by-folder basis? Let's iterate on this.
I'm trying to import a module from the scripts folder, but am unable to do so:
ImportError Traceback (most recent call last)
in ()
----> 1 import match.scripts.asts
/Users/dweisz/Documents/code/match/scripts/init.py in ()
1 """ Everything that relates to MATCH """
----> 2 from config import *
3 from . import graphics
4 from . import likelihood
5 from . import diagnostics
something appears to be wrong with 'config'.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.