Skip to content

Cannot set CRS for a pre-existing .nc cut out. #455

Description

@AboodaA

Version Checks (indicate both or one)

  • I have confirmed this bug exists on the lastest release of atlite.

  • I have confirmed this bug exists on the current master branch of atlite.

Issue Description

Hello. I am not sure if this is fully a "bug," but maybe a little bit of advice would help.

I have a pre-existing cutout ("NorthAmerica.nc") from using PyPSA-Earth. I am trying to "prepare" that cutout as shown below, but I always get the error that no CRS was set. I have also tried to set the CRS.

Am I missing a step? I could not find it in your ReadtheDocs examples.

     path="NorthAmerica.nc",
        #shapes_crs = 4326

Below, I have given you a screen shot of the error message which I get. FWIW: I would download the cutouts separately now, but they do seem to take quite a while even for an area which is like 2 degrees longitude by 2 degrees latitude.

Image

Reproducible Example

import atlite

# Define the cutout for a specific region and time
cutout = atlite.Cutout(
        path="NorthAmerica.nc",
        shapes_crs = 4326
    )

# Prepare the cutout (downloads and processes data if not already present)
cutout.prepare()

Expected Behavior

I would have thought that this assigns a CRS to the cut out.

Installed Versions

Details

Replace this line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Quick wins

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions