Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
AndrewVSutherland
GitHub Repository: AndrewVSutherland/lmfdb
Path: blob/main/scripts/maass/import_maass_and_maass_lfun.py
1128 views
1
# -*- coding: utf-8 -*-
2
r""" Import data for GL2 Maass forms (from yaml file) and
3
data for GLn Maass form L-functions including plot and zeros
4
from L-calc files.
5
6
To run this go into the top-level lmfdb directory, run sage and give
7
the command
8
%runfile lmfdb/modular_forms/maass_forms/import_maass_and_maass_lfun.py
9
10
"""
11
import yaml
12
from lmfdb.website import DEFAULT_DB_PORT as dbport
13
14
from pymongo.mongo_client import MongoClient
15
print("getting connection")
16
C = MongoClient(port=dbport)
17
print("authenticating on the L-functions and Maass forms database")
18
19
##pw_dict = yaml.load(open(os.path.join(os.getcwd(), os.extsep, os.extsep, os.extsep, "passwords.yaml")))
20
##username = pw_dict['data']['username']
21
##password = pw_dict['data']['password']
22
##
23
##C['Lfunctions'].authenticate(username, password)
24
##C['MaassWaveForms'].authenticate(username, password)
25
26
##L_maass_gl2 = C.Lfunctions.maass_gl2
27
##L_maass_gl3 = C.Lfunctions.maass_gl3
28
##L_maass_gl4 = C.Lfunctions.maass_gl4
29
##maass_gl2 = C.MaassWaveForms.maass_gl2
30
31
def insertMaassGL2FromFiles(base_path, min_N, max_N):
32
for N in range(min_N, max_N):
33
fileName = base_path + str(N) + ".yaml"
34
stream = open(fileName, "r")
35
docs = yaml.load_all(stream)
36
for doc in docs:
37
for k,v in doc.items():
38
print(k, "->", v)
39
print("\n")
40
41
insertMaassGL2FromFiles("/home/stefan/Documents/Test",1,1)
42
43