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

SARAH-2 cutout creation issue #57

Closed
obeles opened this issue Apr 2, 2020 · 7 comments
Closed

SARAH-2 cutout creation issue #57

obeles opened this issue Apr 2, 2020 · 7 comments

Comments

@obeles
Copy link

obeles commented Apr 2, 2020

Hello,

I seem to be having trouble creating a cutout for SARAH-2 data. I was able to get ERA5 to work fine, but for some reason SARAH-2 seems to be giving me problems.


Script:

`import logging
import atlite

logging.basicConfig(level=logging.DEBUG)

'''SARAH-2 DOESNT SEEM TO BE WORKING. ERA5 is okay'''

cutout = atlite.Cutout(name="SARAH_SthAfr_2011_01",
cutout_dir="/Users/lennon/Documents/GitHub/Sites/obeles.github.io/atlite/atlite/datasets/ERA5_datasets/cutouts",
module="sarah",
xs=slice(27.25, 32.25),
ys=slice(-30.75, -35.75),
years=slice(2011, 2011),
months=slice(1,1)
)

cutout.prepare()`


Script Error:

`INFO:atlite.cutout:Cutout SARAH_SthAfr_2011_01 not found in directory /Users/lennon/Documents/GitHub/Sites/obeles.github.io/atlite/atlite/datasets/ERA5_datasets/cutouts, building new one
Traceback (most recent call last):

File "/Users/lennon/Dropbox/Scripts/solar_atlite_cutout.py", line 24, in
months=slice(1,1)

File "/Users/lennon/anaconda3/envs/geo_env/lib/python3.7/site-packages/atlite/cutout.py", line 88, in init
self.meta = self.get_meta(**cutoutparams)

File "/Users/lennon/anaconda3/envs/geo_env/lib/python3.7/site-packages/atlite/preparation.py", line 171, in cutout_get_meta
ds = prepare_func(xs=xs, ys=ys, year=years.stop, month=months.stop, **meta_kwds)

File "/Users/lennon/anaconda3/envs/geo_env/lib/python3.7/site-packages/atlite/datasets/sarah.py", line 70, in prepare_meta_sarah
for t in (template_sis, template_sid)]

File "/Users/lennon/anaconda3/envs/geo_env/lib/python3.7/site-packages/atlite/datasets/sarah.py", line 70, in
for t in (template_sis, template_sid)]

StopIteration`

@euronion
Copy link
Collaborator

euronion commented Apr 3, 2020

Hi Obeles,

cutout creation with SARAH-2 is poorly documented in the moment.
This will change with the upcoming version which I hope to finish reviewing soon.

To create a cutout from SARAH-2 data, you need to:

  • Download the raw SARAH-2 data first
  • extract SID and SIS data into two folders SID/ and SIS/ in a joint directory, e.g. sarah/SIS/ and sarah/SID.
  • Point SARAH_DIR in conf.py to the parent directory sarah

Then try the creation again.

@obeles
Copy link
Author

obeles commented Apr 4, 2020

Hi euronion,

Thank you for the quick reply! I am a bit new to these topics, is there any chance I could bother you for a link of where I can find these SARAH-2 raw datasets. I attempted finding them myself but didnt have much luck.

Thank you for all the help!

@coroa
Copy link
Member

coroa commented Apr 4, 2020

https://wui.cmsaf.eu/safira/action/viewDoiDetails?acronym=SARAH_V002_01

@fang1103
Copy link

fang1103 commented Apr 6, 2020

Hi, @euronion, I have several questions regarding the documentation of Atlite with Cordex dataset, which I think maybe suitable to put here.

Do you have any example/document of Atlite (the current version V0.0.2 or the upcoming V0.2) working with the Cordex data?
It seems that I should download all the 9 variables (influx, outflux, etc...) and store them into 9 folders in the same directory?
Do the variable "CWT" mean "compute working team"? I cannot find this variable in the Cordex output variable list.
Is it possible to prepare a cutout with only a subset of the 9 variables with Cordex?

Thank you in advance!

@obeles
Copy link
Author

obeles commented Apr 24, 2020

Hi @euronion ,

I am still having some trouble creating the cutout with SARAH data following your instructions. Is there any chance you could share some code that you have utilized that does indeed work that way I can troubleshoot more effectively?

Thank you!

@euronion
Copy link
Collaborator

Hi @obeles ,

Configuration wise this is the strcutre and settings in the atlite package config.py.
sid and sis are subdirectories, containing the single .nc files of the respective variable.

> ~/miniconda3/envs/pypsa-eur/lib/python3.7/site-packages/atlite$ tree -d /home/pypsa/share/atlite-sarah2/data/sarah
/home/pypsa/share/atlite-sarah2/data/sarah
├── sid
└── sis

2 directories
> ~/miniconda3/envs/pypsa-eur/lib/python3.7/site-packages/atlite$ cat config.py | grep sarah
sarah_dir = '/home/pypsa/share/atlite-sarah2/data/sarah'

The .cdsapirc file is setup in my home directory ~ to utilise the ERA5 download (aux. data also required for SARAH cutouts).

To create a cutout, the standard script should work (and does for me):

import atlite

cutout = atlite.Cutout(
			"my_cutout",
			cutout_dir="./",
			module="sarah",
			xs=slice(-5, 5),
			ys=slice(65., 60.),
			years=slice(2013,2013),
			months=slice(1,3))

cutout.prepare()

Hope that helps.

@obeles
Copy link
Author

obeles commented Apr 29, 2020

Okay, yes. Modifying the path of the cutout through my terminal seems to have done the trick. Thanks again!

@obeles obeles closed this as completed Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants