PyPSA / PyPSA/atlite

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

Open
#455 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: bug
Dominant language
Python
Stars
402
Forks
134
PR merge metrics
No merged PRs in 30d

Description

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

Replace this line.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the example with atlite.Cutout using the existing NorthAmerica.nc file, then trace how the Cutout constructor and prepare() handle shapes_crs and a pre-existing cutout. Confirm whether the CRS should be accepted for this workflow and document or test the expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.