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

run in libmode without api key dos not throw an error #19

Open
mwallschlaeger opened this issue Oct 4, 2022 · 0 comments
Open

run in libmode without api key dos not throw an error #19

mwallschlaeger opened this issue Oct 4, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@mwallschlaeger
Copy link
Contributor

If you run

import json
stations = [
            # weather
            "ws1_l1_rtu_BL",
            "ws2_l1_rtu_BL",
            "tbsl1_00172_BL",
            # stationary 
            "tbs6a_08_180056_BL",
            "tbs6a_15_180063_BL",
            "tbs6a_05_180052_BL",
            "tbs6a_28_180084_BL",
            "tbs6a_04_180051_BL",
            "tbs6a_11_180059_BL",
            "tbs6a_30_180086_BL",
            "tbs6a_29_180085_BL",
            "tbs6a_20_180072_BL",
            "tbs6a_21_180073_BL",
            "tbs6a_10_180058_BL",
            "tbs6a_01_180048_BL",
            "tbs6a_02_180049_BL",
            "tbs6a_07_180055_BL",
            "tbs6a_22_180075_BL",
            "tbs6a_03_180050_BL",
            "tbs6a_17_180069_BL",
            "tbs6a_13_180061_BL",
            "tbs6a_26_180082_BL",
            "tbs6a_24_180078_BL",
            "tbs6a_23_180076_BL",
            "tbs6a_09_180057_BL",
            "tbs6a_25_180081_BL",
            "tbs6a_18_180070_BL",
            "tbs6a_19_180071_BL",
            "tbs6a_16_180068_BL",
            # mobile
            "wcecst_01_BL",
            "wcecst_02_BL",
            "wcecst_03_BL",
            "wcecst_04_BL",
            "wcecst_05_BL",
            "wcecst_06_BL",
            "wcecst_07_BL",
            "wcecst_08_BL",
            "wcecst_09_BL",
            "wcecst_10_BL" ]
conf = {
    "apikey": "", # logstar api key
    "stationlist": stations, # list of stations to process
    "geodata": True, # Returns longitude and latitude of the station as well as a comment (not implemented, i guess)
    "datetime": 0, #  Date and time format in the channel list: integer: 0/1
                   #  0 (default): „dateTime“: „2020-04-01 00:00:00“
                   #  1: „date“: „2020-04-01“, „time“: „00:00:00“
    "startdate": "2021-01-01", # Day from which the data should be retrieved in the format: YYYY-MM-DD
    "enddate": "2022-01-01" # Day to which the data is to be retrieved in the format: YYYY-MM-DD
}

# load mapping file to translate sensor name to patch name and meassurement acronyms to names.
sensor_mapping = ""
with open("patchcrop-sensor-mapping.json") as jsonfile:
        sensor_mapping = json.load(jsonfile)

import logstar_stream.logstar as logstar
import logstar_stream.processing_steps.ProcessingStep as ps
import logging

# configure logging
logging.basicConfig(format='%(asctime)s %(message)s', level=logging.INFO)

df_dict = logstar.manage_dl_db( conf=conf,                     # configuration
                                sensor_mapping=sensor_mapping, # translation file
                                csv_folder="data/")       

without providing an API key the manage_dl_db function will seem to work properly and not throw an error log or exception whilte trying to download without api key.

It should check if a working api key is given

@mwallschlaeger mwallschlaeger added the bug Something isn't working label Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant