Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No output from get_ae8_ap8_flux (IDL) #45

Open
eliasroussos opened this issue Mar 10, 2024 · 2 comments
Open

No output from get_ae8_ap8_flux (IDL) #45

eliasroussos opened this issue Mar 10, 2024 · 2 comments

Comments

@eliasroussos
Copy link

eliasroussos commented Mar 10, 2024

When running the following command in IDL

IDL> resultf = call_external(lib_name, 'get_ae8_ap8_flux_idl_', ntime,whichm,whatf,Nene,energy,BBo,Lm,flux,/f_value)

the returned flux array (sized: [ntime, 25], where 25 is the number of energies, ntime is the number of time steps), returns only flux[0,*]=-1e+31 and the rest of the array elements as zeros. The flux array is of double precision, as indicated in the documentation.

The energy array is predefined as:
IDL> energy=DINDGEN(25)*0.135 -2d
IDL> energy=10d^energy
IDL> energy=transpose([[energy],[energy]])
IDL> nene=25l

with dimensions of [2,25], values given in MeV.

Time series of BBo and Lm have been calculated in previous steps, succesfully, using:
IDL> result = call_external(lib_name, 'make_lstar_',ntime,kext,options,sysaxes,iyr,idoy,ut, x1,x2,x3, maginput,lm,lstar,blocal,bmin,xj,mlt, /f_value)
IDL> BBo = blocal/bmin

with minimum Lm value of about ˜4.58.
I have tested values of whichm of 1, 2 & -1) and whichf of 1 & 3.

I have also tried using the example_1.pro, which calls fly_in_meo_gnss_ using nene=25l & an energy array of zeros energy=DBLARR(2,50). example_1.pro does return valid results throughfly_in_meo_gnss_. But it does not work for get_ae8_ap8_flux_idl_ (I still get the same empty flux array as output).

I use IDL 8.8.0 (darwin x86_64 m64) (MacOS Monterey 12.6.5). IRBEM was obtained from this repository and successfully installed. The problem is the same when I use 'FLY_IN_NASA_AEAP' also.

resultf = call_external(lib_name, 'fly_in_nasa_aeap_', ntime,sysaxes,whichm,whatf,Nene,energy,iyr,idoy, ut,x1,x2,x3,flux, /f_value)

Any suggestion?

Elias

@AntoineBrunet
Copy link
Contributor

Hi Elias,
Thanks for raising this issue. I can't seem to reproduce what you describe on my system. Could you provide a minimal working example program which exhibit the problem?
For instance, here is a simple program which works fine on my computer (using the latest commit on the main branch):

lib_name = '/path/to/libirbem.so'
ntime_max = 1L
call_external(lib_name, 'get_irbem_ntime_max_', ntime_max)

ntime = 100L

energy=DINDGEN(25)*0.135 -2d
energy=10d^energy
energy=transpose([[energy],[energy]])
nene=25L

BBo = dblarr(ntime_max)
BBo[0:ntime-1] = 1.0D
L = dblarr(ntime_max)
L[0:ntime-1] = 4.0D

flux = dblarr(ntime_max, 25)
call_external(lib_name, 'get_ae8_ap8_flux_idl_', ntime, 1, 1, Nene, energy, BBo, L, flux, /f_value)

print, flux[0,*]

With the last print outputing the following values:

  -1.0000000e+31
  -1.0000000e+31
  -1.0000000e+31
  -1.0000000e+31
  -1.0000000e+31
  -1.0000000e+31
   1.4475565e+08
   1.1932466e+08
       53816808.
       44246431.
       33871506.
       16508976.
       11993159.
       3375804.8
       5452610.2
       1957690.6
       1082774.6
       468565.28
       199310.54
       44900.266
       2168.5903
  -1.0000000e+31
  -1.0000000e+31
  -1.0000000e+31
  -1.0000000e+31

One thing I might note is that the flux array should be of shape (ntime_max, 25), not (ntime, 25) as you mentioned in your message. This error would throw a segmentation fault on Linux, but I'm not sure about the behaviour on MacOS.

@eliasroussos
Copy link
Author

eliasroussos commented Mar 12, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants