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

sub-map files #105

Open
AugustinMortier opened this issue Dec 20, 2024 · 0 comments
Open

sub-map files #105

AugustinMortier opened this issue Dec 20, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@AugustinMortier
Copy link
Member

The map files consist of an array of station dictionaries containing some meta-keys (station_name, latitude, longitude, altitude, region), and colocated statistics for a given frequency (yearly|monthly|weekly|daily) and period ({time}-{season}).

   {
        "station_name": "ARM_Darwin",
        "latitude": -12.425000000000002,
        "longitude": 130.89100000000005,
        "altitude": 29.899999999999995,
        "region": "AUSTRALIA",
        "monthly": {
            "2010-all": {
                "totnum": 12.0,
                "num_valid": 4.0,
                "refdata_mean": 1.10389171840698,
                "refdata_std": 0.1484581852587746,
                "data_mean": 1.0231251567602158,
                "data_std": 0.11453517639361245,
                "weighted": 0.0,
                "rms": 0.11879763257611639,
                "R": 0.810662520839635,
                "R_spearman": 1.0,
                "R_kendall": 1.0,
                "nmb": -0.07316529357002337,
                "mnmb": -0.0737210302825057,
                "fge": 0.08652349492681295
            },
            "2010-DJF": {
                "totnum": 3.0,
                "num_valid": 0.0,
                "refdata_mean": null,
                "refdata_std": null,
                "data_mean": null,
                "data_std": null,
                "weighted": 0.0,
                "rms": null,
                "nmb": null,
                "mnmb": null,
                "fge": null,
                "R": null,
                "R_spearman": null
            },
            "2010-MAM": {
                "totnum": 3.0,
                "num_valid": 0.0,
                "refdata_mean": null,
                "refdata_std": null,
                "data_mean": null,
                "data_std": null,
                "weighted": 0.0,
                "rms": null,
                "nmb": null,
                "mnmb": null,
                "fge": null,
                "R": null,
                "R_spearman": null
            },
            "2010-JJA": {
                "totnum": 3.0,
                "num_valid": 1.0,
                "refdata_mean": 1.103051,
                "refdata_std": 0.0,
                "data_mean": 1.13166081905365,
                "data_std": 0.0,
                "weighted": 0.0,
                "rms": null,
                "nmb": null,
                "mnmb": null,
                "fge": null,
                "R": null,
                "R_spearman": null
            },
            "2010-SON": {
                "totnum": 3.0,
                "num_valid": 3.0,
                "refdata_mean": 1.1041719578759734,
                "refdata_std": 0.1714238301903548,
                "data_mean": 0.9869466026624044,
                "data_std": 0.11070467199831646,
                "weighted": 0.0,
                "rms": 0.13617756579368132,
                "R": 0.9706037645258292,
                "R_spearman": 1.0,
                "R_kendall": 1.0,
                "nmb": -0.10616585068784765,
                "mnmb": -0.10682968347287909,
                "fge": 0.10682968347287909
            }
        },
        "yearly": {
            "2010-all": {
                "totnum": 1.0,
                "num_valid": 1.0,
                "refdata_mean": 1.10389171840698,
                "refdata_std": 0.0,
                "data_mean": 0.950174942612648,
                "data_std": 0.0,
                "weighted": 0.0,
                "rms": null,
                "nmb": null,
                "mnmb": null,
                "fge": null,
                "R": null,
                "R_spearman": null
            },
            "2010-DJF": {
                "totnum": null,
                "num_valid": null,
                "refdata_mean": null,
                "refdata_std": null,
                "data_mean": null,
                "data_std": null,
                "weighted": null,
                "rms": null,
                "R": null,
                "R_spearman": null,
                "R_kendall": null,
                "nmb": null,
                "mnmb": null,
                "fge": null
            },
            "2010-MAM": {
                "totnum": null,
                "num_valid": null,
                "refdata_mean": null,
                "refdata_std": null,
                "data_mean": null,
                "data_std": null,
                "weighted": null,
                "rms": null,
                "R": null,
                "R_spearman": null,
                "R_kendall": null,
                "nmb": null,
                "mnmb": null,
                "fge": null
            },
            "2010-JJA": {
                "totnum": null,
                "num_valid": null,
                "refdata_mean": null,
                "refdata_std": null,
                "data_mean": null,
                "data_std": null,
                "weighted": null,
                "rms": null,
                "R": null,
                "R_spearman": null,
                "R_kendall": null,
                "nmb": null,
                "mnmb": null,
                "fge": null
            },
            "2010-SON": {
                "totnum": null,
                "num_valid": null,
                "refdata_mean": null,
                "refdata_std": null,
                "data_mean": null,
                "data_std": null,
                "weighted": null,
                "rms": null,
                "R": null,
                "R_spearman": null,
                "R_kendall": null,
                "nmb": null,
                "mnmb": null,
                "fge": null
            }
        }
    },

Those files are accessed from the API with the following function:

general_db_get(
    "get_map",
    project,
    experiment,
    network,
    obsvar,
    layer,
    model,
    modvar,
    time,
    data_path=data_path,
)

I would like to be able to pass optional arguments: frequency, time, and season in order to get a subset of the map file. If provided, the subset should only contain statistics for the given frequency, time and season.

Note

maybe more relevant for the API, but the time parameter can contain slashes

@AugustinMortier AugustinMortier added the enhancement New feature or request label Dec 20, 2024
@thorbjoernl thorbjoernl added this to the m2025-02 milestone Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants