PlasmaControl / Stellarator-Database

This repository includes the functions required to upload DESC or VMEC results to the stellarator database.
MIT License
2 stars 1 forks source link

Add support for spline profile, and add documentation on website #2

Open dpanici opened 5 months ago

dpanici commented 5 months ago

Just need to make some sort of util function like

def get_profile_data(profile):
# profile is a DESC Profile object
     if isinstance(profile, PowerSeriesProfile):
        data_profile["profile_type"] = "power_series"
        data_profile["profile_data1"] = profile.basis.modes[:, 0]
        data_profile["profile_data2"] = profile.params
    elif isinstance(profile, SplineProfile):
        data_profile["profile_type"] = "spline"
        data_profile["profile_data1"] = profile.knots
        data_profile["profile_data2"] = profile.params
     return data_profile

also should add to website the info on what data1 and data2 mean for the different profile types (data1 is modes if power series but knots if spline, etc)

YigitElma commented 3 weeks ago

@dpanici I changed how we get profile info. If I am correct, the new version should support every profile type except for the MTanhProfile

YigitElma commented 3 weeks ago

https://github.com/PlasmaControl/Stellarator-Database/blob/main/stelladb/db_desc.py#L997