Cannot set CRS for a pre-existing .nc cut out.
Nobody has claimed this yet.
- 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
masterbranch 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.
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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