Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F65306731
phot.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Jun 2, 19:25
Size
1 KB
Mime Type
text/x-python
Expires
Tue, Jun 4, 19:25 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
18046635
Attached To
rPNBODY pNbody
phot.py
View Options
from
numpy
import
*
import
ctes
import
units
try
:
from
scipy
import
optimize
is_scipy
=
True
except
ImportError
:
is_scipy
=
False
####################################################################################################################################
#
# SOME FUNCTIONS RELATED TO PHOTOMETRY / OBSERVATION
#
####################################################################################################################################
def
MvtoLv
(
Mv
,
Mvsun
=
4.83
,
Lvsun
=
1.0
):
'''
Mv : magnitude in V-band
Mvsun : magnitude of the sun in V-band
Lvsun : V-band solar luminosity in solar luminosity unit
Return the corresponding V-band luminosity in solar luminosity unit.
'''
Lv
=
Lvsun
*
10
**
((
Mvsun
-
Mv
)
/
2.5
)
return
Lv
def
LvtoMv
(
Lv
,
Mvsun
=
4.83
,
Lvsun
=
1.0
):
'''
Lv : V-band luminosity in solar luminosity unit
Mvsun : magnitude of the sun in V-band
Lvsun : V-band solar luminosity in solar luminosity unit
Return the magnitude in V-band
'''
Mv
=
Mvsun
-
2.5
*
log10
(
Lv
/
Lvsun
)
return
Mv
Event Timeline
Log In to Comment