timduly4 / pyglow

Upper atmosphere climatological models in Python
MIT License
104 stars 57 forks source link

just a question about models #60

Closed panagiotispir closed 6 years ago

panagiotispir commented 6 years ago

hi @timduly4 , I would like to ask MSIS-2000 is the same with NRLMSISE-00? Thanks :)

timduly4 commented 6 years ago

@panagiotispir Yes, it's the same model-- we wrap the following FORTRAN code: https://github.com/timduly4/pyglow/blob/master/static/nrlmsise00_sub.for

panagiotispir commented 6 years ago

Thanks!

panagiotispir commented 6 years ago

Hi again, MSIS on pyglow runs until 2013-12-31 when I try a later date pt.run_msis(version=2000) gives pt2.run_msis(version=2000) DNET LOG ERROR NaN NaN 16.0000000 DNET LOG ERROR NaN NaN 32.0000000 DNET LOG ERROR NaN NaN 1.00000000 DNET LOG ERROR NaN NaN 14.0000000 pyglow.Point(datetime.datetime(2014, 12, 31, 0, 0), 40, -80, 250.0)

but it is available until 2017 https://ccmc.gsfc.nasa.gov/models/modelinfo.php?model=MSISE is there anyway to update it.

Sorry @timduly4 if I am asking too much. If there any to do for you I would be happy. King regards

timduly4 commented 6 years ago

@panagiotispir It might be helpful to look at the code you're using to drive MSIS with pyglow, then we can further investigate.

Can you recreate this problem by calling MSIS in Fortran?

panagiotispir commented 6 years ago

Hi @timduly4 I wrote a little sketch to show you how I run msis with pyglow

msis_test.txt

the output was that

pyglow runs for YEAR 2010

HE 9.960e+06 O 1.063e+09 N2 3.011e+08 O2 1.840e+07 AR 7.452e+04 H 2.781e+05 N 1.356e+07 ANM 4.149e-03 RHO 4.358e-14

pyglow runs for YEAR 2011

HE 8.855e+06 O 1.417e+09 N2 5.441e+08 O2 3.018e+07 AR 2.703e+05 H 1.473e+05 N 2.102e+07 ANM 8.331e-03 RHO 6.510e-14

pyglow runs for YEAR 2012

HE 9.688e+06 O 1.416e+09 N2 4.936e+08 O2 2.563e+07 AR 1.841e+05 H 1.599e+05 N 2.023e+07 ANM 6.543e-03 RHO 6.247e-14

pyglow runs for YEAR 2013

HE 9.186e+06 O 1.459e+09 N2 5.480e+08 O2 2.899e+07 AR 2.565e+05 H 1.445e+05 N 2.134e+07 ANM 8.070e-03 RHO 6.633e-14

pyglow runs for YEAR 2014 DNET LOG ERROR NaN NaN 16.0000000
DNET LOG ERROR NaN NaN 32.0000000
DNET LOG ERROR NaN NaN 1.00000000
DNET LOG ERROR NaN NaN 14.0000000

HE nan O nan N2 nan O2 nan AR nan H nan N nan ANM nan RHO nan

pyglow runs for YEAR 2015 DNET LOG ERROR NaN NaN 16.0000000
DNET LOG ERROR NaN NaN 32.0000000
DNET LOG ERROR NaN NaN 1.00000000
DNET LOG ERROR NaN NaN 14.0000000

HE nan O nan N2 nan O2 nan AR nan H nan N nan ANM nan RHO nan

I don't know much about fortran, to be honest nothing, so it isn't easy for me to recreate the problem, at the moment, calling MSIS in Fortran, but I run this https://github.com/DeepHorizons/Python-NRLMSISE-00 and it seems that MSIS is independent from year

timduly4 commented 6 years ago

Nothing jumps out for me at the moment. I can look into this within the next few days.

On Tue, Nov 27, 2018, 10:12 AM Panagiotis Pir <notifications@github.com wrote:

Hi @timduly4 https://github.com/timduly4 I wrote a little sketch to show you how I run msis with pyglow

msis_test.txt https://github.com/timduly4/pyglow/files/2621037/msis_test.txt

the output was that

pyglow runs for YEAR 2010

HE 9.960e+06 O 1.063e+09 N2 3.011e+08 O2 1.840e+07 AR 7.452e+04 H 2.781e+05 N 1.356e+07 ANM 4.149e-03 RHO 4.358e-14

pyglow runs for YEAR 2011

HE 8.855e+06 O 1.417e+09 N2 5.441e+08 O2 3.018e+07 AR 2.703e+05 H 1.473e+05 N 2.102e+07 ANM 8.331e-03 RHO 6.510e-14

pyglow runs for YEAR 2012

HE 9.688e+06 O 1.416e+09 N2 4.936e+08 O2 2.563e+07 AR 1.841e+05 H 1.599e+05 N 2.023e+07 ANM 6.543e-03 RHO 6.247e-14

pyglow runs for YEAR 2013

HE 9.186e+06 O 1.459e+09 N2 5.480e+08 O2 2.899e+07 AR 2.565e+05 H 1.445e+05 N 2.134e+07 ANM 8.070e-03 RHO 6.633e-14

pyglow runs for YEAR 2014 DNET LOG ERROR NaN NaN 16.0000000 DNET LOG ERROR NaN NaN 32.0000000 DNET LOG ERROR NaN NaN 1.00000000 DNET LOG ERROR NaN NaN 14.0000000

HE nan O nan N2 nan O2 nan AR nan H nan N nan ANM nan RHO nan

pyglow runs for YEAR 2015 DNET LOG ERROR NaN NaN 16.0000000 DNET LOG ERROR NaN NaN 32.0000000 DNET LOG ERROR NaN NaN 1.00000000 DNET LOG ERROR NaN NaN 14.0000000

HE nan O nan N2 nan O2 nan AR nan H nan N nan ANM nan RHO nan

I don't know much about fortran, to be honest nothing, so it isn't easy for me to recreate the problem, at the moment, calling MSIS in Fortran, but I run this https://github.com/DeepHorizons/Python-NRLMSISE-00 and it seems that MSIS is independent from year

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/timduly4/pyglow/issues/60#issuecomment-442140472, or mute the thread https://github.com/notifications/unsubscribe-auth/ACEwxFr7P3yYa7JZlBXMtOw0WBQkJNY7ks5uzXKUgaJpZM4YzoT3 .

panagiotispir commented 6 years ago

Ok @timduly4 I think that the problem comes from MSISE-00 fortran code. I will try to run the same code on another computer and we'll be in touch.

panagiotispir commented 6 years ago

Hello again @timduly4 I am trying to find out where fault comes from and why. I realize that the fault comes from DNET function of MSIS00 line 1591, but to be honest I am not able to understand what this do and how in MSISE00. In pyglow class run_msis() didn't use year and as you said on your machine you didn't have the same error, so I am really confused. I am looking forward to hearing from you.

timduly4 commented 6 years ago

@panagiotispir -- I receive the same error as you. I believe I was unclear: I meant to say that I have not seen this type of error before. See below for my output from your example script.

Is there a newer version of MSIS that we can use for pyglow that includes an update for the years?

pyglow runs for YEAR    2010

HE       9.960e+06
O        1.063e+09
N2       3.011e+08
O2       1.840e+07
AR       7.452e+04
H        2.781e+05
N        1.356e+07
ANM      4.149e-03
RHO      4.358e-14

pyglow runs for YEAR    2011

HE       8.855e+06
O        1.417e+09
N2       5.441e+08
O2       3.018e+07
AR       2.703e+05
H        1.473e+05
N        2.102e+07
ANM      8.331e-03
RHO      6.510e-14

pyglow runs for YEAR    2012

HE       9.688e+06
O        1.416e+09
N2       4.936e+08
O2       2.563e+07
AR       1.841e+05
H        1.599e+05
N        2.023e+07
ANM      6.543e-03
RHO      6.247e-14

pyglow runs for YEAR    2013

HE       9.186e+06
O        1.459e+09
N2       5.480e+08
O2       2.899e+07
AR       2.565e+05
H        1.445e+05
N        2.134e+07
ANM      8.070e-03
RHO      6.633e-14

pyglow runs for YEAR    2014
 DNET LOG ERROR              NaN              NaN   16.0000000    
 DNET LOG ERROR              NaN              NaN   32.0000000    
 DNET LOG ERROR              NaN              NaN   1.00000000    
 DNET LOG ERROR              NaN              NaN   14.0000000    

HE       nan
O        nan
N2       nan
O2       nan
AR       nan
H        nan
N        nan
ANM      nan
RHO      nan

pyglow runs for YEAR    2015
 DNET LOG ERROR              NaN              NaN   16.0000000    
 DNET LOG ERROR              NaN              NaN   32.0000000    
 DNET LOG ERROR              NaN              NaN   1.00000000    
 DNET LOG ERROR              NaN              NaN   14.0000000    

HE       nan
O        nan
N2       nan
O2       nan
AR       nan
H        nan
N        nan
ANM      nan
RHO      nan
timduly4 commented 6 years ago

@panagiotispir the issue is related to the geophysical indices. We ship the majority of the indices with pyglow, but do not have the indices for (2014, 2018]. You can manually download them with:

 python -c "import pyglow; pyglow.update_indices([2014, 2015, 2016, 2017, 2018])"

Admittedly, this is not intuitive, and we should report this information better. I'll create a separate ticket for this issue.

After downloading the indices with the above command, running your script yields:

pyglow runs for YEAR    2010

HE       9.960e+06
O        1.063e+09
N2       3.011e+08
O2       1.840e+07
AR       7.452e+04
H        2.781e+05
N        1.356e+07
ANM      4.149e-03
RHO      4.358e-14

pyglow runs for YEAR    2011

HE       8.855e+06
O        1.417e+09
N2       5.441e+08
O2       3.018e+07
AR       2.703e+05
H        1.473e+05
N        2.102e+07
ANM      8.331e-03
RHO      6.510e-14

pyglow runs for YEAR    2012

HE       9.688e+06
O        1.416e+09
N2       4.936e+08
O2       2.563e+07
AR       1.841e+05
H        1.599e+05
N        2.023e+07
ANM      6.543e-03
RHO      6.247e-14

pyglow runs for YEAR    2013

HE       9.186e+06
O        1.459e+09
N2       5.480e+08
O2       2.899e+07
AR       2.565e+05
H        1.445e+05
N        2.134e+07
ANM      8.070e-03
RHO      6.633e-14

pyglow runs for YEAR    2014

HE       1.013e+07
O        1.910e+09
N2       7.501e+08
O2       3.050e+07
AR       3.445e+05
H        8.149e+04
N        3.531e+07
ANM      8.797e-03
RHO      8.813e-14

pyglow runs for YEAR    2015

HE       8.458e+06
O        1.600e+09
N2       6.927e+08
O2       3.630e+07
AR       4.478e+05
H        1.031e+05
N        2.751e+07
ANM      1.095e-02
RHO      7.734e-14
panagiotispir commented 6 years ago

Yeap, you are right @timduly4 ! My mind stuck on the line of fortran code where says that "year is ignored" on MSISE-00, so I waiting model to run for future dates too. Thanks you very much and sorry the inconvenience.