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

StarryProcess self._M doesn't depend on ydeg #30

Open
RomanAkhmetshyn opened this issue Aug 27, 2024 · 0 comments
Open

StarryProcess self._M doesn't depend on ydeg #30

RomanAkhmetshyn opened this issue Aug 27, 2024 · 0 comments

Comments

@RomanAkhmetshyn
Copy link

RomanAkhmetshyn commented Aug 27, 2024

I'm trying to visualize a custom-generated array of time-variable spherical harmonics using sp.visualize(), however when computing a dot product of self._M (I assume that's a design matrix) and transposed Y_lm matrix in sp.mollweide, self._M is always of shape (45000,256) no matter what ydeg I set when initializing SP object. I can understand that 45000 = 300 * 150 by default, but where can I change the second axis? Full code:

import starry
starry.config.lazy = False
starry.config.quiet = True

import numpy as np

try:
    np.distutils.__config__.blas_opt_info = np.distutils.__config__.blas_ilp64_opt_info
except Exception:
    pass
import theano
theano.config.gcc__cxxflags += " -fexceptions"
theano.config.on_opt_error = "raise"
theano.tensor.opt.constant_folding
theano.graph.opt.EquilibriumOptimizer

from starry_process import StarryProcess
import numpy as np
import matplotlib.pyplot as plt


import matplotlib as mpl
mpl.rcParams['figure.dpi'] = 300

import numpy as np


ydeg = 5
deg_num = (ydeg+1)**2
sp = StarryProcess(ydeg = ydeg)
sp._time_variable = True

def Y_evo(Y_t0, Y_dot, t, t0):
    Y_t = Y_t0 + Y_dot * (t - t0)
    return Y_t

#%%

t0 = 0
times = np.linspace(t0, 100, 100)


Y_t0 = np.random.normal(10, 2, deg_num)
Y_dot = np.random.normal(0, 0.5, deg_num)


Ys = []
for t in times:
    Ys.append(Y_evo(Y_t0, Y_dot, t, t0))
    
    
plt.plot(times, Ys)
plt.show()

stacked_array = np.stack(Ys, axis=0)

reshaped_array = stacked_array.reshape(1, 100, deg_num)

flux = sp.flux(y = reshaped_array, t = times, i=75.0, p=33, u=[0.0, 0.0])

flux = flux.eval()
plt.plot(times, flux[0])
plt.show()
    
print(sp._M.shape)
sp.visualize(y = reshaped_array, file = 'something.gif')

ValueError: shapes (45000,256) and (36,100) not aligned: 256 (dim 1) != 36 (dim 0)

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

1 participant