Note
Go to the end to download the full example code.
Create image example¶
Example for generating a rest-frame physical scale image. This example will: - Build a parametric galaxy (see make_sfzh and make_sed) - Define its morphology - Calculate rest-frame luminosities for the UVJ bands - Make an image of the galaxy, including an RGB image.
Calculated wavelength array:
min = 3.29e+03 Angstrom
max = 1.33e+04 Angstrom
FilterCollection.lam.size = 12811
llllllllllllllll!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!llllllllllllllll
llllll!!!!!!!!!!!!!!!!!!!!!!!!!!!!iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii!!!!!!!!!!!!!!!!!!!!!!!!!!!!llllll
!!!!!!!!!!!!!!!!!!!!!!iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!iiiiiiiiiiiiiiiiiiiiiiiiii>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>iiiiiiiiiiiiiiiiiiiiiiiiii!!!!!!!!!!!!!!
!!!!!!iiiiiiiiiiiiiiiiiiiiii>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>iiiiiiiiiiiiiiiiiiiiii!!!!!!
iiiiiiiiiiiiiiiiii>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>iiiiiiiiiiiiiiiiii
iiiiiiiiii>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>iiiiiiiiii
iiii>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~++++++++++++++++++++++++++++++++++++++++~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>iiii
>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<~~~~~~~~~~~~~~~~~~~~~~~~++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++~~~~~~~~~~~~~~~~~~~~~~~~<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>
>>>>>><<<<<<<<<<<<<<<<<<~~~~~~~~~~~~~~~~~~~~++++++++++++++++++++++++++++++____________________________________________________++++++++++++++++++++++++++++++~~~~~~~~~~~~~~~~~~~~<<<<<<<<<<<<<<<<<<>>>>>>
<<<<<<<<<<<<<<<<~~~~~~~~~~~~~~~~~~++++++++++++++++++++++________________________________________________________________________________________++++++++++++++++++++++~~~~~~~~~~~~~~~~~~<<<<<<<<<<<<<<<<
<<<<<<<<<<~~~~~~~~~~~~~~~~++++++++++++++++++________________________----------------------------------------------------------------________________________++++++++++++++++++~~~~~~~~~~~~~~~~<<<<<<<<<<
<<~~~~~~~~~~~~~~~~++++++++++++++++__________________--------------------------------????????????????????????????????--------------------------------__________________++++++++++++++++~~~~~~~~~~~~~~~~<<
~~~~~~~~~~++++++++++++++++________________--------------------????????????????????????????????????????????????????????????????????????????--------------------________________++++++++++++++++~~~~~~~~~~
~~~~++++++++++++++______________----------------????????????????????????]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]????????????????????????----------------______________++++++++++++++~~~~
++++++++++++____________--------------??????????????????]]]]]]]]]]]]]]]]]]]]]]]]]][[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]??????????????????--------------____________++++++++++++
++++++____________------------??????????????]]]]]]]]]]]]]]]]]][[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]??????????????------------____________++++++
____________------------????????????]]]]]]]]]]]]]][[[[[[[[[[[[[[[[[[[[}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]????????????------------____________
______----------????????????]]]]]]]]]]]]]][[[[[[[[[[[[[[}}}}}}}}}}}}}}}}}}}}{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{}}}}}}}}}}}}}}}}}}}}[[[[[[[[[[[[[[]]]]]]]]]]]]]]????????????----------______
------------??????????]]]]]]]]]]]][[[[[[[[[[[[}}}}}}}}}}}}}}{{{{{{{{{{{{{{{{{{{{{{111111111111111111111111111111111111{{{{{{{{{{{{{{{{{{{{{{}}}}}}}}}}}}}}[[[[[[[[[[[[]]]]]]]]]]]]??????????------------
------??????????]]]]]]]]]][[[[[[[[[[[[}}}}}}}}}}}}{{{{{{{{{{{{{{111111111111111111111111))))))))))))))))))))))))111111111111111111111111{{{{{{{{{{{{{{}}}}}}}}}}}}[[[[[[[[[[[[]]]]]]]]]]??????????------
--????????]]]]]]]]]][[[[[[[[[[}}}}}}}}}}{{{{{{{{{{{{1111111111111111))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))1111111111111111{{{{{{{{{{{{}}}}}}}}}}[[[[[[[[[[]]]]]]]]]]????????--
??????]]]]]]]][[[[[[[[[[}}}}}}}}}}{{{{{{{{{{111111111111))))))))))))))(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((())))))))))))))111111111111{{{{{{{{{{}}}}}}}}}}[[[[[[[[[[]]]]]]]]??????
??]]]]]]]][[[[[[[[}}}}}}}}}}{{{{{{{{1111111111))))))))))))((((((((((((((||||||||||||||||||||||||||||||||||||||||||||||||||||||||(((((((((((((())))))))))))1111111111{{{{{{{{}}}}}}}}}}[[[[[[[[]]]]]]]]??
]]]]]][[[[[[[[}}}}}}}}{{{{{{{{1111111111))))))))))((((((((((||||||||||||||tttttttttttttttttttttttttttttttttttttttttttttttttttt||||||||||||||(((((((((())))))))))1111111111{{{{{{{{}}}}}}}}[[[[[[[[]]]]]]
]][[[[[[[[}}}}}}}}{{{{{{{{11111111))))))))((((((((((||||||||||ttttttttttttttfffffffffffffffffffffffffffffffffffffffffffffffftttttttttttttt||||||||||(((((((((())))))))11111111{{{{{{{{}}}}}}}}[[[[[[[[]]
[[[[[[}}}}}}{{{{{{{{11111111))))))))((((((((||||||||ttttttttttffffffffffffffjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjfffffffffffffftttttttttt||||||||(((((((())))))))11111111{{{{{{{{}}}}}}[[[[[[
[[}}}}}}{{{{{{{{111111))))))))((((((((||||||||ttttttttffffffffffjjjjjjjjjjjjrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrjjjjjjjjjjjjfffffffffftttttttt||||||||(((((((())))))))111111{{{{{{{{}}}}}}[[
}}}}{{{{{{{{111111))))))))((((((||||||||ttttttffffffffffjjjjjjjjrrrrrrrrrrrrxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrrrrrrrrrrrrjjjjjjjjfffffffffftttttt||||||||(((((())))))))111111{{{{{{{{}}}}
}}{{{{{{111111))))))((((((((||||||ttttttffffffffjjjjjjjjrrrrrrrrxxxxxxxxxxnnnnnnnnnnnnnnnnnnnnuuuuuuuuuuuunnnnnnnnnnnnnnnnnnnnxxxxxxxxxxrrrrrrrrjjjjjjjjfffffffftttttt||||||(((((((())))))111111{{{{{{}}
{{{{111111))))))((((((((||||||ttttttffffffjjjjjjjjrrrrrrxxxxxxxxnnnnnnnnnnuuuuuuuuuuuuuuvvvvvvvvvvvvvvvvvvvvvvvvuuuuuuuuuuuuuunnnnnnnnnnxxxxxxxxrrrrrrjjjjjjjjfffffftttttt||||||(((((((())))))111111{{{{
{{111111))))))((((((||||||ttttttffffffjjjjjjrrrrrrxxxxxxnnnnnnnnuuuuuuuuvvvvvvvvvvvvccccccccccccccccccccccccccccccccvvvvvvvvvvvvuuuuuuuunnnnnnnnxxxxxxrrrrrrjjjjjjfffffftttttt||||||(((((())))))111111{{
1111))))))((((((||||||ttttttffffjjjjjjrrrrrrxxxxxxnnnnnnuuuuuuuuvvvvvvvvcccccccccczzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzccccccccccvvvvvvvvuuuuuuuunnnnnnxxxxxxrrrrrrjjjjjjfffftttttt||||||(((((())))))1111
11))))))((((||||||ttttttffffjjjjjjrrrrrrxxxxxxnnnnuuuuuuvvvvvvvvcccccczzzzzzzzzzXXXXXXXXXXXXXXXXYYYYYYYYXXXXXXXXXXXXXXXXzzzzzzzzzzccccccvvvvvvvvuuuuuunnnnxxxxxxrrrrrrjjjjjjfffftttttt||||||(((())))))11
))))((((((||||||ttttffffffjjjjrrrrrrxxxxnnnnnnuuuuuuvvvvcccccczzzzzzzzXXXXXXXXYYYYYYYYYYUUUUUUUUUUUUUUUUUUUUUUUUYYYYYYYYYYXXXXXXXXzzzzzzzzccccccvvvvuuuuuunnnnnnxxxxrrrrrrjjjjfffffftttt||||||(((((())))
))((((((||||ttttttffffjjjjjjrrrrxxxxnnnnnnuuuuvvvvvvcccczzzzzzXXXXXXYYYYYYYYUUUUUUUUJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJUUUUUUUUYYYYYYYYXXXXXXzzzzzzccccvvvvvvuuuunnnnnnxxxxrrrrjjjjjjfffftttttt||||(((((())
((((||||||ttttffffffjjjjrrrrxxxxxxnnnnuuuuvvvvvvcccczzzzXXXXXXYYYYYYUUUUUUJJJJJJCCCCCCCCCCCCLLLLLLLLLLLLLLLLCCCCCCCCCCCCJJJJJJUUUUUUYYYYYYXXXXXXzzzzccccvvvvvvuuuunnnnxxxxxxrrrrjjjjfffffftttt||||||((((
((||||||ttttffffjjjjjjrrrrxxxxnnnnuuuuuuvvvvcccczzzzXXXXYYYYYYUUUUJJJJJJCCCCCCLLLLLLLLQQQQQQQQQQQQQQQQQQQQQQQQQQQQLLLLLLLLCCCCCCJJJJJJUUUUYYYYYYXXXXzzzzccccvvvvuuuuuunnnnxxxxrrrrjjjjjjfffftttt||||||((
||||||ttttffffjjjjrrrrrrxxxxnnnnuuuuvvvvcccczzzzXXXXYYYYUUUUUUJJJJCCCCLLLLLLQQQQQQ0000000000OOOOOOOOOOOOOOOO0000000000QQQQQQLLLLLLCCCCJJJJUUUUUUYYYYXXXXzzzzccccvvvvuuuunnnnxxxxrrrrrrjjjjfffftttt||||||
||||ttttffffjjjjrrrrrrxxxxnnnnuuuuvvvvcccczzzzXXYYYYUUUUJJJJCCCCCCLLLLQQQQ000000OOOOOOZZZZZZZZZZZZZZZZZZZZZZZZZZZZOOOOOO000000QQQQLLLLCCCCCCJJJJUUUUYYYYXXzzzzccccvvvvuuuunnnnxxxxrrrrrrjjjjfffftttt||||
||ttttffffjjjjrrrrrrxxxxnnnnuuvvvvcccczzzzXXXXYYYYUUUUJJJJCCLLLLQQQQ000000OOOOZZZZZZmmmmmmwwwwwwwwwwwwwwwwwwwwmmmmmmZZZZZZOOOO000000QQQQLLLLCCJJJJUUUUYYYYXXXXzzzzccccvvvvuunnnnxxxxrrrrrrjjjjfffftttt||
ttttffffffjjjjrrrrxxxxnnnnuuvvvvcccczzzzXXXXYYUUUUJJJJCCCCLLQQQQ0000OOOOZZZZmmmmwwwwwwqqqqqqqqppppppppppppqqqqqqqqwwwwwwmmmmZZZZOOOO0000QQQQLLCCCCJJJJUUUUYYXXXXzzzzccccvvvvuunnnnxxxxrrrrjjjjfffffftttt
ttttffffjjjjrrrrxxxxnnnnuuuuvvcccczzzzXXXXYYUUUUJJJJCCLLLLQQQQ00OOOOZZZZmmwwwwqqqqqqppppddddddddddddddddddddddddppppqqqqqqwwwwmmZZZZOOOO00QQQQLLLLCCJJJJUUUUYYXXXXzzzzccccvvuuuunnnnxxxxrrrrjjjjfffftttt
ttffffjjjjrrrrxxxxnnnnuuuuvvvvcczzzzXXXXYYUUUUJJCCCCLLLLQQ0000OOZZZZmmwwwwqqqqppppddddbbbbkkkkkkkkkkkkkkkkkkkkbbbbddddppppqqqqwwwwmmZZZZOO0000QQLLLLCCCCJJUUUUYYXXXXzzzzccvvvvuuuunnnnxxxxrrrrjjjjfffftt
ttffffjjjjrrrrxxxxnnuuuuvvvvcccczzXXXXYYUUUUJJJJCCLLLLQQ00OOOOZZmmmmwwqqqqppddddbbbbkkkkhhhhaaaaaaaaaaaaaaaahhhhkkkkbbbbddddppqqqqwwmmmmZZOOOO00QQLLLLCCJJJJUUUUYYXXXXzzccccvvvvuuuunnxxxxrrrrjjjjfffftt
ffffjjjjrrrrxxxxnnnnuuuuvvcccczzzzXXYYYYUUJJJJCCLLLLQQ0000OOZZmmmmwwqqppppddbbkkkkhhhhaaoooooo************ooooooaahhhhkkkkbbddppppqqwwmmmmZZOO0000QQLLLLCCJJJJUUYYYYXXzzzzccccvvuuuunnnnxxxxrrrrjjjjffff
ffffjjjjrrrrxxxxnnuuuuvvvvcccczzXXXXYYUUUUJJCCCCLLQQ0000OOZZmmmmwwqqppppddbbkkhhhhaaoo****####MMMMMMMMMMMM####****ooaahhhhkkbbddppppqqwwmmmmZZOO0000QQLLCCCCJJUUUUYYXXXXzzccccvvvvuuuunnxxxxrrrrjjjjffff
ffffjjjjrrrrxxnnnnuuuuvvvvcczzzzXXYYYYUUJJJJCCLLLLQQ00OOOOZZmmwwqqqqppddbbkkhhaaaaoo**##MMMMWW&&&&&&&&&&&&WWMMMM##**ooaaaahhkkbbddppqqqqwwmmZZOOOO00QQLLLLCCJJJJUUYYYYXXzzzzccvvvvuuuunnnnxxrrrrjjjjffff
ffffjjjjrrxxxxnnnnuuuuvvcccczzzzXXYYYYUUJJCCCCLLQQQQ00OOZZmmmmwwqqppddbbkkkkhhaaoo**##MMWW&&8888%%%%%%%%8888&&WWMM##**ooaahhkkkkbbddppqqwwmmmmZZOO00QQQQLLCCCCJJUUYYYYXXzzzzccccvvuuuunnnnxxxxrrjjjjffff
ffjjjjrrrrxxxxnnnnuuuuvvcccczzXXXXYYUUUUJJCCCCLLQQ0000OOZZmmwwwwqqppddbbkkhhaaoo**##MMWW&&88%%BB@@$$$$@@BB%%88&&WWMM##**ooaahhkkbbddppqqwwwwmmZZOO0000QQLLCCCCJJUUUUYYXXXXzzccccvvuuuunnnnxxxxrrrrjjjjff
ffjjjjrrrrxxxxnnnnuuuuvvcccczzXXXXYYUUUUJJCCCCLLQQ0000OOZZmmwwwwqqppddbbkkhhaaoo**##MMWW&&88%%BB@@$$$$@@BB%%88&&WWMM##**ooaahhkkbbddppqqwwwwmmZZOO0000QQLLCCCCJJUUUUYYXXXXzzccccvvuuuunnnnxxxxrrrrjjjjff
ffffjjjjrrxxxxnnnnuuuuvvcccczzzzXXYYYYUUJJCCCCLLQQQQ00OOZZmmmmwwqqppddbbkkkkhhaaoo**##MMWW&&8888%%%%%%%%8888&&WWMM##**ooaahhkkkkbbddppqqwwmmmmZZOO00QQQQLLCCCCJJUUYYYYXXzzzzccccvvuuuunnnnxxxxrrjjjjffff
ffffjjjjrrrrxxnnnnuuuuvvvvcczzzzXXYYYYUUJJJJCCLLLLQQ00OOOOZZmmwwqqqqppddbbkkhhaaaaoo**##MMMMWW&&&&&&&&&&&&WWMMMM##**ooaaaahhkkbbddppqqqqwwmmZZOOOO00QQLLLLCCJJJJUUYYYYXXzzzzccvvvvuuuunnnnxxrrrrjjjjffff
ffffjjjjrrrrxxxxnnuuuuvvvvcccczzXXXXYYUUUUJJCCCCLLQQ0000OOZZmmmmwwqqppppddbbkkhhhhaaoo****####MMMMMMMMMMMM####****ooaahhhhkkbbddppppqqwwmmmmZZOO0000QQLLCCCCJJUUUUYYXXXXzzccccvvvvuuuunnxxxxrrrrjjjjffff
ffffjjjjrrrrxxxxnnnnuuuuvvcccczzzzXXYYYYUUJJJJCCLLLLQQ0000OOZZmmmmwwqqppppddbbkkkkhhhhaaoooooo************ooooooaahhhhkkkkbbddppppqqwwmmmmZZOO0000QQLLLLCCJJJJUUYYYYXXzzzzccccvvuuuunnnnxxxxrrrrjjjjffff
ttffffjjjjrrrrxxxxnnuuuuvvvvcccczzXXXXYYUUUUJJJJCCLLLLQQ00OOOOZZmmmmwwqqqqppddddbbbbkkkkhhhhaaaaaaaaaaaaaaaahhhhkkkkbbbbddddppqqqqwwmmmmZZOOOO00QQLLLLCCJJJJUUUUYYXXXXzzccccvvvvuuuunnxxxxrrrrjjjjfffftt
ttffffjjjjrrrrxxxxnnnnuuuuvvvvcczzzzXXXXYYUUUUJJCCCCLLLLQQ0000OOZZZZmmwwwwqqqqppppddddbbbbkkkkkkkkkkkkkkkkkkkkbbbbddddppppqqqqwwwwmmZZZZOO0000QQLLLLCCCCJJUUUUYYXXXXzzzzccvvvvuuuunnnnxxxxrrrrjjjjfffftt
ttttffffjjjjrrrrxxxxnnnnuuuuvvcccczzzzXXXXYYUUUUJJJJCCLLLLQQQQ00OOOOZZZZmmwwwwqqqqqqppppddddddddddddddddddddddddppppqqqqqqwwwwmmZZZZOOOO00QQQQLLLLCCJJJJUUUUYYXXXXzzzzccccvvuuuunnnnxxxxrrrrjjjjfffftttt
ttttffffffjjjjrrrrxxxxnnnnuuvvvvcccczzzzXXXXYYUUUUJJJJCCCCLLQQQQ0000OOOOZZZZmmmmwwwwwwqqqqqqqqppppppppppppqqqqqqqqwwwwwwmmmmZZZZOOOO0000QQQQLLCCCCJJJJUUUUYYXXXXzzzzccccvvvvuunnnnxxxxrrrrjjjjfffffftttt
||ttttffffjjjjrrrrrrxxxxnnnnuuvvvvcccczzzzXXXXYYYYUUUUJJJJCCLLLLQQQQ000000OOOOZZZZZZmmmmmmwwwwwwwwwwwwwwwwwwwwmmmmmmZZZZZZOOOO000000QQQQLLLLCCJJJJUUUUYYYYXXXXzzzzccccvvvvuunnnnxxxxrrrrrrjjjjfffftttt||
||||ttttffffjjjjrrrrrrxxxxnnnnuuuuvvvvcccczzzzXXYYYYUUUUJJJJCCCCCCLLLLQQQQ000000OOOOOOZZZZZZZZZZZZZZZZZZZZZZZZZZZZOOOOOO000000QQQQLLLLCCCCCCJJJJUUUUYYYYXXzzzzccccvvvvuuuunnnnxxxxrrrrrrjjjjfffftttt||||
||||||ttttffffjjjjrrrrrrxxxxnnnnuuuuvvvvcccczzzzXXXXYYYYUUUUUUJJJJCCCCLLLLLLQQQQQQ0000000000OOOOOOOOOOOOOOOO0000000000QQQQQQLLLLLLCCCCJJJJUUUUUUYYYYXXXXzzzzccccvvvvuuuunnnnxxxxrrrrrrjjjjfffftttt||||||
((||||||ttttffffjjjjjjrrrrxxxxnnnnuuuuuuvvvvcccczzzzXXXXYYYYYYUUUUJJJJJJCCCCCCLLLLLLLLQQQQQQQQQQQQQQQQQQQQQQQQQQQQLLLLLLLLCCCCCCJJJJJJUUUUYYYYYYXXXXzzzzccccvvvvuuuuuunnnnxxxxrrrrjjjjjjfffftttt||||||((
((((||||||ttttffffffjjjjrrrrxxxxxxnnnnuuuuvvvvvvcccczzzzXXXXXXYYYYYYUUUUUUJJJJJJCCCCCCCCCCCCLLLLLLLLLLLLLLLLCCCCCCCCCCCCJJJJJJUUUUUUYYYYYYXXXXXXzzzzccccvvvvvvuuuunnnnxxxxxxrrrrjjjjfffffftttt||||||((((
))((((((||||ttttttffffjjjjjjrrrrxxxxnnnnnnuuuuvvvvvvcccczzzzzzXXXXXXYYYYYYYYUUUUUUUUJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJUUUUUUUUYYYYYYYYXXXXXXzzzzzzccccvvvvvvuuuunnnnnnxxxxrrrrjjjjjjfffftttttt||||(((((())
))))((((((||||||ttttffffffjjjjrrrrrrxxxxnnnnnnuuuuuuvvvvcccccczzzzzzzzXXXXXXXXYYYYYYYYYYUUUUUUUUUUUUUUUUUUUUUUUUYYYYYYYYYYXXXXXXXXzzzzzzzzccccccvvvvuuuuuunnnnnnxxxxrrrrrrjjjjfffffftttt||||||(((((())))
11))))))((((||||||ttttttffffjjjjjjrrrrrrxxxxxxnnnnuuuuuuvvvvvvvvcccccczzzzzzzzzzXXXXXXXXXXXXXXXXYYYYYYYYXXXXXXXXXXXXXXXXzzzzzzzzzzccccccvvvvvvvvuuuuuunnnnxxxxxxrrrrrrjjjjjjfffftttttt||||||(((())))))11
1111))))))((((((||||||ttttttffffjjjjjjrrrrrrxxxxxxnnnnnnuuuuuuuuvvvvvvvvcccccccccczzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzccccccccccvvvvvvvvuuuuuuuunnnnnnxxxxxxrrrrrrjjjjjjfffftttttt||||||(((((())))))1111
{{111111))))))((((((||||||ttttttffffffjjjjjjrrrrrrxxxxxxnnnnnnnnuuuuuuuuvvvvvvvvvvvvccccccccccccccccccccccccccccccccvvvvvvvvvvvvuuuuuuuunnnnnnnnxxxxxxrrrrrrjjjjjjfffffftttttt||||||(((((())))))111111{{
{{{{111111))))))((((((((||||||ttttttffffffjjjjjjjjrrrrrrxxxxxxxxnnnnnnnnnnuuuuuuuuuuuuuuvvvvvvvvvvvvvvvvvvvvvvvvuuuuuuuuuuuuuunnnnnnnnnnxxxxxxxxrrrrrrjjjjjjjjfffffftttttt||||||(((((((())))))111111{{{{
}}{{{{{{111111))))))((((((((||||||ttttttffffffffjjjjjjjjrrrrrrrrxxxxxxxxxxnnnnnnnnnnnnnnnnnnnnuuuuuuuuuuuunnnnnnnnnnnnnnnnnnnnxxxxxxxxxxrrrrrrrrjjjjjjjjfffffffftttttt||||||(((((((())))))111111{{{{{{}}
}}}}{{{{{{{{111111))))))))((((((||||||||ttttttffffffffffjjjjjjjjrrrrrrrrrrrrxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxrrrrrrrrrrrrjjjjjjjjfffffffffftttttt||||||||(((((())))))))111111{{{{{{{{}}}}
[[}}}}}}{{{{{{{{111111))))))))((((((((||||||||ttttttttffffffffffjjjjjjjjjjjjrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrjjjjjjjjjjjjfffffffffftttttttt||||||||(((((((())))))))111111{{{{{{{{}}}}}}[[
[[[[[[}}}}}}{{{{{{{{11111111))))))))((((((((||||||||ttttttttttffffffffffffffjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjfffffffffffffftttttttttt||||||||(((((((())))))))11111111{{{{{{{{}}}}}}[[[[[[
]][[[[[[[[}}}}}}}}{{{{{{{{11111111))))))))((((((((((||||||||||ttttttttttttttfffffffffffffffffffffffffffffffffffffffffffffffftttttttttttttt||||||||||(((((((((())))))))11111111{{{{{{{{}}}}}}}}[[[[[[[[]]
]]]]]][[[[[[[[}}}}}}}}{{{{{{{{1111111111))))))))))((((((((((||||||||||||||tttttttttttttttttttttttttttttttttttttttttttttttttttt||||||||||||||(((((((((())))))))))1111111111{{{{{{{{}}}}}}}}[[[[[[[[]]]]]]
??]]]]]]]][[[[[[[[}}}}}}}}}}{{{{{{{{1111111111))))))))))))((((((((((((((||||||||||||||||||||||||||||||||||||||||||||||||||||||||(((((((((((((())))))))))))1111111111{{{{{{{{}}}}}}}}}}[[[[[[[[]]]]]]]]??
??????]]]]]]]][[[[[[[[[[}}}}}}}}}}{{{{{{{{{{111111111111))))))))))))))(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((())))))))))))))111111111111{{{{{{{{{{}}}}}}}}}}[[[[[[[[[[]]]]]]]]??????
--????????]]]]]]]]]][[[[[[[[[[}}}}}}}}}}{{{{{{{{{{{{1111111111111111))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))1111111111111111{{{{{{{{{{{{}}}}}}}}}}[[[[[[[[[[]]]]]]]]]]????????--
------??????????]]]]]]]]]][[[[[[[[[[[[}}}}}}}}}}}}{{{{{{{{{{{{{{111111111111111111111111))))))))))))))))))))))))111111111111111111111111{{{{{{{{{{{{{{}}}}}}}}}}}}[[[[[[[[[[[[]]]]]]]]]]??????????------
------------??????????]]]]]]]]]]]][[[[[[[[[[[[}}}}}}}}}}}}}}{{{{{{{{{{{{{{{{{{{{{{111111111111111111111111111111111111{{{{{{{{{{{{{{{{{{{{{{}}}}}}}}}}}}}}[[[[[[[[[[[[]]]]]]]]]]]]??????????------------
______----------????????????]]]]]]]]]]]]]][[[[[[[[[[[[[[}}}}}}}}}}}}}}}}}}}}{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{}}}}}}}}}}}}}}}}}}}}[[[[[[[[[[[[[[]]]]]]]]]]]]]]????????????----------______
____________------------????????????]]]]]]]]]]]]]][[[[[[[[[[[[[[[[[[[[}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]????????????------------____________
++++++____________------------??????????????]]]]]]]]]]]]]]]]]][[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]??????????????------------____________++++++
++++++++++++____________--------------??????????????????]]]]]]]]]]]]]]]]]]]]]]]]]][[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]??????????????????--------------____________++++++++++++
~~~~++++++++++++++______________----------------????????????????????????]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]????????????????????????----------------______________++++++++++++++~~~~
~~~~~~~~~~++++++++++++++++________________--------------------????????????????????????????????????????????????????????????????????????????--------------------________________++++++++++++++++~~~~~~~~~~
<<~~~~~~~~~~~~~~~~++++++++++++++++__________________--------------------------------????????????????????????????????--------------------------------__________________++++++++++++++++~~~~~~~~~~~~~~~~<<
<<<<<<<<<<~~~~~~~~~~~~~~~~++++++++++++++++++________________________----------------------------------------------------------------________________________++++++++++++++++++~~~~~~~~~~~~~~~~<<<<<<<<<<
<<<<<<<<<<<<<<<<~~~~~~~~~~~~~~~~~~++++++++++++++++++++++________________________________________________________________________________________++++++++++++++++++++++~~~~~~~~~~~~~~~~~~<<<<<<<<<<<<<<<<
>>>>>><<<<<<<<<<<<<<<<<<~~~~~~~~~~~~~~~~~~~~++++++++++++++++++++++++++++++____________________________________________________++++++++++++++++++++++++++++++~~~~~~~~~~~~~~~~~~~~<<<<<<<<<<<<<<<<<<>>>>>>
>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<~~~~~~~~~~~~~~~~~~~~~~~~++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++~~~~~~~~~~~~~~~~~~~~~~~~<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>
iiii>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~++++++++++++++++++++++++++++++++++++++++~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>iiii
iiiiiiiiii>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>iiiiiiiiii
iiiiiiiiiiiiiiiiii>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>iiiiiiiiiiiiiiiiii
!!!!!!iiiiiiiiiiiiiiiiiiiiii>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>iiiiiiiiiiiiiiiiiiiiii!!!!!!
!!!!!!!!!!!!!!iiiiiiiiiiiiiiiiiiiiiiiiii>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>iiiiiiiiiiiiiiiiiiiiiiiiii!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii!!!!!!!!!!!!!!!!!!!!!!
llllll!!!!!!!!!!!!!!!!!!!!!!!!!!!!iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii!!!!!!!!!!!!!!!!!!!!!!!!!!!!llllll
llllllllllllllll!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!llllllllllllllll
import matplotlib.pyplot as plt
from unyt import Msun, Myr, kpc
from synthesizer.emission_models import ReprocessedEmission
from synthesizer.filters import UVJ
from synthesizer.grid import Grid
from synthesizer.imaging import ImageCollection
from synthesizer.parametric import SFH, Stars, ZDist
from synthesizer.parametric.galaxy import Galaxy
from synthesizer.parametric.morphology import Sersic2D
if __name__ == "__main__":
# Define the morphology using a simple effective radius and slope
morph = Sersic2D(r_eff=1 * kpc, sersic_index=1.0, ellipticity=0.5)
# Get the location of this script, __file__ is the absolute path of this
# script, however we just want to directory
# script_path = os.path.abspath(os.path.dirname(__file__))
# Define the grid
grid_name = "test_grid"
grid_dir = "../../tests/test_grid/"
grid = Grid(grid_name, grid_dir=grid_dir)
# Create the emission model
model = ReprocessedEmission(grid)
# Define the SFZDist
Z_p = {"metallicity": 0.01}
metal_dist = ZDist.DeltaConstant(**Z_p)
sfh_p = {"max_age": 100 * Myr}
sfh = SFH.Constant(**sfh_p) # constant star formation
sfzh = Stars(
grid.log10age,
grid.metallicity,
sf_hist=sfh,
metal_dist=metal_dist,
initial_mass=10**9 * Msun,
morphology=morph,
)
# Initialise a parametric Galaxy
galaxy = Galaxy(sfzh)
# Generate stellar spectra
galaxy.stars.get_spectra(model)
# Get a UVJ filter set
filters = UVJ()
# Get photometry
galaxy.stars.get_photo_lnu(filters)
# Define geometry of the images
resolution = 0.01 * kpc # resolution in kpc
npix = 100
fov = resolution.value * npix * kpc
# Generate images using the low level image methods
img = ImageCollection(
resolution=resolution,
fov=fov,
)
# Get the photometric images
img.get_imgs_smoothed(
photometry=galaxy.stars.spectra["reprocessed"].photo_lnu,
density_grid=morph.get_density_grid(resolution, img.npix),
)
# Make and plot an rgb image
img.make_rgb_image(rgb_filters={"R": "J", "G": "V", "B": "U"})
fig, ax, _ = img.plot_rgb_image()
plt.show()
# We can also do the same with a helper function on the galaxy object
img = galaxy.get_images_luminosity(
resolution=resolution,
fov=fov,
emission_model=model,
)
# and... print an ASCII representation
img["J"].print_ascii()
Total running time of the script: (0 minutes 0.532 seconds)